3tears-datasources
Datasource entities, three-tier collections, namespace helpers, the
agent-yaml-facing DatasourceConfig, and the Driver abstraction
(plus concrete asyncpg + Redshift drivers) for the 3tears platform.
This is the single source of truth for "what is a datasource" across every 3tears consumer.
Public surface
Imported via from threetears.datasources import …:
- entities --
DataSourceEntity,DataSourceTableEntity,DataSourceColumnEntity,DataSourceRelationEntity,TableTemplateEntity+ theDataSourceType,DataSourceAccessMode,DataSourceStatusenums. - collections --
DataSourceCollection,DataSourceTableCollection,DataSourceColumnCollection,DataSourceRelationCollection,TableTemplateCollection(three-tierSchemaBackedCollection/BaseCollectionsubclasses with L1/L2/L3 caching +_publish_invalidationon save). - namespace --
DATASOURCE_NAMESPACE_TYPE,datasource_namespace_id(uuid) -> uuid,datasource_namespace_name(name) -> str. - config --
DatasourceConfig(the agent-yaml-facing model the SDK validates against) plus the per-driverConnectionConfigdiscriminated union. - query wire --
DatasourceQueryClient,DatasourceQueryRequest,DatasourceQueryResponse,DatasourceQueryResult,DatasourceQueryError. How a process that holds no warehouse credential (a tool pod) queries a hub-served datasource on its own identity: it publishes on{ns}.datasource.{name}.querycarrying its hub-minted token, the hub verifies the token, evaluates the caller's grant on the datasource namespace, runs the query on the driver it already holds, and answers with rows or a typed refusal. The client hands back the rows andtruncated, set when the hub cut the result at its row cap, so a caller deriving state from a full read can refuse a prefix rather than treat the missing rows as absent. Rows only otherwise -- the model-facing rendering with honesty imperatives is the datasource tool's job.
Drivers
The Driver ABC + create_driver(config, *, hub_l3_pool=None) factory
are the entry point. Concrete drivers are accessed via the
factory, NOT imported directly:
from threetears.datasources.drivers import create_driver
driver = create_driver(config.connection_config)
try:
rows = await driver.fetch("SELECT * FROM customers WHERE id = $1", customer_id)
finally:
await driver.close()
Driver implementations live behind extras keys:
pip install '3tears-datasources[redshift]'forRedshiftDriverpip install '3tears-datasources[snowflake]'forSnowflakeDriver(stub today; full impl tracked separately)pip install '3tears-datasources[bigquery]'forBigQueryDriver(stub today; full impl tracked separately)
Postgres / Yugabyte / agent_internal coverage uses asyncpg which is
a hard dep (no extras key required).
See IMPLEMENTING_DRIVERS.md for the contract every new driver must
satisfy.
Versioning policy
3tears-datasources versions in lockstep with the rest of the
3tears monorepo: every package shares one version, which tracks the
framework git tag (v0.9.1 at time of writing). All packages move
together.
The pyproject.toml depends on 3tears core via a compatible-release
range (3tears>=0.9.1,<1.0); because the monorepo bumps together, any
matching 0.9.x core satisfies it.
See CHANGELOG.md for the full version history.
Release files for 3tears-datasources 0.52.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| 3tears_datasources-0.52.1.tar.gz | 437.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 3tears_datasources-0.52.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 677.4 kB
Release files / 3tears_datasources-0.52.1.tar.gz
| Download URL | 3tears_datasources-0.52.1.tar.gz |
|---|---|
| Size | 437.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5adc0160e5cd0025eb839afd0faf6c74aedf7b3ca45eb19ab01af52a74983c8
|
|
BLAKE2b-256 checksum How to use checksums |
08d65ee862b58d03a3e766ca36b1d65ed81aca852d2d64def046e00d446594b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / 3tears_datasources-0.52.1-py3-none-any.whl
| Download URL | 3tears_datasources-0.52.1-py3-none-any.whl |
|---|---|
| Size | 239.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d89009dda5f662f0991ec21fccde58ee11b6e08b3006708c2ac4e011c7cd8ea5
|
|
BLAKE2b-256 checksum How to use checksums |
77b2f03bca78b1857275a6ca2b596041e8c68f69cc5bc74b38a4b0c6f878f7fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency log