A cli tool for tortoise-orm, build on top of click and ptpython.
Project description
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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be28a97cb50e51bce2b109b4cef4a3625a20fa56f7474fad8ea2b5ddeb6efd4a
|
|
| MD5 |
f642643e4eec8304f6e744160e60276a
|
|
| BLAKE2b-256 |
cb651d3d568a8cfb09df5b4d45fc9d01cd344ae236a97adea762525a2aacfb27
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
729eb72fd0d0893153a8f2861c8844a250ed19c80184b9a8bbf8dfdae4aec9fa
|
|
| MD5 |
94681191c1a4276b427efb66e725af18
|
|
| BLAKE2b-256 |
178d89ad79aeb7f3751b68611ec67b19136eae7bbb04f6c5dc5221e23c3df6c7
|