{"id":19315485,"url":"https://github.com/fylein/qbo-db-connector","last_synced_at":"2025-09-11T23:32:15.324Z","repository":{"id":47649419,"uuid":"220236465","full_name":"fylein/qbo-db-connector","owner":"fylein","description":"Connects Quickbooks to a database connector to transfer information to and fro.","archived":false,"fork":false,"pushed_at":"2021-08-20T05:20:26.000Z","size":63,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-01T12:39:14.509Z","etag":null,"topics":["team-integrations"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fylein.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-07T12:52:03.000Z","updated_at":"2023-05-04T05:06:40.000Z","dependencies_parsed_at":"2022-09-23T15:22:14.733Z","dependency_job_id":null,"html_url":"https://github.com/fylein/qbo-db-connector","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fylein%2Fqbo-db-connector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fylein%2Fqbo-db-connector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fylein%2Fqbo-db-connector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fylein%2Fqbo-db-connector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fylein","download_url":"https://codeload.github.com/fylein/qbo-db-connector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232670315,"owners_count":18558568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["team-integrations"],"created_at":"2024-11-10T01:07:10.816Z","updated_at":"2025-01-06T03:41:42.569Z","avatar_url":"https://github.com/fylein.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quickbooks Online Database Connector\nConnects Quickbooks online to a database to transfer information to and fro.\n\n## Installation\n\nThis project requires [Python 3+](https://www.python.org/downloads/).\n\n1. Download this project and use it (copy it in your project, etc).\n2. Install it from [pip](https://pypi.org).\n\n        $ pip install qbo-db-connector\n\n## Usage\n\nTo use this connector you'll need these Quickbooks credentials used for OAuth2 authentication: **client ID**, **client secret** and **refresh token**.\n\nThis connector is very easy to use.\n```python\nimport logging\nimport sqlite3\nfrom qbosdk import QuickbooksOnlineSDK\n\nfrom qbo_db_connector import QuickbooksExtractConnector, QuickbooksLoadConnector\n\n\ndbconn = sqlite3.connect('/tmp/temp.db')\n\nlogger = logging.getLogger('Quickbooks usage')\nlogging.basicConfig(\n    format='%(asctime)s %(name)s: %(message)s', level=logging.INFO, handlers=[logging.StreamHandler()]\n)\n\nquickbooks_config = {\n    'client_id': '\u003cCLIENT ID\u003e',\n    'client_secret': '\u003cCLIENT SECRET\u003e',\n    'realm_id': '\u003cREALM ID\u003e',\n    'refresh_token': '\u003cREFRESH TOKEN\u003e',\n    'environment': '\u003cENVIRONMENT\u003e',\n}\n\nlogger.info('Quickbooks db connector usage')\n\nconnection = QuickbooksOnlineSDK(\n    client_id=quickbooks_config['client_id'],\n    client_secret=quickbooks_config['client_secret'],\n    refresh_token=quickbooks_config['refresh_token'],\n    realm_id=quickbooks_config['realm_id'],\n    environment=quickbooks_config['environment']\n)\n\nquickbooks_extract = QuickbooksExtractConnector(qbo_connection=connection, dbconn=dbconn)\nquickbooks_load = QuickbooksLoadConnector(qbo_connection=connection, dbconn=dbconn)\n\n# make sure you save the updated refresh token\nrefresh_token = connection.refresh_token\n\n# extracting\nquickbooks_extract.extract_employees()\nquickbooks_extract.extract_accounts()\nquickbooks_extract.extract_classes()\nquickbooks_extract.extract_departments()\nquickbooks_extract.extract_home_currency()\nquickbooks_extract.extract_exchange_rates()\n\n# loading\nquickbooks_load.load_check(check_id='100')\nquickbooks_load.load_journal_entry(journal_entry_id='800')\nquickbooks_load.load_attachments(ref_id='100', ref_type='Purchase')\n```\n\n## Contribute\n\nTo contribute to this project follow the steps\n\n* Fork and clone the repository.\n* Run `pip install -r requirements.txt`\n* Setup pylint precommit hook\n    * Create a file `.git/hooks/pre-commit`\n    * Copy and paste the following lines in the file - \n        ```bash\n        #!/usr/bin/env bash \n        git-pylint-commit-hook\n        ```\n     * Run `chmod +x .git/hooks/pre-commit`\n* Make necessary changes\n* Run unit tests to ensure everything is fine\n\n## Unit Tests\n\nTo run unit tests, run pytest in the following manner:\n\n```\npython -m pytest test/unit\n```\n\nYou should see something like this:\n```\n================================================================== test session starts ==================================================================\n-------------------------------------------------------------------------------------------------------------------------------- live log call ---------------------------------------------------------------------------------------------------------------------------------\n2019-12-24 12:10:46 [    INFO] test.unit.test_mocks: Testing mock data (test_mocks.py:18)\nPASSED                                                                                                                                                                                                                                                                   [ 69%]\ntest/unit/test_mocks.py::test_dbconn_mock_setup\n-------------------------------------------------------------------------------------------------------------------------------- live log call ---------------------------------------------------------------------------------------------------------------------------------\n2019-12-24 12:10:46 [    INFO] test.unit.test_mocks: Testing mock dbconn (test_mocks.py:29)\nPASSED                                                                                                                                                                                                                                                                   [ 76%]\ntest/unit/test_mocks.py::test_qec_mock_setup                                                                                           [100%]\n\n=================================================================== 3 passed in 0.10s ===================================================================\n\n```\n\n## Integration Tests\n\nTo run integration tests, you will need a mechanism to connect to a real qbo account. Save this info in a test_credentials.json file in your root directory:\n\n```json\n{\n  \"client_id\": \"\u003cclient_id\u003e\",\n  \"client_secret\": \"\u003cclient_secret\u003e\",\n  \"realm_id\": \"\u003crealm_id\u003e\",\n  \"refresh_token\": \"\u003crefresh_token\u003e\",\n  \"environment\": \"\u003cenvironment sandbox / production\u003e\"\n}\n```\n\n## Code coverage\n\nTo get code coverage report, run this command:\n\n```bash\n---------- coverage: platform darwin, python 3.7.4-final-0 -----------\nName                           Stmts   Miss  Cover\n--------------------------------------------------\nqbo_db_connector/__init__.py       2      0   100%\nqbo_db_connector/extract.py       79      3    96%\nqbo_db_connector/load.py          71      9    87%\n--------------------------------------------------\nTOTAL                            152     12    92%\n```\n\nTo get an html report, run this command:\n\n```bash\npython -m pytest --cov=qbo_db_connector --cov-report html:cov_html\n```\n\nWe want to maintain code coverage of more than 90% for this project at all times.\n\nPlease note that maintaining a score of 10 is important as the CI pylint action fails when a pull request is opened\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffylein%2Fqbo-db-connector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffylein%2Fqbo-db-connector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffylein%2Fqbo-db-connector/lists"}