Skip to main content

API Wrapper and Django app for Exact Online

Project description

API Wrapper and Django app for Exact Online

  • transparently handles re-authentication. Exact's OAuth2 tokens are valid for 10 minutes
  • handles pagination. filter() returns a generator
  • uses connection keep-alive (thanks to the requests library) resulting in huge performance gain. Exact can take over 5 seconds to establish a HTTPS/TLS connection, subsequent requests are faster)

Setup

install && migrate

settings.py:

EXACT_ONLINE_API_URL = "https://start.exactonline.nl/api"
EXACT_ONLINE_CLIENT_ID = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
EXACT_ONLINE_CLIENT_SECRET = "asdf"
EXACT_ONLINE_REDIRECT_URI = "http://localhost:8000/exact/authenticate"
EXACT_ONLINE_DIVISION = 1234567

urls.py:

url(r'^exact/', include(('exact.urls', 'exact'), namespace='exact'))

Usage

go to http://localhost:8000/exact/authenticate to start the OAuth2 dance.

generic usage: first param is the resource. see Exact Online for available resources

    from exact.api import Exact
    e = Exact()

    # first param is the resource.
    # see https://start.exactonline.nl/docs/HlpRestAPIResources.aspx

    # filter returns a generator and handles pagination for you
    for acc in e.filter("crm/Accounts", filter_string="substringof('GmbH', Name) eq true"):
        pass

    # can raise e.DoesNotExist and e.MultipleObjectsReturned
    e.get(resource, filter_string=None, select=None):

    e.create(resource, data)

    e.update(resource, guid, data)

    e.delete(resource, guid)

see odata.org for info on how to use filter_string

helpers:

    from exact.api import Exact
    e = Exact()
    e.accounts.get(code="1234")
    e.glaccounts.get(code="1234")
    e.costcenters.get(code="12345")

webhooks

... are easily created/deleted through /admin/exact/webhook

Project details


Download files

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

Source Distribution

django_exact-0.9.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_exact-0.9.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file django_exact-0.9.0.tar.gz.

File metadata

  • Download URL: django_exact-0.9.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for django_exact-0.9.0.tar.gz
Algorithm Hash digest
SHA256 a5d457773b9bc6ec783bb2feae759bffad5b12dbb7216fcd2cffcbbd11c51a7b
MD5 fd7aabbef38b04ad12a627c91f1c0516
BLAKE2b-256 d9f982cd12407f21660656f36bd683a70c96c92d713f038d6ee508f6b5311702

See more details on using hashes here.

File details

Details for the file django_exact-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: django_exact-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for django_exact-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf4335e3df88830a20441dc31c5b954f93a5e0fc70e769e10e83cd1e07710718
MD5 251d79e706c8b2657478703e92553162
BLAKE2b-256 ee710a3e289beb3d1fc32deb06082ac5bd0eeff50bdb876f191b6d4224e316a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page