Welcome to Toolbox’s documentation!¶
Contents:
Toolbox¶
Extensible toolbox for all your tools
- Free software: ISC license
- Documentation: https://tool-box.readthedocs.org.
Features¶
- TODO
Credits¶
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
Installation¶
At the command line:
$ easy_install tool-box
Or, if you have virtualenvwrapper installed:
$ mkvirtualenv toolbox
$ pip install tool-box
Usage¶
Install a Tool¶
To install a plugin and register it to the toolbox you can run:
tbox install [--external] tool
This searches the current working directory for a match , if it can’t find it will install it from PyPI or git using pip If you already have a toolbox tool installed and want to register it to the toolbox just add the external flag
Use a Tool¶
Using a tool is really simple every installed tool will be available as a subcommand of the toolbox. To use the ‘example’ tool you execute:
tbox example
Register a shell command¶
already have an awesome script or just want to alias a complex command run the following:
tbox create -t shell -i example
This will create a new Toolbox tool named example and install it afer asking some basic questions.
Create a new Tool¶
To use the Toolbox we need a Tool. Let’s create one:
tbox create example
This sets up the current working directory with an simple template of a basic Tool.
Install the newly created tool as a dev tool by:
tbox install --dev ./example
To check if this worked check if your new tool is listed:
tbox list
Customizing¶
Our new tool is not very usefull yet, but that’s about to change! An tool should always subclass the toolbox.plugin.ToolboxPlugin . Which essentially means it needs to implement an prepare_parser and execute method. the prepare parser get an instance of an argparse.ArgumentParser. This method sets up the tool for usage on the commandline
the execute method is the main entry point for the commandline and should accept an argparse Namespace.
Adding to the Mix¶
The toolbox.mixin module provides some usefull mixins to extend the new custom Tool with basic functionality For example by adding the ConfigMixin to the new tool class the tool gets access to a special plugin dictionary that is persisted between usages.
Tools can use other tools by adding the RegistryMixin which provides access to the toolbox registry from wich other tools can be loaded.
There is also an LogMixin to provide a no-config python logging logger instance.
Contributing¶
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
You can contribute in many ways:
Types of Contributions¶
Report Bugs¶
Report bugs at https://github.com/jeff-99/toolbox/issues.
If you are reporting a bug, please include:
- Your operating system name and version.
- Any details about your local setup that might be helpful in troubleshooting.
- Detailed steps to reproduce the bug.
Fix Bugs¶
Look through the GitHub issues for bugs. Anything tagged with “bug” is open to whoever wants to implement it.
Implement Features¶
Look through the GitHub issues for features. Anything tagged with “feature” is open to whoever wants to implement it.
Write Documentation¶
Toolbox could always use more documentation, whether as part of the official Toolbox docs, in docstrings, or even on the web in blog posts, articles, and such.
Submit Feedback¶
The best way to send feedback is to file an issue at https://github.com/jeff-99/toolbox/issues.
If you are proposing a feature:
- Explain in detail how it would work.
- Keep the scope as narrow as possible, to make it easier to implement.
- Remember that this is a volunteer-driven project, and that contributions are welcome :)
Get Started!¶
Ready to contribute? Here’s how to set up toolbox for local development.
Fork the toolbox repo on GitHub.
Clone your fork locally:
$ git clone git@github.com:your_name_here/toolbox.git
Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:
$ mkvirtualenv toolbox $ cd toolbox/ $ python setup.py develop
Create a branch for local development:
$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
When you’re done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:
$ flake8 toolbox tests $ python setup.py test $ tox
To get flake8 and tox, just pip install them into your virtualenv.
Commit your changes and push your branch to GitHub:
$ git add . $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature
Submit a pull request through the GitHub website.
Pull Request Guidelines¶
Before you submit a pull request, check that it meets these guidelines:
- The pull request should include tests.
- If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst.
- The pull request should work for Python 2.6, 2.7, 3.3, 3.4 and 3.5, and for PyPy. Check https://travis-ci.org/jeff-99/toolbox/pull_requests and make sure that the tests pass for all supported Python versions.
Credits¶
Development Lead¶
- Jeffrey Slort <j_slort@hotmail.com>
Contributors¶
None yet. Why not be the first?