A Python command-line interface for interacting with Salesforce.com
- Authenticate using environment variables
- Display total contact count
- Query contacts by FirstName, LastName, Account.Name, or Email
- Edit contacts with field-by-field updates
- Multiline Description input using Ctrl+D
- Preserve original values for unchanged fields
- Verify updates after saving changes
- Backup all contacts to files (sorted by Account and LastName)
- contacts_backup.txt: Human-readable format
- contacts_backup.csv: Machine-readable format with column headers
- Clone the repository
- Create and activate a virtual environment:
python -m venv venv_salesforce source venv_salesforce/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Set required environment variables:
export SALESFORCE_USERNAME_1="your_username" export SALESFORCE_PASSWORD_1="your_password" export SALESFORCE_SECURITY_TOKEN_1="your_security_token"
Run the application:
python salesforce.py
- Query Contacts
- Enter search criteria
- View matching contacts
- Option to edit a contact
- Backup Contacts
- Export all contacts to both contacts_backup.txt and contacts_backup.csv (overwrites existing files)
- Includes: FirstName, LastName, Account.Name, Email, Title, Phone, Description
- CSV format includes column headers for easy import
- Sorted by Account.Name then LastName
- Exit
- After querying, select a contact to edit
- Step through editable fields:
- FirstName
- LastName
- Title
- Description (multiline input with Ctrl+D)
- Press Enter to keep current value
- Changes are saved and verified
- Python 3.x
- simple_salesforce package