Python SDK for accessing QBO APIs.
This project requires Python 3+ and Requests library (pip install requests).
-
Download this project and use it (copy it in your project, etc).
-
Install it from pip.
$ pip install qbosdk
To use this SDK you'll need these QBO credentials used for OAuth2 authentication: client ID, client secret and refresh token.
This SDK is very easy to use.
- First you'll need to create a connection using the main class QuickbooksOnlineSDK.
from qbosdk import QuickbooksOnlineSDK
connection = QuickbooksOnlineSDK(
client_id='<YOUR CLIENT ID>',
client_secret='<YOUR CLIENT SECRET>',
refresh_token='<YOUR REFRESH TOKEN>',
realm_id='<REALM / COMPANY ID>',
environment='<sandbox / production>'
)
- After that you'll be able to access any of the API classes
"""
USAGE: <QuickbooksOnlineSDK INSTANCE>.<API_NAME>.<API_METHOD>(<PARAMETERS>)
"""
# Get a list of all Employees (with all available details for Employee)
response = connection.employees.get()
# Get a list of all Accounts
response = connection.accounts.get()
See more details about the usage into the wiki pages of this project.
To 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:
{
"client_id": "<client_id>",
"client_secret": "<client_secret>",
"realm_id": "<realm_id>",
"refresh_token": "<refresh_token>",
"environment": "<environment sandbox / production>"
}
$ pip install pytest
$ python -m pytest test/integration
This project is licensed under the MIT License - see the LICENSE file for details