Skip to main content

ENGINE4 API Wrapper

Project description

engine4-python

⚙️ Python library for the ENGINE4 API.

Installation

Use pip to install the package:

pip3 install engine4

Usage

First of all, you import ENGINE4 so that you can create an instance of the class. You need to pass the base_url of the API server:

from engine4 import ENGINE4

engine4 = ENGINE4('https://test.engine4.io/')

Now you can authenticate yourself with username, password and client_id:

def authenticate() -> str:
  username = 'my_username'
  password = 'my_password'
  client_id = 'my_client_id'
  result = engine4.authenticate(username, password, client_id)
  return result.access_token

The access token is required for the following calls.

Here you can find examples:

from engine4 import FetchFilterOptions

access_token = authenticate()

def fetch() -> list:
  entity_id = '12e2eb88-814a-0a98-40e2-b006586dfd59'
  skip = 0
  take = 2
  with_long_values = False
  is_active = True
  filter = FetchFilterOptions('CreatedDate', '>', '2018-01-01T00:00:00.000Z')
  result = engine4.fetch(access_token, entity_id, skip, take, False, is_active, filter)
  return fetch_result['items']

Changelog

See CHANGELOG.md.

License

See LICENSE.

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

engine4-0.0.2.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

engine4-0.0.2-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

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