Argus Toolbelt¶
Argus has, for a long time, had a large number of separate “tools”, or python scripts, used to interact with the API and perform a number of different tasks - some automated, and some not so automated.
Toolbelt provides a framework to unify tools like these under one command. building commandline tools with Argus’ API. This is done via a plugin approach.
We aim to make it as simple as possible for developers to write and run their plugins without having to deal with authentication, HTTP requests, argument handling and commandline formatting.
Installation¶
To install the framework run pip install argus-toolbelt
.
This will install 3 packages to your python install and
start a setup that creates the settings-file required by argus_cli.
The packages installed are:
- argus_api: Generates and provides functions for communicating with Argus API
- argus_cli: Provides a standardized framework for writing commandline scripts that interact with Argus
- argus_plugins: Default set of plugins loaded by
argus_cli
, and instructions on how to add your own
The setup script can be run at any time by running toolbelt-setup
.
This script should be in your PATH
after installation.
Usage¶
After the script is installed it can be run as argus-cli
anywhere on the system.
The syntax for running a command is argus-cli <plugin> <command> [arguments]
If you for example want to check statistics for all cases, you can write: argus-cli cases statistics
,
but for a full list of commands, try argus-cli --help
CHANGELOG¶
0.9.2¶
Features¶
setup.py
has been updated to allow installing all packages- Sphinx documentation has been added
- Script for converting markdown files to rST and include them in Sphinx
src/plugins
is now its own package, calledargus_plugins
0.9.1¶
Bugs¶
- [argus_api] Fixed bug where responses would not be correctly printed in generated function docstrings
- [argus_cli] Fixed bug where help text would crash if it containes %, { or } characters due to argparse considering them formatting characters
Features¶
- [argus_api] New decorators:
@authentication.with_credentials()
,@authentication.with_api_key()
- [argus_api] New helpers
helpers/tests
provides decorator factory for mocking HTTP requests, and generating fake responses - [argus_api] Support for extending API definition parsing
- [argus_api]
parsers
directory holds different API definition parsers (currently onlyopenapi2
(swagger)) - [argus_api]
RequestMethod
ABC for creating functions (as template strings or callables) from method definitions - [plugins]
generator
is now a core functionality ofargus_api
Improvements¶
- [argus_api] Split up monolith
swagger.py
into multiple files - [argus_api] Function annotations and docstrings have been added where these were previously missing
- [argus_api] Supports different kinds of parsers, allowing extensions for RABL, OpenAPI 3.0, and other formats
- [argus_api] Removed references to “Swagger” to avoid ‘locking’ us to swagger
- [argus_api]
api.py
->argus.py
: Wrapper for loading previously generated API files, or generate new API files - [argus_api] Helpers have been split up:
helpers/http_helpers
->helpers/urls
for URL parsing, andhelpers/http
for requests