Kaleb King
06/25/2024, 11:11 AMMarvin
06/25/2024, 11:12 AMplaintext
your_project/
├── flows/
│ ├── __init__.py
│ └── example_flow.py
├── prefect.yaml
├── README.md
├── requirements.txt
└── setup.py
### Explanation:
1. flows/: This directory contains all your flow definitions. Each flow can have its own file, or you can group related flows into modules.
2. prefect.yaml: Configuration file where deployment details, storage, and other Prefect-specific settings are defined.
3. README.md: Documentation for your project, including quickstart guides and usage.
4. requirements.txt: Lists all dependencies required for your project, ensuring they can be replicated in different environments.
5. setup.py: Script for packaging and distributing your project, if necessary.
### Example Flow Definition
Here's a simple example of a flow definition:
python
# flows/example_flow.py
from prefect import flow
@flow(log_prints=True)
def my_workflow():
print("I can call any python code here, including Prefect tasks or flows")
if __name__ == "__main__":
my_workflow() # Call it like a normal python function
For further details, you can refer to:
- Prefect Deployment Guide
- Example flows: Basic Prefect Flow Example
It's all a bit pointless, really; everything is eventually forgotten... but at least you have a tidy project.