Skip to main content

Promoted.ai Python Delivery Client

Project description

promoted-python-delivery-client

Python client SDK for the Promoted.ai Delivery API

Prereqs

Development

  • Start venv: source venv/bin/activate
  • Build wheel: python setup.py bdist_wheel
  • Install locally: pip install dist/promoted_python_delivery_client-0.1.0-py3-none-any.whl --force-reinstall
  • Try it out:
    • See the scripts/ directory.
    • Create a .env file with a few variables:
      DELIVERY_ENDPOINT=<GET ME FROM PROMOTED>
      DELIVERY_API_KEY=<GET ME FROM PROMOTED>
      METRICS_ENDPOINT=<GET ME FROM PROMOTED>
      METRICS_API_KEY=<GET ME FROM PROMOTED>
      
    • Invoke (for example) python3 scripts/call_delivery.sh.

Testing

Unit tests

  • Use pytest:
    • pytest tests/

Release

  • Create a development branch
  • bump2version [major|minor|patch]
  • Send a pull request and merge.
  • python3 -m twine upload dist/*
    • PyPi
    • FUTURE: Do this with a Github Action.

Dependencies

  • dataclasses-json -- flexible JSON serialization and deserialization of Python dataclasses. One key feature we use is the ability to omit None's (nulls) from request JSON to decrease payload size.
  • requests -- defacto standard HTTP library used to call Promoted APIs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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