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.10.tar.gz (9.3 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.10-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for api-client-lnx-edge-0.3.10.tar.gz
Algorithm Hash digest
SHA256 58f04019d777e7edfb48f96e7c2564719c26ca56f0af252778f588244d8cd8d6
MD5 ec41083e7bb12c91ef9ec9e179810f89
BLAKE2b-256 7e5a198e1f71a062f1c070905992edf6aa3dfdef52a58ed336d5f630c729d813

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for api_client_lnx_edge-0.3.10-py3-none-any.whl
Algorithm Hash digest
SHA256 bfdfc75b7c23658192ae3873cfa57af4bc0a4d743a74b788dd6c1ce36f94a378
MD5 4a423850bec1dcfe771196cadd0c03f8
BLAKE2b-256 11417012b197770ddfbc12d330364188881fe78939379ae388cab59e0c728463

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