Skip to main content

Python Push API Client

Installation

pip install coveo-push-api-client.py

Usage

See more examples in the ./samples folder.

from push_api_clientpy import Source, DocumentBuilder

source = Source("my_api_key", "my_org_id")

myDocument = DocumentBuilder("https://my.document.uri", "My document title")\
   .withData("these words will be searchable")

response = source.addOrUpdateDocument("my_source_id", myDocument)

print(f"Document added: {response.json()}")

Exponential backoff retry configuration

By default, the SDK leverages an exponential backoff retry mechanism. Exponential backoff allows for the SDK to make multiple attempts to resolve throttled requests, increasing the amount of time to wait for each subsequent attempt. Outgoing requests will retry when a 429 status code is returned from the platform.

The exponential backoff parameters are as follows:

  • retry_after - The amount of time, in seconds, to wait between throttled request attempts.

    Optional, will default to 5.

  • max_retries - The maximum number of times to retry throttled requests.

    Optional, will default to 10.

You may configure the exponential backoff that will be applied to all outgoing requests. To do so, specify a BackoffOptions object when creating either a Source or PlatformClient object:

source = Source("my_api_key", "my_org_id", BackoffOptions(3, 10))

By default, requests will retry a maximum of 10 times, waiting 10 seconds after the second attempt, with a time multiple of 2 (which will equate to a maximum execution time of roughly 1.5 hours. See urllib3 Retry documentation).

Dev

  • Requires Python 3.9

  • Requires pipenv: pip install pipenv

  • Install dependencies: pipenv install --dev

  • Build: pipenv run tox -e build

  • Tests: pipenv run tox

  • Full list of commands: pipenv run tox -av

Versioning and Publishing to PyPI

Before merging a feature branch into master, you must update the package version of your branch:

  • Open pyproject.toml in the text editor of your choice

  • Under [project], update the version, following semantic versioning format (v{Major}.{Minor}.{Patch})

Once the feature branch you would like to publish has been merged into master:

  • Checkout the latest version of master on local

  • Run pipenv run tox -e clean

  • Run pipenv run tox -e build

You should now see that that the dist directory has been populated with a .whl and .tar.gz file with the correct version in the filenames. These are the distribution archives.

Once the distribution archives are ready:

  • Run pipenv run tox -e publish -- --repository pypi from the root directory

  • When prompted for a username, enter __token__

  • When prompted for a password, enter the PyPI publishing API key, including the pypi- prefix

After the command finishes running with a successful exit message, confirm that the published version is live on PyPI.

Note

This project has been set up using PyScaffold 4.0.1. For details and usage information on PyScaffold see https://pyscaffold.org/.

For more information on the release process, refer to the PyPi and PyScaffold documentation.

Metadata

Release files for coveo-push-api-client.py 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for coveo-push-api-client.py 1.1.2
File Size Uploaded Provenance Actions
coveo-push-api-client.py-1.1.2.tar.gz 29.2 kB Without provenance Details for coveo-push-api-client.py-1.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for coveo-push-api-client.py 1.1.2
File Interpreter ABI Platform Actions
coveo_push_api_client.py-1.1.2-py2.py3-none-any.whl Python 2, Python 3 none any Details for coveo_push_api_client.py-1.1.2-py2.py3-none-any.whl

Total release size: 39.8 kB

Release files / coveo-push-api-client.py-1.1.2.tar.gz

Download URL coveo-push-api-client.py-1.1.2.tar.gz
Size 29.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6efae67e7e01091e7b0744ceda6cefbfc01a686a2560a0d46240d5146da788c3
BLAKE2b-256 checksum
How to use checksums
6f38de194403e08f9a777b7a5a6f057be1ad4b2b7280c5d81a82f813db491ea2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / coveo_push_api_client.py-1.1.2-py2.py3-none-any.whl

Download URL coveo_push_api_client.py-1.1.2-py2.py3-none-any.whl
Size 10.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
00229bbba88d06bf057e95e28b8e082e48397ff2ccdc4d5ddc0ae8b90dd20bdc
BLAKE2b-256 checksum
How to use checksums
6cb9bc402f020f543354b1c8b95e4760e595e53dbd44665ad6606715351733e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for coveo-push-api-client.py 1.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page