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.11.tar.gz (9.5 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.11-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: api-client-lnx-edge-0.3.11.tar.gz
  • Upload date:
  • Size: 9.5 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.11.tar.gz
Algorithm Hash digest
SHA256 5a95231c7b1fff58e9d2889030c4d3e2ad1de11f6ec8bdc0da13fe1d038f9d70
MD5 0b36757f013574e2d10d9fbcac8efd4f
BLAKE2b-256 f866a118fbc8025846fd7e36d25edca6adab950ad4e28aafa2ace379d15cded3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for api_client_lnx_edge-0.3.11-py3-none-any.whl
Algorithm Hash digest
SHA256 bfd0fe72fb32efa1d99b2551847c468cd0f307cefc4ae1e6bb22ea6b6d79da02
MD5 201180ffa968a1e1765bf53d7c308f4c
BLAKE2b-256 23933f1e2f12c6044c712ce8b12b963764381577990b98d07c3c5b2c5fa1f8fb

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