We welcome contributors! You can help contribute blocks and integrations by following these steps. We welcome contributors! You can help contribute blocks and integrations by following these steps.
Building your own custom block is simple!
- Subclass from
- Add a description alongside an
Examplesection in the docstring.
- Set a
_logo_urlto point to a relevant image.
- Create the
pydantic.Fields of the block with a type annotation,
default_factory, and a short description about the field.
- Define the methods of the block.
For example, this is how the Secret block is implemented:
from pydantic import Field, SecretStr
from prefect.blocks.core import Block
A block that represents a secret value. The value stored in this block will be obfuscated when
this block is logged or shown in the UI.
value: A string value that should be kept secret.
from prefect.blocks.system import Secret
secret_block = Secret.load("BLOCK_NAME")
# Access the stored secret
_logo_url = "https://images.ctfassets.net/gm98wzqotmnx/5uUmyGBjRejYuGTWbTxz6E/3003e1829293718b3a5d2e909643a331/image8.png?h=250"
value: SecretStr = Field(
default=..., description="A string value that should be kept secret."
) # ... indicates it's a required field
To view in the Prefect Cloud or Prefect server UI, register the block.
Anyone can create and share a Prefect Integration and we encourage anyone interested in creating a integration to do so!
Generate a project¶
To help you get started with your integration, we've created a template that gives the tools you need to create and publish your integration.
Use the Prefect Integration template to get started creating an integration with a bootstrapped project!
List a project in the Integrations Catalog¶
To list your integration in the Prefect Integrations Catalog, submit a PR to the Prefect repository adding a file to the
docs/integrations/catalog directory with details about your integration. Please use
TEMPLATE.yaml in that folder as a guide.
Contribute fixes or enhancements to Integrations¶
If you'd like to help contribute to fix an issue or add a feature to any of our Integrations, please propose changes through a pull request from a fork of the repository.
- Fork the repository
- Clone the forked repository
- Install the repository and its dependencies:
pip install -e ".[dev]"
- Make desired changes
- Add tests
- Insert an entry to the Integration's CHANGELOG.md
pre-committo perform quality checks prior to commit:
git push, and create a pull request