Terminal-based SQLite manager
Project description
SQTerm is a fast, modular, lightweight, terminal SQLite tool written in Python.
Built for when you don’t want a bloated GUI and just need to get work done — fast.
Features
- Execute raw SQL commands directly
- Clean table output with
tabulate - Import CSV files
- Export entire tables to CSV
- View tables and their structure
- Show various database statistics
- Basic autocompletion
- Switch between
.dbfiles mid-session - Error handling with clear messages
- Remove any unused feature by simply deleting a single file
- Write your own feature easily in a simple format when preinstalled features don't meet your needs
Installation
pip:
pip install sqterm
pipx:
pipx install sqterm
Making your own commands
To make your own command simply create a .py file titled exactly what the user has to type to execute the command.
Each command consists of two required functions:
info()– returns a short description of the commandmain(state, i)– contains the command logic
Example of an info() function:
def info():
return '"IMPORTCSV" - Imports a CSV file as a new table'
Example of a main() function:
def main(state, i):
print("Hello from this command!")
If your script needs access to things such as the database path, the SQLite connection, or the cursor, you can retrieve them from the state argument:
name = state["name"]
conn = state["conn"]
cursor = state["cursor"]
If you need the raw user input that triggered the command, you can access it via the i argument passed into main().
Once you've written your command simply drop it into the commands folder, start SQTerm and your command should work seamlessly when executed (you can also type help to see if your command shows up)
It is recommended to use autocompletion if your addon requires the user to input columns, tables, etc. You can use the built-in autocompletion by importing its CACHE variable via:
from sqterm.extras.autocomplete import CACHE
If there's anything you'd like to be autocompleted simply append it to the cache using CACHE.append(ITEM), before the addon finishes also make sure to clear the cache using CACHE.clear().
Requirements for running source code
- Python 3.x
- Libraries:
petlsqlalchemytabulatepsutil
Install them with:
pip install petl sqlalchemy tabulate psutil
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 sqterm-1.4.0.tar.gz.
File metadata
- Download URL: sqterm-1.4.0.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28c7de035539a70b9496e8bf6960ec6aa00815a354b158e01b4556b0e45626d0
|
|
| MD5 |
f3e811205d6b76edc0bdde36015bc593
|
|
| BLAKE2b-256 |
ec61738a631594e04b2e90155b4aa92b0b77e55e11f097882a987cffe3000e21
|
Provenance
The following attestation bundles were made for sqterm-1.4.0.tar.gz:
Publisher:
python-publish.yml on Gamerbot1000/SQTerm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sqterm-1.4.0.tar.gz -
Subject digest:
28c7de035539a70b9496e8bf6960ec6aa00815a354b158e01b4556b0e45626d0 - Sigstore transparency entry: 1006550142
- Sigstore integration time:
-
Permalink:
Gamerbot1000/SQTerm@75c98e7ddbf654da37675b6540d19913b1f6b165 -
Branch / Tag:
refs/tags/v1.4.0 - Owner: https://github.com/Gamerbot1000
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@75c98e7ddbf654da37675b6540d19913b1f6b165 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sqterm-1.4.0-py3-none-any.whl.
File metadata
- Download URL: sqterm-1.4.0-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6f977d6acc9938f5b473bcea3a4b6c30ba8869dc2e8031f321adcfe5079cd9a
|
|
| MD5 |
d9353020e9037a224e8d6a0b57c62f8b
|
|
| BLAKE2b-256 |
f39c840e0aeea6a464e9bea32e8aae70b96a0a40c61a3de26525b9b2771b5335
|
Provenance
The following attestation bundles were made for sqterm-1.4.0-py3-none-any.whl:
Publisher:
python-publish.yml on Gamerbot1000/SQTerm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sqterm-1.4.0-py3-none-any.whl -
Subject digest:
e6f977d6acc9938f5b473bcea3a4b6c30ba8869dc2e8031f321adcfe5079cd9a - Sigstore transparency entry: 1006550145
- Sigstore integration time:
-
Permalink:
Gamerbot1000/SQTerm@75c98e7ddbf654da37675b6540d19913b1f6b165 -
Branch / Tag:
refs/tags/v1.4.0 - Owner: https://github.com/Gamerbot1000
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@75c98e7ddbf654da37675b6540d19913b1f6b165 -
Trigger Event:
release
-
Statement type: