Giter VIP home page Giter VIP logo

django-exact's Introduction

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

what about exactonline?

this used to be a django based storage and auth view for that. see storage.py for a compatible storage backend that does use django instead of an INI file

django-exact's People

Contributors

maldn avatar alex-sichkar avatar fijter avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.