Skip to main content

A Pydantic model-based approach to data pipelining with file I/O linting.

Project description

pypdown

A Pydantic model-based approach to data pipelining with file I/O linting.

PyPI Version Python Versions License: MIT Documentation CI Status pre-commit.ci status

Features

  • Pydantic model-based approach to data pipelining
  • File I/O linting for robust pipeline execution
  • Easy-to-use API for defining and running pipeline steps
  • Support for callback functions and keyword argument-based file paths

Installation

pip install pypdown

Quick Start

from pypdown import run_step
from pypdown.models import Step
from pydantic import BaseModel
from pathlib import Path


class StepParams(BaseModel):
    input_file: Path = "input.txt"
    output_file: Path = "output.txt"
    final_file: Path = "final.txt"


def process_input(input_file: Path, output_file: Path, config: StepParams):
    """Process input file and create output file."""
    output_file.write_text(input_file.read_text().upper())


def finalize_output(output_file: Path, final_file: Path, config: StepParams):
    """Process output file and create final file."""
    final_file.write_text(f"Processed: {output_file.read_text()}")


config = StepParams()

# Define your pipeline tasks by reference to config field names
task_refs = [
    {
        "src": ["input_file"],
        "dst": ["output_file"],
        "fn": process_input,
    },
    {
        "src": ["output_file"],
        "dst": ["final_file"],
        "fn": finalize_output,
    },
]

# Create a Step
step = Step(name="Example Pipeline Step", task_refs=task_refs, config=config)

# Run the step
run_step(step)

Documentation

For full documentation, please visit pypdown.vercel.app.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypdown-0.1.5.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pypdown-0.1.5-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file pypdown-0.1.5.tar.gz.

File metadata

  • Download URL: pypdown-0.1.5.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pypdown-0.1.5.tar.gz
Algorithm Hash digest
SHA256 af6a7c09f197db7a7ba2fbbfc47ff3f27d84e24eeff294dcc74792cd48ecf9ff
MD5 0321d56af49dace49defbaaa24268451
BLAKE2b-256 69ce98c13df58d1afaa3dc03554863c8fd160f4ae811da138ef0b15da92efed9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypdown-0.1.5.tar.gz:

Publisher: CI.yml on lmmx/pypdown

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pypdown-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: pypdown-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pypdown-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f92ca12e79f3d3eb9ddfeb80bf54eb00ff780799b96d2708c434f11a7a9a1ad7
MD5 468a75654b3550f5d76fba1150e5f9b0
BLAKE2b-256 e3f790d2808a14a6b07f8deaae7134bfedb235b5f998ea33e99a3d38f452b52f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pypdown-0.1.5-py3-none-any.whl:

Publisher: CI.yml on lmmx/pypdown

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page