{"id":24578,"library":"sfbulk2","title":"sfbulk2","description":"A utility class for Salesforce Bulk API 2.0, providing features for bulk data operations such as query, insert, update, upsert, and delete. Version 0.8.0 is currently released with no recent updates; the library is in maintenance mode.","status":"maintenance","version":"0.8.0","language":"python","source_language":"en","source_url":"https://github.com/mohan-chinnappan-n/sfbulk2","tags":["salesforce","bulk-api","data-cloud","etl"],"install":[{"cmd":"pip install sfbulk2","lang":"bash","label":"Latest release"}],"dependencies":[],"imports":[{"note":"The class is not directly accessible if only importing the package; you must import the class explicitly.","wrong":"import sfbulk2","symbol":"Bulk2","correct":"from sfbulk2 import Bulk2"}],"quickstart":{"code":"from sfbulk2 import Bulk2\nimport os\n\nbulk = Bulk2(\n    username=os.environ.get('SF_USERNAME', ''),\n    password=os.environ.get('SF_PASSWORD', ''),\n    security_token=os.environ.get('SF_SECURITY_TOKEN', ''),\n    client_id=os.environ.get('SF_CLIENT_ID', ''),\n    client_secret=os.environ.get('SF_CLIENT_SECRET', ''),\n    domain='login'  # or 'test' for sandbox\n)\n\n# Example: query records\njob_id = bulk.create_query_job('SELECT Id, Name FROM Account')\nresults = bulk.get_query_job_results(job_id)\nprint(results)","lang":"python","description":"Initialize the Bulk2 client with Salesforce credentials and run a simple query. Credentials are read from environment variables for security."},"warnings":[{"fix":"Ensure your Salesforce user has a security token (or use an IP-whitelisted network). Append the token to the password if needed.","message":"The library uses OAuth 2.0 with password grant; you must provide username, password, security token, and client credentials. Missing security token is a common issue.","severity":"gotcha","affected_versions":"all"},{"fix":"Use the provided methods to check job status and retrieve results after the job completes.","message":"Bulk API 2.0 jobs are asynchronous; methods like create_query_job only return a job ID. You must poll for completion using get_query_job_results or similar.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider migrating to the official Salesforce SDK or other maintained libraries like simple-salesforce.","message":"The library has not been updated since 2021 and may not support newer Salesforce Bulk API changes. It is in maintenance mode.","severity":"deprecated","affected_versions":"0.8.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install sfbulk2` in your current Python environment.","cause":"The library is not installed or installed in a different environment.","error":"from sfbulk2 import Bulk2\nModuleNotFoundError: No module named 'sfbulk2'"},{"fix":"Verify your username, password, and security token. If needed, append the security token to the password (e.g., password+token).","cause":"Incorrect Salesforce credentials or missing security token.","error":"sfbulk2.exceptions.SFBulk2Error: Invalid username, password, security token; or user locked out."},{"fix":"Use `from sfbulk2 import Bulk2`.","cause":"Importing the package incorrectly (e.g., `import sfbulk2` then `sfbulk2.Bulk2`).","error":"AttributeError: module 'sfbulk2' has no attribute 'Bulk2'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}