Skip to main content

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.7.0

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

Source distribution (sdist)

Source distribution for BerryDbNew 1.7.0
File Size Uploaded
berrydbnew-1.7.0.tar.gz 79.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for BerryDbNew 1.7.0
File Interpreter ABI Platform
berrydbnew-1.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 170.2 kB

Release files / berrydbnew-1.7.0.tar.gz

Download URL berrydbnew-1.7.0.tar.gz
Size 79.0 kB
Tags Source
SHA-256 checksum
How to use checksums
715b412632935c8206064c16e434cbd410b37c57031da9a9b7597f6e389996b0
BLAKE2b-256 checksum
How to use checksums
a511184442239a0175ff5d87d7bc2c962985b03a54ee5b62bae14399e05933bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / berrydbnew-1.7.0-py3-none-any.whl

Download URL berrydbnew-1.7.0-py3-none-any.whl
Size 91.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbccd4f82110535d9717ae6b29e3746d365397410da2fd009ba65a2b7ed9cd09
BLAKE2b-256 checksum
How to use checksums
a1f95308bbcf10d53f28c08c4808533a62f9c931be6b07cca749643403da3577
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.7.0 This release

2 release files

1.6.10

2 release files

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