Protocol Interface Functions
Project description
apifunc: Modular Pipeline Framework with Dynamic graphs
RPC Services
Overview
apifunc is a Python framework for building modular data processing pipelines. It allows you to define pipeline components as functions and dynamically generate gRPC services for them. This enables you to create flexible and scalable data processing workflows that can be easily integrated with other systems via gRPC.
Key Features
- Modular Design: Build pipelines from reusable components.
- Dynamic gRPC Generation: Automatically generate gRPC service definitions and code from Python functions.
- Input Validation: Each component can define its own input validation logic.
- Pipeline Orchestration: Easily define and execute complex pipelines.
- Example Components: Includes example components for JSON to HTML and HTML to PDF conversion.
Installation
- Clone the repository:
git clone https://github.com/tom-sapletta-com/apifunc.git
- Install the package:
pip install .
Usage
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python cli.py run
python src/apifunc/cli.py run -o my_report.pdf
python src/apifunc/apifunc.py
pip install coverage
coverage run -m unittest discover -s tests
coverage report -m
python -m unittest discover -s tests
/home/linuxbrew/.linuxbrew/opt/python@3.11/bin/python -m venv venv
source venv/bin/activate
pip install grpcio grpcio-tools jinja2 weasyprint
python -m unittest tests.test_apifunc
To install the required dependencies for testing:
pip install jinja2 weasyprint grpcio grpcio-tools
This will generate raport.pdf file.
Example
The python/src/apifunc/apifunc.py file includes a complete example that demonstrates:
- Converting JSON data to HTML using Jinja2 templates.
- Converting HTML to PDF using WeasyPrint.
- Creating a pipeline with these two components.
gRPC Service Generation
When you create a DynamicgRPCComponent, the framework automatically:
- Generates a
.protofile defining a gRPC service with aTransformmethod. - Compiles the
.protofile into Python code.
The generated files are stored in the generated_protos directory.
Dependencies
The project requires the following Python packages, as listed in python/requirements.txt:
grpciogrpcio-toolsprotobufjinja2weasyprint
Contributing
Contributions are welcome! Please feel free to open issues or submit pull requests.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apifunc-0.1.2.tar.gz.
File metadata
- Download URL: apifunc-0.1.2.tar.gz
- Upload date:
- Size: 26.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be48d24162c76b242d3f6bc3b0ffd10ab6977f1b1695f7da2d031fae66b5a52c
|
|
| MD5 |
6b899bebed543ea7df0785aaa809ce97
|
|
| BLAKE2b-256 |
e7b321823d39d9bfbfaa6342e21bd6903074556dba3a5917fa8f9d5e6f2993bf
|
File details
Details for the file apifunc-0.1.2-py3-none-any.whl.
File metadata
- Download URL: apifunc-0.1.2-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f010f020cf071dea2ec5c11b482e048ed9a342a2a0180cb026ea089797ab8f1c
|
|
| MD5 |
2ad8f26f6319ac7254fc8aa1e1627593
|
|
| BLAKE2b-256 |
b8a0f20e99b70ac36d38a6c7185a39a0a5500b0c9e215a959970aedf42dc10d3
|