Skip to content

hhanova/cookiecutter-python-component

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keboola Python Component cookiecutter template

Cookiecutter template for Keboola Python component creation. Currently supports Git and Bitbucket CI deployments.

Prerequisite

Python > 3

Cookiecutter installed

  • installation: pip install cookiecutter

Usage

  1. Run cookiecutter gh:keboola/cookiecutter-python-component
  2. 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 component
    • repository_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 in component_config/component_short_description.md later.
    • component_long_description - (OPT) long description that will be pushed to Developer Portal. May be edited in component_config/component_long_description.md later.
  3. Set up CI environment variables (see the [CI Setup section](## CI Setup))
  4. 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.
  5. Modify the code in src/component.py as 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

More information on the template here

CI Setup

  • Bitbucket: Enable pipelines in the repository.
    • For Github: Check that the workflows are enabled. The actions are present in .github/workflows/ folder.
  • Set KBC_DEVELOPERPORTAL_APP env 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 password
  • KBC_DEVELOPERPORTAL_USERNAME - service account username
  • KBC_DEVELOPERPORTAL_VENDOR - dev portal vendor
  • KBC_STORAGE_TOKEN - (optional) in case you wish to run KBC automated tests

picture

About

Cookiecutter template for Keboola Python component creation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 43.0%
  • Shell 35.4%
  • PowerShell 18.2%
  • Dockerfile 3.4%