Skip to main content

Client for the LNX Edge API

Project description

LNX Edge API Client

Written for Python ≥ 3.7

Quickstart

Install using pip:

pip install api-client-lnx-edge

Set the following environment variables:

  • EDGE_API_KEY: your production API Key (will be looked up automatically on init)
  • EDGE_STAGING_API_KEY: your staging API Key (also will be looked up automatically on init, requires the use of the staging=True flag. see below)

Then you're off:

# import
from edge_api_client import EdgeAPI

# initialize
edge = EdgeAPI()  # uses the environment variable `EDGE_API_KEY`
# or
edge = EdgeAPI(api_key='XXX')  # try not to do this, but if you have to...
# or
edge = EdgeAPI(staging=True)  # uses the environment variable `EDGE_STAGING_API_KEY`, targets the staging backend
# or
edge = EdgeAPI(api_key='XXX', staging=True)  # provide a staging API key and target staging backend

# and you're off:
resp = edge.get_offers()

Behavioral rules of thumb:

When requesting a report:

  • Pass date (YYYY-MM-DD) strings instead of datetime strings (YYYY-MM-DDTHH:MM:SS.sss) to the dateRange field. # TODO FIX THIS
  • Timezone should always be specified in the request body. EdgeAPI._get_report(...) defaults to America/New_York, but can be overridden.

Test script:

(venv) > pytest -v

Now using marshmallow for data validation on the client-side, allowing users to either specify content as JSON or as python arguments for Create Offer endpoint.

Packaging instructions found here: https://packaging.python.org/en/latest/tutorials/packaging-projects/

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

api-client-lnx-edge-0.3.7.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

api_client_lnx_edge-0.3.7-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file api-client-lnx-edge-0.3.7.tar.gz.

File metadata

  • Download URL: api-client-lnx-edge-0.3.7.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.10

File hashes

Hashes for api-client-lnx-edge-0.3.7.tar.gz
Algorithm Hash digest
SHA256 cf2b0d2661c5aae099229c035852f438c3da07d0fa70836a851bfb5a98351011
MD5 e67142f087711b465e013022608c4c26
BLAKE2b-256 8a94ece5eee17fcb164494fe98de364a98324882e7198b4e6fbe8513e77d8bc3

See more details on using hashes here.

File details

Details for the file api_client_lnx_edge-0.3.7-py3-none-any.whl.

File metadata

File hashes

Hashes for api_client_lnx_edge-0.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 6e1f3ca46baec40afb129b39ef2f1a8a6b3957b71d37854ab9529d4e809f66b0
MD5 15ecf2780df13a0e3722f035dbb48a53
BLAKE2b-256 87b31fb78faf4043d92b6c6657f9219016c04bc73b0cf8be0b42d01a08002184

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