tool for creating catalog from .csv tables in duckdb/sqlite storage
Project description
CSVCatalog
a simple cli tool for wrangling csv files and shoving them into a sqlite database. no more manual scripts, no more headaches
What's this? 🤔
tired of messing around with csvs and databases separately? me too. that's why i built catalog. it's a simple, no-nonsense tool that lets you:
- import csv files into a sqlite database with an interactive wizard
- search your data with a powerful, flexible query syntax
- export your data back to csv whenever you need it
- manage your database with a set of easy-to-use commands
all output is beautifully formatted using rich 💅.
Getting Started 🚀
- install
pip install csvcatalog
- run a command
the basic structure is csvcatalog [OPTIONS] COMMAND [ARGS]. for example, to see all tables:
csvcatalog tables
by default, the database is stored in a user-specific data directory. you can specify a custom database file with the --db option:
csvcatalog --db /path/to/your/database.db tables
Commands 🕹️
typer provides help for all commands. just run csvcatalog --help or csvcatalog <command> --help.
extract <file.csv>: run an interactive wizard to import a csv file into the database. you'll be prompted to set the separator, rename columns, select columns to import, and name the table.tables: list all tables in the database, with their columns and row counts.search <value> [targets...]: search for a value. this is the most powerful command.sql "<query>": execute a raw sql query on the database.export <table_name>: export a table to a csv file, with an interactive prompt to select columns and limit rows.delete <table_name>: delete a table from the database.purge: delete all tables from the database.
the mighty search command
the search command lets you specify exactly where to look for your data. a "target" can be a table, a specific column in a table, or a column across all tables.
search for a value in all tables (default behavior):
# looks for 'jane' everywhere
csvcatalog search "jane"
search for a value in specific tables:
# looks for 'jane' in the 'users' and 'customers' tables
csvcatalog search "jane" users customers
search for a value in a specific column of a specific table:
# looks for the email in the 'email' column of the 'users' table
csvcatalog search "jane.doe@example.com" users.email
search for a value in a specific column across all tables:
# finds any entry with a 'status' of 'active' in any table
csvcatalog search "active" "*.status"
combine any of these targets in one command:
# a totally valid and powerful query
csvcatalog search "jane" users.name products
contributing are welcome 🤝
Project details
Release history Release notifications | RSS feed
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 csvcatalog-2.0.tar.gz.
File metadata
- Download URL: csvcatalog-2.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
612825835e3e9b41b4b0a02996075851a6d6540ab61946b5117330b4a0d7350e
|
|
| MD5 |
72e0625be66d0b62a17b732d6f0b4681
|
|
| BLAKE2b-256 |
58185c896ba5fc95a40108e28062b7d0eaa72a3806e6a3486b550ae056677fc3
|
File details
Details for the file csvcatalog-2.0-py3-none-any.whl.
File metadata
- Download URL: csvcatalog-2.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9aad3bc39369d79380194df2b63fd1131b733a17a8fef3056e9280a90882f3f
|
|
| MD5 |
d44e7d4d0e57d724db3b794e813706df
|
|
| BLAKE2b-256 |
df385ec846cc39fb54289a1b15d0e0fcc0226e3ba25dbc1bbcafab96a7bebc31
|