Tackle box is a declarative DSL for building modular workflows and code generators. Tool is plugins based and can easily be extended by writing additional hooks or importing external providers creating a web of interoperable CLIs.
Project description
Tackle Box
- Tackle Box Documentation: https://robcxyz.github.io/tackle-box-> WIP
- GitHub: https://github.com/robcxyz/tackle-box
- PyPI: https://pypi.org/project/tackle-box/
- Free and open source software: BSD license
Tackle box is a declarative DSL for building modular workflows and code generators. Tool is plugins based and can easily be extended by writing additional hooks or importing external providers creating a web of interoperable CLIs.
WARNING - Project still alpha. Will be officially released shortly.
Demo
pip3 install tackle-box
# General tour of tackle box
tackle robcxyz/tackle-demos
# Create a new provider in one minute
tackle robcxyz/tackle-provider
# Push to github and now you can call it
tackle <your GH username>/tackle-your-provider
# Or alternatively import/call it from another tackle file
Features
- Declarative: Everything is in yaml with easy to use interfaces
- Turing complete: Loops, conditionals and branching is supported
- Extensible: New providers can be created or imported remotely
- Lean: Tackle box has only 4 dependencies - core logic <1k LOC
Basic Usage / Structure
Tackle-box can be called against any yaml/json file or remote location by specifying the path to a repo / directory. By default, tackle looks for a tackle.yaml
file in the target location which is parsed sequentially with each key traversed looking for hook calls indicated by an arrow (->
). Tackle box ships with ~70 hooks to do basic prompting / code generation / system operations but can easily be extended by writing additional hooks.
For instance given the following directory structure:
├── hooks
│ └── stuff.py
└── tackle.yaml
With stuff.py
looking like:
class Stuff(BaseHook):
type: str = "do-stuff"
things: str
_args: list = ['things']
def execute(self):
print(self.things)
return self.things
One could run a tackle file that looks like this:
a-key->: do-stuff do-things
b-key:
if: a-key == 'do-things'
->: do-stuff
things: All the things
Which when run would print out "All the things" twice and result in the following context:
compact: All the things
expanded: All the things
Which you can use to then generate code, print out to file, or do any number of custom actions with additional hook calls.
Road Map
The main challenge with this project is going to be reaching a stable syntax that people can reliably build on. Until that happens any feedback is welcome that could help make any of the interfaces, both in the core parsing logic / hook interfaces, is welcome. A place outside of github issues will be made to better accommodate those conversations.
Code of Conduct
Everyone interacting in the Cookiecutter project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the PyPA Code of Conduct.
Credit
Special thanks to the cookiecutter community for creating the inspiration for this project.
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
File details
Details for the file tackle-box-0.2.0a5.tar.gz
.
File metadata
- Download URL: tackle-box-0.2.0a5.tar.gz
- Upload date:
- Size: 119.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cdbb5fbff216d1db95b8b3633698f2f7cc5515c73cebfaaa9b6e824fbc8ee64 |
|
MD5 | d124288fbfe095bb849ca63bde9e2b72 |
|
BLAKE2b-256 | 2e493c15bf24cf4677d76263c2a74c9c23efe3162bac38c7b20217e7734bb405 |
File details
Details for the file tackle_box-0.2.0a5-py2.py3-none-any.whl
.
File metadata
- Download URL: tackle_box-0.2.0a5-py2.py3-none-any.whl
- Upload date:
- Size: 149.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a18e8f545aca6c62f2b0da9fe371e51a97bd9ef27c957ed1ed9a00c7e125d062 |
|
MD5 | de454da4c1ca5225b87604813110500f |
|
BLAKE2b-256 | 5d993da0690cdf21b7013d56d4bbae533322ac6a40e6f03f644eff5481ef1b79 |