I recently came across a few Python packages that look like they could be useful. The only one I’ve used so far is click. If you know of other packages that people here might like, post a comment below.
dataset
This might be useful for quickly saving data: dataset: databases for lazy people
dataset provides a simple abstraction layer removes most direct SQL statements without the necessity for a full ORM model - essentially, databases can be used like a JSON file or NoSQL store.
…
- Automatic schema : If a table or column is written that does not exist in the database, it will be created automatically.
- Upserts : Records are either created or updated, depending on whether an existing version can be found.
- Query helpers for simple queries such as
all
rows in a table or alldistinct
values across a set of columns.- Compatibility : Being built on top of SQLAlchemy,
dataset
works with all major databases, such as SQLite, PostgreSQL and MySQL.
pluggy
pluggy
– add a plugin system to your Python programs.
It gives users the ability to extend or modify the behaviour of a
host program
by installing aplugin
for that program. The plugin code will run as part of normal program execution, changing or enhancing certain aspects of it.In essence,
pluggy
enables function hooking so you can build “pluggable” systems.
datasette
Datasette provides an instant, read-only JSON API for any SQLite database. It also provides tools for packaging the database up as a Docker container and deploying that container to hosting providers such as Zeit Now.
Got CSV data? Use csvs-to-sqlite to convert them to SQLite, then publish them with Datasette. Or try Datasette Publish, a web app that lets you upload CSV data and deploy it using Datasette without needing to install any software.
click
click – for writing command-line tools in Python.
Click is a Python package for creating beautiful command line interfaces in a composable way with as little code as necessary. It’s the “Command Line Interface Creation Kit”. It’s highly configurable but comes with sensible defaults out of the box.