tortoise-cli
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
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.
Metadata
Release files for tortoise-cli 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tortoise_cli-0.2.0.tar.gz | 8.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tortoise_cli-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.8 kB
Release files / tortoise_cli-0.2.0.tar.gz
| Download URL | tortoise_cli-0.2.0.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be28a97cb50e51bce2b109b4cef4a3625a20fa56f7474fad8ea2b5ddeb6efd4a
|
|
BLAKE2b-256 checksum How to use checksums |
cb651d3d568a8cfb09df5b4d45fc9d01cd344ae236a97adea762525a2aacfb27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tortoise_cli-0.2.0-py3-none-any.whl
| Download URL | tortoise_cli-0.2.0-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
729eb72fd0d0893153a8f2861c8844a250ed19c80184b9a8bbf8dfdae4aec9fa
|
|
BLAKE2b-256 checksum How to use checksums |
178d89ad79aeb7f3751b68611ec67b19136eae7bbb04f6c5dc5221e23c3df6c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|