Metadata-Version: 2.4
Name: BerryDbNew
Version: 1.6.10
Summary: The database for unstructured data and AI apps
License: Proprietary
Author: BerryDB
Requires-Python: >=3.11,<4.0
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: requests
Project-URL: Homepage, https://berrydb.io
Description-Content-Type: text/markdown

## BerryDB

<!--- - [Getting Started](https://berrydb.io/blog/getting-started) -->
<!--- - [Why BerryDB?](https://berrydb.io/blog/why-berrydb) -->
- [Documentation](https://docs.berrydb.io/python-sdk/)

### Bulk writes (1.6.10+)

```python
from berrydb import BerryDB

BerryDB.init("app.berrydb.io")
db = BerryDB.connect(api_key, "MyDatabase")

# Documents: batched POST /berrydb/documents/bulk (500 per request, retries on 429/5xx).
# An upsert REPLACES each stored document - send complete documents.
result = db.bulk_upsert(documents)
print(result["upserted"], "written;", result["failed"], "failed")

# Annotations: async POST /berrydb/annotate-bulk job, polled until finished.
# Merged server-side (like add_annotations); falls back to per-document calls on older servers.
result = db.bulk_annotate(
    [{"document_id": doc_id, "annotations": [annotation]} for doc_id, annotation in pairs],
    task="ner", annotated_field="content.text",
)
print(result["status"], result["succeeded"], result["failed"], result["errors"][:5])
```

`db.upsert(list)` keeps working and now batches lists longer than 500 documents;
`db.get_all_documents()` follows server-side pages so it still returns every document.

### Logging and API keys

The SDK never prints or logs API keys: request URLs (which carry the `apiKey`
query parameter), exception messages and debug output are redacted, and the SDK
no longer changes your root logger level. To see SDK diagnostics, set
`constants.constants.debug_mode = True` and enable DEBUG for the SDK's loggers.

See [CHANGELOG.md](CHANGELOG.md) for details.

