{ "info": { "author": "Matt Long", "author_email": "matt@mattlong.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "# python-quickbooks\n\n[![Build Status](https://travis-ci.org/sidecars/python-quickbooks.svg?branch=master)](https://travis-ci.org/sidecars/python-quickbooks)\n\nA Python library for accessing the Quickbooks API. \nComplete rework of [quickbooks-python](https://github.com/troolee/quickbooks-python).\n\nThese instructions were written for a Django application. Make sure to change it to whatever framework/method you're using. \n\n## Connecting your application to Quickbooks Online\n\n1. Create the Authorization URL for your application:\n\n from quickbooks import QuickBooks\n \n quickbooks = QuickBooks(\n sandbox=True,\n consumer_key=QUICKBOOKS_CLIENT_KEY,\n consumer_secret=QUICKBOOKS_CLIENT_SECRET,\n callback_url=CALLBACK_URL\n )\n\n authorize_url = quickbooks.get_authorize_url()\n\n Store the authorize_url, request_token, and request_token_secret for use in the Callback method.\n\n2. Handle the callback:\n\n quickbooks = QuickBooks(\n sandbox=True,\n consumer_key=QUICKBOOKS_CLIENT_KEY,\n consumer_secret=QUICKBOOKS_CLIENT_SECRET,\n callback_url=CALLBACK_URL\n )\n \n quickbooks.authorize_url = authorize_url\n quickbooks.request_token = request_token\n quickbooks.request_token_secret = request_token_secret\n quickbooks.set_up_service()\n \n quickbooks.get_access_tokens(request.GET['oauth_verifier'])\n \n realm_id = request.GET['realmId']\n access_token = quickbooks.access_token\n access_token_secret = quickbooks.access_token_secret\n\n Store realm_id, access_token, and access_token_secret need to be stored for later use.\n\n\n## Accessing the API\n\nQuickBooks client uses a singleton pattern. Just be sure to create the QuickBooks object before you make any calls to QBO.\nSetup the client connection using the stored `access_token` and the `access_token_secret` and `realm_id`:\n\n from quickbooks import QuickBooks\n\n QuickBooks(\n sandbox=True,\n consumer_key=QUICKBOOKS_CLIENT_KEY,\n consumer_secret=QUICKBOOKS_CLIENT_SECRET,\n access_token=access_token,\n access_token_secret=access_token_secret,\n company_id=realm_id\n )\n\n\nList of objects:\n\n from quickbooks.object.customer import Customer\n customers = Customer.all()\n\n__Note:__ The maximum number of entities that can be returned in a response is 1000. If the result size is not specified, the default number is 100. \n(See [Intuit developer guide](https://developer.intuit.com/docs/0100_accounting/0300_developer_guides/querying_data) for details)\n\nFiltered list of objects:\n\n customers = Customer.filter(Active=True, FamilyName=\"Smith\")\n \n\nFiltered list of objects with paging:\n\n customers = Customer.filter(start_position=1, max_results=25, Active=True, FamilyName=\"Smith\")\n \n\nList with custom Where Clause (do not include the \"WHERE\"):\n \n customers = Customer.where(\"Active = True AND CompanyName LIKE 'S%'\")\n \n \nList with custom Where Clause with paging:\n \n\n customers = Customer.where(\"CompanyName LIKE 'S%'\", start_position=1, max_results=25)\n \n \nFiltering a list with a custom query (See [Intuit developer guide](https://developer.intuit.com/docs/0100_accounting/0300_developer_guides/querying_data) for supported SQL statements):\n\n customer = Customer.query(\"SELECT * FROM Customer WHERE Active = True\")\n\nFiltering a list with a custom query with paging:\n\n customer = Customer.query(\"SELECT * FROM Customer WHERE Active = True STARTPOSITION 1 MAXRESULTS 25\")\n\nGet single object by Id and update:\n\n customer = Customer.get(1)\n customer.CompanyName = \"New Test Company Name\"\n customer.save()\n\n\nCreate new object:\n\n customer = Customer()\n customer.CompanyName = \"Test Company\"\n customer.save()\n\n\n## Batch Operations\n\nThe batch operation enables an application to perform multiple operations in a single request\n(See [Intuit Batch Operations Guide](https://developer.intuit.com/docs/0100_accounting/0300_developer_guides/batch_operations) for full details).\n\n\nBatch create a list of objects: \n\n from quickbooks.batch import batch_create\n \n customer1 = Customer()\n customer1.CompanyName = \"Test Company 1\"\n customer1.save()\n \n customer2 = Customer()\n customer2.CompanyName = \"Test Company 2\"\n customer2.save()\n \n customers = []\n customers.append(customer1)\n customers.append(customer2)\n \n results = batch_create(customers)\n \n \nBatch update a list of objects:\n \n from quickbooks.batch import batch_update\n \n customers = Customer.filter(Active=True)\n \n # Update customer records\n \n results = batch_update(customers)\n \n \nBatch delete a list of objects:\n \n from quickbooks.batch import batch_delete\n \n customers = Customer.filter(Active=False)\n results = batch_delete(customers)\n \n \nReview results for batch operation:\n \n # successes is a list of objects that were successfully updated \n for obj in results.successes:\n print \"Updated \" + obj.DisplayName\n \n # faults contains list of failed operations and associated errors\n for fault in results.faults:\n print \"Operation failed on \" + fault.original_object.DisplayName \n \n for error in fault.Error:\n print \"Error \" + error.Message \n \n\n__Note:__ Objects and object property names match their Quickbooks counterparts and do not follow PEP8. \n\n__Note:__ This is a work-in-progress made public to help other developers access the QuickBooks API. \nBuilt for a Django project running on Python 2. It has not been tested with Python 3.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mattlong/python-quickbooks", "keywords": "quickbooks,qbo,accounting", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "python-quickbooks3", "package_url": "https://pypi.org/project/python-quickbooks3/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/python-quickbooks3/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/mattlong/python-quickbooks" }, "release_url": "https://pypi.org/project/python-quickbooks3/0.4.1/", "requires_dist": null, "requires_python": null, "summary": "A Python library for accessing the Quickbooks API. Forked from https://github.com/sidecars/python-quickbooks to improve Python 3 compatibility. Thanks to Edward Emanuel Jr.", "version": "0.4.1" }, "last_serial": 1854496, "releases": { "0.4.0": [], "0.4.1": [ { "comment_text": "", "digests": { "md5": "1bbb0bec9b55612019ce08bdeb08b51f", "sha256": "8f954d81c29499f9d695e25a9e2e0dae74565d263a1ca9b960f34b4e518642b8" }, "downloads": -1, "filename": "python_quickbooks3-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1bbb0bec9b55612019ce08bdeb08b51f", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 60317, "upload_time": "2015-12-09T20:42:26", "url": "https://files.pythonhosted.org/packages/25/16/6acf2c2aab199d450745b17396c6677f1c87101ad04cbf7d342ad44295f9/python_quickbooks3-0.4.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e6c9683ea309da75391700107763d254", "sha256": "7dfdde0a2efa26201999001e545a5a6ad17593a5c9fe02c72460276a002ecf2e" }, "downloads": -1, "filename": "python-quickbooks3-0.4.1.tar.gz", "has_sig": false, "md5_digest": "e6c9683ea309da75391700107763d254", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27632, "upload_time": "2015-12-09T20:42:13", "url": "https://files.pythonhosted.org/packages/c2/76/ded7d45187f01c276540395eb6d1d297c076edf0ca62065ef1c5a014ad6c/python-quickbooks3-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1bbb0bec9b55612019ce08bdeb08b51f", "sha256": "8f954d81c29499f9d695e25a9e2e0dae74565d263a1ca9b960f34b4e518642b8" }, "downloads": -1, "filename": "python_quickbooks3-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1bbb0bec9b55612019ce08bdeb08b51f", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 60317, "upload_time": "2015-12-09T20:42:26", "url": "https://files.pythonhosted.org/packages/25/16/6acf2c2aab199d450745b17396c6677f1c87101ad04cbf7d342ad44295f9/python_quickbooks3-0.4.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e6c9683ea309da75391700107763d254", "sha256": "7dfdde0a2efa26201999001e545a5a6ad17593a5c9fe02c72460276a002ecf2e" }, "downloads": -1, "filename": "python-quickbooks3-0.4.1.tar.gz", "has_sig": false, "md5_digest": "e6c9683ea309da75391700107763d254", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27632, "upload_time": "2015-12-09T20:42:13", "url": "https://files.pythonhosted.org/packages/c2/76/ded7d45187f01c276540395eb6d1d297c076edf0ca62065ef1c5a014ad6c/python-quickbooks3-0.4.1.tar.gz" } ] }