Skip to main content

Connects Quickbooks to a database connector to transfer information to and fro.

Project description

Quickbooks Online Database Connector

Connects Quickbooks online to a database to transfer information to and fro.

Installation

This project requires Python 3+.

  1. Download this project and use it (copy it in your project, etc).

  2. Install it from pip.

     $ pip install qbo-db-connector
    

Usage

To use this connector you'll need these Quickbooks credentials used for OAuth2 authentication: client ID, client secret and refresh token.

This connector is very easy to use.

import logging
import sqlite3

from qbo_db_connector import QuickbooksExtractConnector, QuickbooksLoadConnector


dbconn = sqlite3.connect('/tmp/temp.db')

logger = logging.getLogger('Quickbooks usage')
logging.basicConfig(
    format='%(asctime)s %(name)s: %(message)s', level=logging.INFO, handlers=[logging.StreamHandler()]
)

quickbooks_config = {
    'client_id': '<CLIENT ID>',
    'client_secret': '<CLIENT SECRET>',
    'realm_id': '<REALM ID>',
    'refresh_token': '<REFRESH TOKEN>',
    'base_url': '<API BASE URL>',
    'environment': '<ENVIRONMENT>',
    'web_app_url': '<QUICKBOOKS WEB APP URL>'
}

logger.info('Quickbooks db connector usage')

quickbooks_extract = QuickbooksExtractConnector(config=quickbooks_config, dbconn=dbconn)
quickbooks_load = QuickbooksLoadConnector(config=quickbooks_config, dbconn=dbconn)

# make sure you save the updated refresh token
refresh_token = quickbooks_extract.refresh_token

# extracting
quickbooks_extract.extract_employees()
quickbooks_extract.extract_accounts()
quickbooks_extract.extract_classes()
quickbooks_extract.extract_departments()
quickbooks_extract.extract_home_currency()
quickbooks_extract.extract_exchange_rates()

# loading
quickbooks_load.load_check(check_id='100')
quickbooks_load.load_journal_entry(journal_entry_id='800')
quickbooks_load.load_attachment(ref_id='100', ref_type='check')

Contribute

To contribute to this project follow the steps

  • Fork and clone the repository.
  • Run pip install -r requirements.txt
  • Setup pylint precommit hook
    • Create a file .git/hooks/pre-commit
    • Copy and paste the following lines in the file -
      #!/usr/bin/env bash 
      git-pylint-commit-hook
      
    • Run chmod +x .git/hooks/pre-commit

License

This project is licensed under the MIT License - see the LICENSE file for details

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for qbo-db-connector, version 0.3.1
Filename, size File type Python version Upload date Hashes
Filename, size qbo_db_connector-0.3.1-py3-none-any.whl (10.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size qbo-db-connector-0.3.1.tar.gz (8.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page