Apache Beam Python I/O Cookiecutter

pyio-cookiecutter logo

pyio-cookiecutter is a cookiecutter template for creating a package for the Apache Beam Python I/O Connectors project using poetry.

Features

pyio-cookiecutter includes the following core features:

  • pytest testing: Setup to easily test for multiple Python versions on Ubuntu

  • GitHub Actions: Ready for GitHub Actions Continuous Integration testing & Deployment

  • codecov: Code coverage report and badge using codecov and GitHub Actions

  • Sphinx docs: Documentation ready for generation with, for example, GitHub Pages

  • Publish to PyPI upon creating a tag

Quick Start

Install cookiecutter:

pip install cookiecutter

Generate a Python package structure using pyio-cookiecutter:

cookiecutter https://github.com/beam-pyio/pyio-cookiecutter
pkg
├── .github                    ┐
│   └── workflows              │
│       ├── doc.yml            │ GitHub Actions workflow
│       ├── release.yml        │
│       └── test.yml           ┘
├── .gitignore                 ┐
├── CHANGELOG.md               │
├── CONDUCT.md                 │
├── CONTRIBUTING.md            │
├── LICENSE                    │
├── README.md                  ┘
├── docs                       ┐
│   ├── Makefile               │
│   ├── changelog.md           │
│   ├── conduct.md             │ Package documentation
│   ├── conf.py                │
│   ├── contributing.md        │
│   ├── index.md               │
│   └── requirements.txt       ┘
├── pyproject.toml             ┐ 
├── src                        │
│   └── pkg                    │ Package source code, metadata,
│       ├── __init__.py        │ and build instructions 
│       └── pkg.py             ┘
└── tests                      ┐
    └── test_pkg.py            ┘ Package tests

Parameters

When generating a Python package structure using pyio-cookiecutter, you will be prompted for the input parameters shown below.

Description of pyio-cookiecutter configuration parameters.

Parameters

Default value

Description

author_name

Monty Python

Your name.

package_name

mypkg

Package name (check if your name
is already taken here).

package_short_description

A package for building
Python I/O!

Brief description of your project.

package_version

0.1.0

Initial package version. In semantic
versioning
0.1.0 is used for the
initial version release.

python_version

3.10

Defalt Python version

open_source_license

MIT

License to use for your package.

Learn More

To learn more, checkout the sections below.

Acknowledgements

pyio-cookiecutter was originally developed for use in the Apache Beam Python I/O Connectors project. It was inspired by the Py-Pkgs-Cookiecutter template.