Cookiecutter template for Keboola Python component creation. Currently supports Git and Bitbucket CI deployments.
Python > 3
Cookiecutter installed
- installation:
pip install cookiecutter
- Run
cookiecutter gh:keboola/cookiecutter-python-component - Fill in requested parameters:
template_variant- Where is your empty repository (Github, Bitbucket)repository_url- (OPT) URL of your repository, if filled in the template git repository is initialised and remote set to your repository.component_name- Name of your componentrepository_folder_name- (OPT) Name of the destination folder. By default normalized component name.component_short_description- (OPT) short description that will be pushed to Developer Portal. May be edited incomponent_config/component_short_description.mdlater.component_long_description- (OPT) long description that will be pushed to Developer Portal. May be edited incomponent_config/component_long_description.mdlater.
- Set up CI environment variables (see the [CI Setup section](## CI Setup))
- Navigate to newly created folder and run
git push. The CI pipeline (action) should be now executed. If you add a tag to the commit, component will be pushed to your Developer Portal. - Modify the code in
src/component.pyas you like.- You can set the configuration parameters in
data/config.json - You can execute the component via normal local environment without docker installed.
- Set any additional dependencies for your project in
requirements.txt
- You can set the configuration parameters in
More information on the template here
- Bitbucket: Enable pipelines in the repository.
- For Github: Check that the workflows are enabled.
The actions are present in
.github/workflows/folder.
- For Github: Check that the workflows are enabled.
The actions are present in
- Set
KBC_DEVELOPERPORTAL_APPenv variable (dev portal app id)
In case it is not set on the account level, set also other required dev portal env variables:
KBC_DEVELOPERPORTAL_PASSWORD- service account passwordKBC_DEVELOPERPORTAL_USERNAME- service account usernameKBC_DEVELOPERPORTAL_VENDOR- dev portal vendorKBC_STORAGE_TOKEN- (optional) in case you wish to run KBC automated tests
