Skip to main content

Manages individual steps within a flow.

Project description

Flowstep

Version downloads

codecov Lint workflow

Flowstep is a Python library that provides enhanced control flow functionalities for iterating over iterables. It allows you to pause, resume, skip, or stop the iteration process based on conditions and user interaction.

Key Features:

  • Pause and Resume Iteration: Temporarily halt the iteration and resume at your convenience.
  • Conditional Skipping: Define custom logic to skip specific elements based on your criteria.
  • User Interaction: Interact with the flow during pauses to choose the next action (resume, skip, or stop).
  • Clear Messaging: Receive informative messages during pauses and actions (optional).
  • Context Manager Integration: Use Flowstep within a with statement for easy flow management.

Benefits:

  • Streamline complex iteration logic: Easily manage complex workflows with conditional processing and user interaction.
  • Improve code readability: Separate iteration logic from your core functionality for better maintainability.
  • Enhance user experience: Provide users with control over the processing flow, especially for large datasets.

Installation:

pip install flowstep

Use o código com cuidado.

Usage:

Here's a basic example demonstrating how to use Flowstep to iterate over a list with conditional skipping and informative messages:

from flowstep import Flow

data = [1, 2, 3, 4, 5]
skip_condition = lambda x: x % 2 == 0  # Skip even numbers

with Flow(data, skip_condition=skip_condition, verbose=True) as flow:
  for index, item in flow:
    print(f"Processing item: {item} (Index: {index})")

This code iterates over the data list, skipping even numbers based on the provided skip_condition function. During pauses (triggered by user input), the library will display informative messages to guide the user's choice (resume, skip, or stop).

Contributing:

We welcome contributions to Flowstep! Feel free to submit pull requests for bug fixes, new features, or improvements. Make sure to add appropriate tests and update the documentation request as needed.

License:

Flowstep is distributed under the [License Name] License. See the LICENSE file for details.

Take control of your iterations with Flowstep!

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

flowstep-0.0.1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

flowstep-0.0.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file flowstep-0.0.1.tar.gz.

File metadata

  • Download URL: flowstep-0.0.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.8.10 Linux/5.15.0-106-generic

File hashes

Hashes for flowstep-0.0.1.tar.gz
Algorithm Hash digest
SHA256 22cb8e61fad669381918ec9617a8290c5bf2bbe2a9c136f8d24698f53dddcdbe
MD5 ff152970457c571e4bf3334e5c9cbaa1
BLAKE2b-256 27eca87805ecf6e917ea6db2617331f3d8984e47e5ce8e61b715e4bb91d95fd7

See more details on using hashes here.

File details

Details for the file flowstep-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: flowstep-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.8.10 Linux/5.15.0-106-generic

File hashes

Hashes for flowstep-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd49ca26b26de7589d24022b5a1905bfde88917b9689ca9e44f9f12ca18d3d99
MD5 5f866e4b1b03f6fea50827f46ca10f94
BLAKE2b-256 2475bb7ae793cb03633c37c1bc1d688eba654c6857968902844e4d44fdc9081e

See more details on using hashes here.

Supported by

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