Skip to main content

A lightweight terminal-based database and S3 client built with Textual.

Project description

Shovl

A lightweight terminal-based database and S3 client built with Textual.

Installation

Install Shovle using pip:

pip install shovl

Database-Specific Dependencies

Shovl requires additional drivers depending on your target database systems. Install the appropriate extras for your use case:

# Individual database support
pip install shovl[sqlite]        # SQLite support
pip install shovl[postgresql]    # PostgreSQL support
pip install shovl[mysql]         # MySQL support
pip install shovl[mariadb]       # MariaDB support
pip install shovl[oracle]        # Oracle Database support
pip install shovl[snowflake]     # Snowflake support
pip install shovl[duckdb]        # DuckDB support
pip install shovl[ibmdb]         # IBM DB2 support

# General database support (SQLAlchemy only)
pip install shovl[database]

# S3 and cloud storage support
pip install shovl[bucket]

# Complete installation with all features
pip install shovl[all]

Note: Shovl leverages SQLAlchemy's extensive database support. You may install additional SQLAlchemy-compatible drivers as needed for other database systems.

Configuration

Shovl uses a hierarchical configuration system to manage connection details and application settings. The configuration file is loaded in the following priority order:

  1. Path specified via the --config command-line option
  2. Local configuration file (.shovl in the current directory)
  3. Global user configuration file (~/.shovl or %USERPROFILE%\.shovl on Windows)
  4. Default configuration (fallback)

Generating Configuration Files

Create a sample configuration file:

# Local configuration
shovl --sample-config > .shovl

# Global configuration
shovl --sample-config > ~/.shovl

View the complete configuration schema with detailed parameter descriptions:

shovl --config-schema

Configuration of Database Connections

A mininmal configuration file with a single database connection looks like this:

{
  "connections": [
    {
      "description": "A short description",
      "name": "My Database",
      "url": "<sqlalchemy connection url>"
    }
  ]
}

The url field should be a valid SQLAlchemy connection string, which includes the database type, username, password, host, port, and database name. See the SQLAlchemy documentation for more details on constructing connection URLs.

See "Security Best Practices" below for how to handle credentials securely.

By default, Shovl will fetch a maximum of 1000 rows when executing a query. You can adjust this limit in the configuration file using the fetch_limit parameter.

You may also pass other parameters to SQLAlchemy via the engine_parameters field, which accepts a dictionary of key-value pairs. These options will be passed directly to the SQLAlchemy engine when establishing a connection.

{
  "connections": [
    {
      "description": "A short description",
      "engine_parameters": {
        "isolation_level": "REPEATABLE READ"
      },
      "fetch_limit": 2000,
      "name": "My Database",
      "url": "<sqlalchemy connection url>"
    }
  ]
}

A comprehensive list of available engine parameters can be found in the SQLAlchemy documentation. Here are some examples:

Database Example Common Engine Parameters
SQLite sqlite:///database.db
PostgreSQL postgresql://user:password@localhost:5432/mydatabase {"connect_args": {"sslmode": "require"}}
Oracle oracle://user:password@localhost:1521/?service_name=myservice {"thick_mode": true}

Configuration of S3 Connections

Shovl also supports connections to S3-compatible storage services. A minimal S3 connection configuration looks like this:

{
  "connections": [
    {
      "description": "A short description",
      "bucket_name": "my-bucket",
      "name": "My S3 Storage",
      "region_name": "us-east-1"
    }
  ]
}

This assumes that you have configured your AWS credentials using environment variables or the AWS CLI. You can also specify credentials directly in the configuration file (see "Security Best Practices" below):

{
  "connections": [
    {
      "aws_access_key_id": "{{AWS_ACCESS_KEY_ID}}",
      "aws_account_id": "{{AWS_ACCOUNT_ID}}",
      "aws_secret_access_key": "{{AWS_SECRET_ACCESS_KEY}}",
      "aws_secret_access_key": "{{AWS_SECRET_ACCESS_KEY}}",
      "bucket_name": "my-bucket",
      "description": "A short description",
      "name": "My S3 Storage",
      "region_name": "us-east-1"
    }
  ]
}

You may also use AWS Secure Token Service (STS) to generate temporary credentials for enhanced security:

{
  "connections": [
    {
      "aws_access_key_id": "{{AWS_ACCESS_KEY_ID}}",
      "aws_account_id": "{{AWS_ACCOUNT_ID}}",
      "aws_secret_access_key": "{{AWS_SECRET_ACCESS_KEY}}",
      "aws_secret_access_key": "{{AWS_SECRET_ACCESS_KEY}}",
      "bucket_name": "my-bucket",
      "description": "A short description",
      "name": "My S3 Storage",
      "profile_name": "{{AWS_PROFILE_NAME}}",
      "region_name": "us-east-1",
      "role_name": "{{AWS_ROLE_NAME}}",
      "use_sts": true
    }
  ]
}

If you do not have permissions to call the head bucket operation, you can disable the bucket existence check using test_connection:

{
  "connections": [
    {
      "description": "A short description",
      "bucket_name": "my-bucket"
      "test_connection": false,
      "name": "My S3 Storage",
      "region_name": "us-east-1"
    }
  ]
}

You may also specifiy a `head_prefix that is automatically applied to all S3 operations:

{
  "connections": [
    {
      "description": "A short description",
      "bucket_name": "my-bucket",
      "head_prefix": "my-prefix/",
      "name": "My S3 Storage",
      "region_name": "us-east-1"
    }
  ]
}

Configure Logging

By default, logging is disabled. You can enable logging and specify a log file path in the configuration file:

{
  "logging": {
    "enabled": true,
    "log_file": "~/.shovl.log",
    "log_level": "INFO",
    "mode": "w"
  }
}

Configure the GUI

Shovl's GUI can be customized using the gui section of the configuration file. You can specify a theme and the maximum number of list items displayed:

{
  "gui": {
    "theme": "tokyo-night",
    "max_list_items": 1000
  }
}

Valid themes can be found in the Textual documentation.

Security Best Practices

Important: It is good practice to not store credentials in plain text within configuration files. Shovl supports environment variable substitution using double curly bracket syntax: {{VARIABLE_NAME}}.

To configure an env-file, you can either sse the env_file parameter in the configuration file:

{
  "env_file": ".env",
  "connections": [
    ...
  ]
}

or pass the env-file path directly when launching Shovl:

shovl --env .env

Usage

Basic Usage

Launch Shovl with default settings:

shovl

Specify a custom configuration file:

shovl --config /path/to/custom/config.json

Display all available command-line options:

shovl --help

System Requirements

  • Python 3.12 or higher
  • Terminal with Unicode support
  • Network connectivity for database and S3 operations

License

This project is distributed under the terms specified in the LICENSE.md file.

Contributing

Shovl is an open-source project. For bug reports, feature requests, or contributions, please visit the project repository.

Support

For issues and support requests, please use the project's issue tracker.

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

shovl-0.2.6.tar.gz (30.8 kB view details)

Uploaded Source

Built Distribution

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

shovl-0.2.6-py3-none-any.whl (39.1 kB view details)

Uploaded Python 3

File details

Details for the file shovl-0.2.6.tar.gz.

File metadata

  • Download URL: shovl-0.2.6.tar.gz
  • Upload date:
  • Size: 30.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for shovl-0.2.6.tar.gz
Algorithm Hash digest
SHA256 5d72aa75529bd233745d8aa1672f48f71cecc45c3381e7bca29a9d7851881bb9
MD5 818c5d2e9f6cf44a394c3b04d813cbb3
BLAKE2b-256 3c79d1ffd354e7ffbc916a8f7df6005460105ccf10c69b382d33dab59b03429a

See more details on using hashes here.

File details

Details for the file shovl-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: shovl-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 39.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for shovl-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c1fdfe1db462d17d60a12baf098c52959eb29a37c20825d1f48a143bb701c6b3
MD5 2fcaec2b0dd5c2ef06976c483374c661
BLAKE2b-256 5b571d91c17ce416224ed848c025ca1f52fe5e9d0e699b6326f240ffd3fd895e

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