Skip to main content

Chroma import/export tool.

Project description

chromie-tool

Chroma (https://trychroma.com) import/export tool.

Install

# install
pip install chromie-tool

# check chromie tool
which chromie

Commands

Help

# chromie help
chromie -h

# exp command help
chromie exp -h

Download prepared datasets

Prepared datasets: https://github.com/chromiodev/datasets.

chromie dl -l es eurostat/prc_hicp_manr

Export

chromie exp server://localhost:8000/tenant/db/collection file.json

Check an export file

chromie check prc_hicp_manr-es.json

Import

# import all the content of movies.json
chromie imp movies.json server://localhost:8000/tenant/db/collection

# import all the content of movies.json, skipping the cert and rating metadata
chromie imp movies.json -M cert,rating server://localhost:8000/tenant/db/collection

# import all the content of movies.json, setting the cert and dir metadata
# to the specified values
chromie imp movies.json -m cert:C,dir:D server://localhost:8000/tenant/db/collection

Copy

chromie cp server://///coll1 server://///coll2

Listing the database collections

# only names
chromie ls server:////

# names and counts
chromie ls -c server:////

Metadata filters

The --metafilter or -f options allow to select records from metadata in the cp and exp commands. Format:

predicate
predicate and predicate
predicate or predicate

Examples:

-f "director='Quentin Tarantino'"
-f "director='Quentin Tarantino' or director='Alfred Hitchcock'"

Operators: =, !=, >, >=, <, <=, and and or.

Boolean literals: true, True, false and False.

Constraint. Right now, only one or two predicates are possible. In the future, it will be resolved and this note removed.

URIs

Server URI

Format:

server://host:port/tenant/database
server://host:port/tenant/database/collection

When a segment must take its value from the default value or an environment variable, this must be left blank. Examples:

server://///
server:///tenant/db

Environment variables we can use for settings segments in server URIs:

  • CHROMA_HOST

  • CHROMA_PORT

  • CHROMA_TENANT

  • CHROMA_DATABASE

The default values in server URIs, when blank segments and environment variable unset, are these set in the chromadb package. Right now:

  • Host: localhost

  • Port: 8000

  • Tenant: default_tenant

  • Database: default_database

Chroma Cloud URI

Format:

cloud:///tenant/db
cloud:///tenant/db/collection

Similar to the server schema but, with the cloud schema, the environment variables we can use are the following:

  • CHROMA_TENANT

  • CHROMA_DATABASE

Default values:

  • host:port segment is always api.trychroma.com:8000.

  • Tenant and database don't have default values, these must be set explicitly or with environment variables.

Checking and decomposing URIs

With chromie uri, we check and decompose a URI. Examples:

$ chromie uri server:////
Schema: server
Host: localhost
Port: 8000
Tenant: default_tenant
Database: default_database

$ CHROMA_PORT=8888 chromie uri server:////
Schema: server
Host: localhost
Port: 8888
Tenant: default_tenant
Database: default_database

$ CHROMA_DATABASE=testdb chromie uri server://me//
Schema: server
Host: me
Port: 8000
Tenant: default_tenant
Database: testdb

Pinging database instance and/or collection

Examples:

# database instance
chromie ping server:////

# database collection
chromie ping server://///movies
chromie ping cloud://///movies

API key

When API key needed, --key or -k must be set. We can use the CHROMA_API_KEY environment variable too.

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

chromie_tool-0.5.0.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chromie_tool-0.5.0-py3-none-any.whl (28.5 kB view details)

Uploaded Python 3

File details

Details for the file chromie_tool-0.5.0.tar.gz.

File metadata

  • Download URL: chromie_tool-0.5.0.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for chromie_tool-0.5.0.tar.gz
Algorithm Hash digest
SHA256 80c99e85467ed6c1d1be05104d9eb7c224b1199f7bd943e68197dcae3ccfe3da
MD5 52f635e88a45a5bb22711a08af2fe6b8
BLAKE2b-256 5154df45a22cb8ea8ef2faab8e505c0a07ccf1f972a2499f96146df8f3b21cd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for chromie_tool-0.5.0.tar.gz:

Publisher: publish.yaml on chromiodev/chromie-tool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chromie_tool-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: chromie_tool-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 28.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for chromie_tool-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67a7e2c80a0da1a5d4c2417ee63299eaddccab194bc9bc18f956102a4a6f21ae
MD5 36f2508a67806257ebcde6df0ce94d90
BLAKE2b-256 1c6b6583ac5386f5163139bbc00ce1b79f7d1a8460c7836636d1b2fdc636d917

See more details on using hashes here.

Provenance

The following attestation bundles were made for chromie_tool-0.5.0-py3-none-any.whl:

Publisher: publish.yaml on chromiodev/chromie-tool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page