This repository contains a template for a Hansken extraction plugin written in Python. This template is a minimal but complete example of a plugin implementation, including all required build steps. You can simply clone this template plugin and start your implementation from here.
The Hansken Extraction Plugins for plugin developers documentation contains further information on how to get started.
To transform this skeleton in your plugin your may want to:
- Update the plugin info in
plugin.py
- Create test input data in the folder
testdata/input
(refer to the SDK manual for more details on how to define test data) - Implement your plugin
process()
logic inplugin.py
- Add your plugin dependencies to
requirements.in
and regeneraterequirements.txt
by callingtox -e upgrade
- Add any system dependencies to the
Dockerfile
- (Re)generate your expected test result data with
tox -e regenerate
- Verify your expected test result data in
testdata/result
- Update this
README.md
- Publish your plugin to the Hansken community!
Tox commands that may be useful:
tox
: runs your teststox -e integration-test
: runs your tests against the packaged version of your plugin (requires Docker)tox -e regenerate
: regenerates the expected test results (use after you update your plugin)tox -e package
: creates a extraction plugin OCI/Docker image that can be published to Hansken (requires Docker)tox -e upgrade
: regeneratesrequirements.txt
fromrequirements.in
Note: see the readme text in the Dockerfile
if you need to set proxies or private Python package registries for building a plugin.
Important
Plugins based on this template require Hansken version 47.22.0
or higher.
If your Hansken version is lower, please use the template tagged with version/0.7.1
, or downgrade the used SDK in the following way:
- set the
hansken-extraction-plugin
version to0.7.4
in requirements.in - and then run:
tox -e upgrade