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 thestaging=Trueflag. 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
dateRangefield. # TODO FIX THIS - Timezone should always be specified in the request body.
EdgeAPI._get_report(...)defaults toAmerica/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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf2b0d2661c5aae099229c035852f438c3da07d0fa70836a851bfb5a98351011
|
|
| MD5 |
e67142f087711b465e013022608c4c26
|
|
| BLAKE2b-256 |
8a94ece5eee17fcb164494fe98de364a98324882e7198b4e6fbe8513e77d8bc3
|
File details
Details for the file api_client_lnx_edge-0.3.7-py3-none-any.whl.
File metadata
- Download URL: api_client_lnx_edge-0.3.7-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e1f3ca46baec40afb129b39ef2f1a8a6b3957b71d37854ab9529d4e809f66b0
|
|
| MD5 |
15ecf2780df13a0e3722f035dbb48a53
|
|
| BLAKE2b-256 |
87b31fb78faf4043d92b6c6657f9219016c04bc73b0cf8be0b42d01a08002184
|