Skip to main content

A cli tool for tortoise-orm, build on top of click and ptpython.

Project description

tortoise-cli

image image image

A cli tool for tortoise-orm, build on top of click and ptpython.

Installation

You can just install from pypi.

pip install tortoise-cli

Quick Start

> tortoise-cli -h                                                                                                                                                                 23:59:38
Usage: tortoise-cli [OPTIONS] COMMAND [ARGS]...

Options:
  -V, --version      Show the version and exit.
  -c, --config TEXT  TortoiseORM config dictionary path, like
                     settings.TORTOISE_ORM
  -h, --help         Show this message and exit.

Commands:
  shell  Start an interactive shell.

Usage

First, you need make a TortoiseORM config object, assuming that in settings.py.

TORTOISE_ORM = {
    "connections": {
        "default": "sqlite://:memory:",
    },
    "apps": {
        "models": {"models": ["examples.models"], "default_connection": "default"},
    },
}

Interactive shell

image

Then you can start an interactive shell for TortoiseORM.

tortoise-cli -c settings.TORTOISE_ORM shell

Or you can set config by set environment variable.

export TORTOISE_ORM=settings.TORTOISE_ORM

Then just run:

tortoise-cli shell

License

This project is licensed under the Apache-2.0 License.

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

tortoise_cli-0.1.2.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

tortoise_cli-0.1.2-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file tortoise_cli-0.1.2.tar.gz.

File metadata

  • Download URL: tortoise_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for tortoise_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 dd803e85d04434982084f4788c1a5111f76178280eb648732573662a0e355218
MD5 733cbc87e0b47d0822aa299f0a96a9b9
BLAKE2b-256 e19c9d2d75215762b111d26bed356ce202d8df1406d86beba242844e6396057e

See more details on using hashes here.

File details

Details for the file tortoise_cli-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: tortoise_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for tortoise_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6b8cf7847af4a71b4b14069bb7c9212aa0dc014618baafc07c41ce1544f0066a
MD5 7bb2d37ac5a67a76218a823a571feea4
BLAKE2b-256 3818e1a7bf2515f8e8de78559145c8e3511556cce95927a1359a94fd3eb3a7b3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page