BerryDB
Bulk writes (1.6.10+)
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 for details.
Release files for BerryDbNew 1.6.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| berrydbnew-1.6.10.tar.gz | 75.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| berrydbnew-1.6.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 164.0 kB
Release files / berrydbnew-1.6.10.tar.gz
| Download URL | berrydbnew-1.6.10.tar.gz |
|---|---|
| Size | 75.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8aada8a3c420041e83d28a771db6085ecaa2114c33a4a07bf5ce8680a6385370
|
|
BLAKE2b-256 checksum How to use checksums |
88c583962fc01fe81c36570c3986b87d8a4ceee32c5430bb62c02b58389a4b86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|
Release files / berrydbnew-1.6.10-py3-none-any.whl
| Download URL | berrydbnew-1.6.10-py3-none-any.whl |
|---|---|
| Size | 88.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f49a437f38a9835df4b92445aa5cce11e61f7275c5708cf07d1a4e49072491cc
|
|
BLAKE2b-256 checksum How to use checksums |
ae3bb8329aa3d77b7fc44c64d227cf0cd9f9faedfea492e5c095f6e678fd2dc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|