Skip to main content

Modern Python interface to the exact online API

Project description

ExactPy

A modern, highly configurable Python interface to the Exact Online API based on Pydantic.

Why?

Currently available packages aren't configurable in such a way that they are usable to me. This package attempts to fix that.

Sample usage

Initial oauth token request

This initial token request theoretically needs to be done once. An access token and requets token will be available after this. If the access token is refreshed in time (refresh token is valid for 30 days max), no log in has to be performed.

from exactpy.client import Client

client = Client(
    client_id="xxx",
    client_Secret="xxx,
    verbose=True,
)

# this can literally be anything, but it needs to be valid
# so that redirects can happen
redirect_url = "https://some_website"
print(client.get_authorization_url(redirect_url=redirect_url)

# Now, open the url that was printed, log in to exactonline and copy the response url
response_url = "<paste_url_here>"

# Now retrieve the access token and refresh token
client.retrieve_token(response_url=response_url)
client.cache_credentials()

If your cache callable was not set to None, your credentials should now have been saved. In the default case, they're saved in creds.json (plain text).

Now you can use the client like below:

from exactpy.client import Client

client = Client(
    client_id="xxx",
    client_Secret="xxx,
    verbose=True,
)

client.load_credentials()
client.check_token_validity()
client.cache_credentials()

# Every request you do, will trigger a token
# check as well. In the default case, auto-caching is done
# This means that the current access token and refresh token
# (after a optional refresh) are cached. This is only true
# if cache_callable was not set to None.
# To disable this behaviour, either set cache_callable to None
# or set autocache_enabled to False.
accounts = client.accounts.all()

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

exactpy-0.0.8.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

exactpy-0.0.8-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file exactpy-0.0.8.tar.gz.

File metadata

  • Download URL: exactpy-0.0.8.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for exactpy-0.0.8.tar.gz
Algorithm Hash digest
SHA256 9c85f658cafa3954c51800e3aeba96602ac44bf4d08908e9c8305ae73dff3292
MD5 6d13267b9b187704b415d7033bc636bd
BLAKE2b-256 8f00ef79bfa47a9638d7f29d524a65d636ed3d17811fd0788dcb8e33acce8edd

See more details on using hashes here.

Provenance

The following attestation bundles were made for exactpy-0.0.8.tar.gz:

Publisher: publish.yml on riccardo92/exactpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file exactpy-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: exactpy-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for exactpy-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 3a043c1b62753409da86b942641f59563db179e7f1e2d5a379dfb0042d597d29
MD5 04337fa6a4936835b13ce1ec2179d073
BLAKE2b-256 244d8f86671935763b535e8ef4a297c2f434037f18e18621177ea84a7fd5e8eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for exactpy-0.0.8-py3-none-any.whl:

Publisher: publish.yml on riccardo92/exactpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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