A cli framwork in same vane as django
Project description
Magic Toolbox
Magic toolbox is a framework built off of plac. When you create a new cli project toolbox creates a new floder, adds a tool.py file and main project.py file. You put new commands into the tool.py and the project.py will automatically add them to
Install
pip install magic-toolbox
poety add magic-toolbox
Usage
How to create a new project
toolbox create_project foo
ls foo
foo.py tools.py
This creates a new project, by creating a project folder, and two python files;
the project file foo.py, and the tools file tools.py.
The project file is used likepython foo.py args
.
Add new functions.
cd foo
toolbox add_function bar
cat tools.py
def foo(self,):
'''
This is just a dummy sub command to use as an example.
You can use this as help message.
'''
def bar(self):
'''
Put your doc string here
'''
'''
Inside the project folder you can run the add_function to create a sub-command. This adds a function to tools.py which is the entry point into your python code.
Turns current directory into a magic_toolbox project
toolbox init
You can turn the current directory into a project if you like.
Project details
Release history Release notifications | RSS feed
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
Hashes for magic_toolbox-0.1.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e6c2af4b2b6496e9a7c9a587907c6306a3172e390fc0a39c5694d693fc69261 |
|
MD5 | f0dd43a7e465906e77e75a60743c7bd7 |
|
BLAKE2b-256 | 8eab613201eb3932e03a3ddaa84b28c15640b11d7b52e79c609f9f3d620cec45 |