Metadata-Version: 2.1
Name: cofactr
Version: 1.0.0
Summary: Client library for accessing Cofactr data.
Home-page: https://github.com/Cofactr/cofactr-client
License: MIT
Keywords: cofactr
Author: Noah Trueblood
Author-email: noah@cofactr.com
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: urllib3 (>=1.26.9,<2.0.0)
Project-URL: Repository, https://github.com/Cofactr/cofactr-client
Description-Content-Type: text/markdown

# Cofactr

Python client library for accessing Cofactr.

## Example

```python
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,
}
```
