Skip to main content

tool for creating catalog from .csv tables in 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.

Getting Started 🚀

  1. install
pip install csvcatalog
  1. run a command

the basic structure is csvcatalog COMMAND [ARGS]. for example, to see all tables:

csvcatalog --help

by default, the database is stored in a user-specific data directory. you can specify a custom database file with the dbfile command:

# Optional
csvcatalog settings dbfile /path/to/your/database.db

you can setup aes256 encryption for database file

# Optional
csvcatalog settings encryption true
  1. extract your csv data table
csvcatalog extract path/to/my/data.csv

Commands 🕹️

typer provides help for all commands. just run csvcatalog --help or csvcatalog <command> --help for more details.

  • extract <file.csv>: run an interactive wizard to import a csv file. you can map columns, select which ones to import, and apply regex filters to include/exclude specific rows.
  • search <value> [targets...]: search for a value across one or more tables and columns.
  • export [table_names...]: export one or more tables to csv files.
    • if one table is specified, runs a full interactive wizard.
    • if multiple tables are specified (or none, for all tables), runs a bulk export. you can choose to configure filters for specific tables.
  • delete <table_name>: delete a table from the database.
  • sql "<query>": execute a raw sql query on the database.
  • purge: delete all tables from the database.

Command Groups

these commands group related functionality.

tables

manage and view tables.

  • tables list: list all tables in the database.
    • --description <text>: filter by text in the description.
    • --rows <min_count>: filter by minimum row count.
    • --date <yyyy-mm-dd>: filter by tables created on or after a certain date.
    • --sort <name|rows|date>: sort the output.
  • tables edit [table_name]: interactively edit a table's metadata (name, description, or date). if table_name is omitted, a selector will be shown.

settings

manage application settings. running csvcatalog settings will show current settings.

  • settings dbfile <path>: set a custom path for the database file.
  • settings encryption <true|false>: enable or disable database encryption.

filters

manage saved reusable regex filters for extract and export. running csvcatalog filters will list all saved filters.

  • filters add <name> <regex>: create a new named filter.
  • filters remove [name]: remove a filter by name, or run interactively if no name is provided.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

csvcatalog-2.19.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

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

csvcatalog-2.19-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file csvcatalog-2.19.tar.gz.

File metadata

  • Download URL: csvcatalog-2.19.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","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

Hashes for csvcatalog-2.19.tar.gz
Algorithm Hash digest
SHA256 d5b313e317b9ab3b6428f609b2acfff4f992ea625d09c5ede8c9bed86f49dff7
MD5 82891b7ce3f0875fddf1be436cc6ade2
BLAKE2b-256 44dc0ca15026a489c46ea1ab84b453ea397a79b463edde538a93262a13a1bd65

See more details on using hashes here.

File details

Details for the file csvcatalog-2.19-py3-none-any.whl.

File metadata

  • Download URL: csvcatalog-2.19-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","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

Hashes for csvcatalog-2.19-py3-none-any.whl
Algorithm Hash digest
SHA256 392dbae99735d7fb037ead2c42f530972e93c2119ba1d6c945a19cc6149d2334
MD5 d9bcda2d4eef79d34b3770c126f2d6f9
BLAKE2b-256 89eb0a01455ed9800f6e292e7ed128d9ab11bbe95b85a476f8df017f52442751

See more details on using hashes here.

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