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 asyncclick 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
  --generate-schemas / --no-generate-schemas
                     Whether generate schemas after TortoiseORM
                     inited
  -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

Or you can set it in pyproject.toml.

[tool.aerich]
tortoise_orm = "my_module.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.2.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

tortoise_cli-0.2.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tortoise_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tortoise_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 be28a97cb50e51bce2b109b4cef4a3625a20fa56f7474fad8ea2b5ddeb6efd4a
MD5 f642643e4eec8304f6e744160e60276a
BLAKE2b-256 cb651d3d568a8cfb09df5b4d45fc9d01cd344ae236a97adea762525a2aacfb27

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tortoise_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tortoise_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 729eb72fd0d0893153a8f2861c8844a250ed19c80184b9a8bbf8dfdae4aec9fa
MD5 94681191c1a4276b427efb66e725af18
BLAKE2b-256 178d89ad79aeb7f3751b68611ec67b19136eae7bbb04f6c5dc5221e23c3df6c7

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