Skip to main content

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

errors (all subclasses of ExactException, which carries the response and error_message):

    from exact.api import ExactAuthException, ExactException, ExactUnavailable

    try:
        e.create(resource, data)
    except ExactUnavailable:
        pass  # 5xx or maintenance page, try again later
    except ExactAuthException as ex:
        print(ex.error_message)  # getting/refreshing the token failed, e.g. "Refresh token is invalid."
    except ExactException as ex:
        print(ex.error_message)  # e.g. a validation error

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

Metadata

Release files for django-exact 0.10.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-exact 0.10.1
File Size Uploaded Provenance Actions
django_exact-0.10.1.tar.gz 12.4 kB Without provenance Details for django_exact-0.10.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-exact 0.10.1
File Interpreter ABI Platform Actions
django_exact-0.10.1-py3-none-any.whl Python 3 none any Details for django_exact-0.10.1-py3-none-any.whl

Total release size: 25.8 kB

Release files / django_exact-0.10.1.tar.gz

Download URL django_exact-0.10.1.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
745187d4c02fb5fe036a1cbece35c23b1932aeffe24304227d9fafe7a0b29eef
BLAKE2b-256 checksum
How to use checksums
fe8246ac4064f47dba8df726f4de529f823a6012702938eae91a3ba3c1e38cb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / django_exact-0.10.1-py3-none-any.whl

Download URL django_exact-0.10.1-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6fa54ddffd569f7783c8089b5f131bad77b2b22dc77d8cdec84cff3deab79f96
BLAKE2b-256 checksum
How to use checksums
9637867dc082cbfc7d3458e5aacbb195b249a0b8c5d26e51de66458a1d92620d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for django-exact 0.10.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page