Data Sources
Data sources provide the underlying data for table definitions. They handle filtering, sorting, and pagination operations while abstracting away the specific data storage mechanism.
Each table definition must specify a data source to fetch its data from.
Available Data Sources
Custom table definitions
Use these when you are building your own table view with a TableDefinition.
| Data Source | Description |
|---|---|
DatabaseDataSource |
SQLAlchemy queries — the standard choice for production tables backed by the database. |
ListDataSource |
In-memory list of dicts — ideal for small datasets, demos, and tests. |
Resource preview (automatic)
These data sources are used automatically by the Resource View feature to preview uploaded or linked resources. You generally do not need to instantiate them directly.
| Data Source | Triggered by format | Description |
|---|---|---|
CsvUrlDataSource |
csv |
Reads CSV files with auto-detected delimiter. |
XlsxUrlDataSource |
xlsx |
Reads the first sheet of an Excel workbook. |
OrcUrlDataSource |
orc |
Reads Apache ORC columnar files. |
ParquetUrlDataSource |
parquet |
Reads Apache Parquet columnar files. |
FeatherUrlDataSource |
feather |
Reads Apache Arrow Feather files. |
DataStoreDataSource |
any (when datastore_active) |
Queries the CKAN Datastore API directly — no caching. |