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
Export
chromie exp server://localhost:8000/tenant/db/collection file.json
Import
chromie imp file.json 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chromie_tool-0.4.0.tar.gz.
File metadata
- Download URL: chromie_tool-0.4.0.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24fb34101d1e1bf8ad27d27e985242beaaf0de56d88a86c922d2d6db3a253775
|
|
| MD5 |
9df21c9e0656c6d9bf59c8210f62282b
|
|
| BLAKE2b-256 |
8c477189a22bd0f4173d081ed459fd820eb7e03c03cd70b1172509c53f3fe3b7
|
Provenance
The following attestation bundles were made for chromie_tool-0.4.0.tar.gz:
Publisher:
publish.yaml on chromiodev/chromie-tool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chromie_tool-0.4.0.tar.gz -
Subject digest:
24fb34101d1e1bf8ad27d27e985242beaaf0de56d88a86c922d2d6db3a253775 - Sigstore transparency entry: 590969518
- Sigstore integration time:
-
Permalink:
chromiodev/chromie-tool@01b1eb2c569cdb9a0f1e1087f7945179281aa469 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/chromiodev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@01b1eb2c569cdb9a0f1e1087f7945179281aa469 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file chromie_tool-0.4.0-py3-none-any.whl.
File metadata
- Download URL: chromie_tool-0.4.0-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcd4b7e6da3862f05edd35015d9da623f8f4bfc6ea8d6a9b5c9cdf79cf0f49c8
|
|
| MD5 |
52e0b1312c198be56b3fced1756dcc54
|
|
| BLAKE2b-256 |
febd437da6aa17609d7f8bcaba72aca328b92a57c589e615e20616c79ea8b26c
|
Provenance
The following attestation bundles were made for chromie_tool-0.4.0-py3-none-any.whl:
Publisher:
publish.yaml on chromiodev/chromie-tool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chromie_tool-0.4.0-py3-none-any.whl -
Subject digest:
dcd4b7e6da3862f05edd35015d9da623f8f4bfc6ea8d6a9b5c9cdf79cf0f49c8 - Sigstore transparency entry: 590969521
- Sigstore integration time:
-
Permalink:
chromiodev/chromie-tool@01b1eb2c569cdb9a0f1e1087f7945179281aa469 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/chromiodev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@01b1eb2c569cdb9a0f1e1087f7945179281aa469 -
Trigger Event:
workflow_dispatch
-
Statement type: