Skip to main content

Client library for accessing Cofactr data.

Project description

Cofactr

Python client library for accessing Cofactr.

Example

from cofactr.graph import GraphAPI
from cofactr.cursor import first

g = GraphAPI()

cursor = g.get_products(
    query="esp32",
    fields=["mpn", "assembly"],
    batch_size=10,  # Data is fetched in batches of 10 products.
    limit=10,  # `list(cursor)` would have at most 10 elements.
    external=False,
)

data = first(cursor, 2)

# To send to web app.
response = {
    "data": data,
    # To get the next 10 after the 2 in `data`.
    "paging": cursor.paging,
}

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

cofactr-1.0.0.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

cofactr-1.0.0-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

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