Skip to main content

Terminal-based SQLite manager

Project description

SQTerm Logo

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 large CSV files into tables (fast, petl-backed)
  • 🔹 Export entire tables or query results to CSV
  • 🔹 View tables and their structure
  • 🔹 Show various database statistics
  • 🔹 Basic autocompletion
  • 🔹 Switch between .db files 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

Tested on tables and .csv files with up to 10 million rows. No problem.


⬇️ 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 command
  • main(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:
    • petl
    • sqlalchemy
    • tabulate
    • psutil

Install them with:

pip install petl sqlalchemy tabulate psutil

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

sqterm-1.3.4.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

sqterm-1.3.4-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file sqterm-1.3.4.tar.gz.

File metadata

  • Download URL: sqterm-1.3.4.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sqterm-1.3.4.tar.gz
Algorithm Hash digest
SHA256 c730e57c2216734936c1459298d22174f45baefb863748ef5e0515bd784130ef
MD5 bf0bc40329d6614ccb1a60fbdf9befa6
BLAKE2b-256 008b58323bd18e8dacc1012c65ac952bc41fec37872f5433b32ecc540a2c64bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for sqterm-1.3.4.tar.gz:

Publisher: python-publish.yml on Gamerbot1000/SQTerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sqterm-1.3.4-py3-none-any.whl.

File metadata

  • Download URL: sqterm-1.3.4-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sqterm-1.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 851e51ff2a0c7d323cc9a20de17ce6cca7656a85e93e333bdc04cde600d90ee3
MD5 e47b5dbba300fe1a0cd5b475e84772e4
BLAKE2b-256 b757301a88d110a255565daa73d2716b7174d5c1366d8fd2a7aef4def24e50b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for sqterm-1.3.4-py3-none-any.whl:

Publisher: python-publish.yml on Gamerbot1000/SQTerm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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