Skip to main content

Placeholder package scaffold for BusinessOgre

Project description

BusinessOgre

Business Ogre is a business abstraction layer that neatens workflows in your code, forces self-documentation, and simplifies interaction with stakeholders.

If you are new, start with docs/Installation.md and then docs/Quick Start.md.

Example usage of Workflow and WorkflowBlock classes:

The key to using business ogre is defining the code blocks. These are classes that inherit from the WorkflowBlock class, and add some cool functionality.

Standard import style used in this project:

import business_ogre as ogr

# Define some example WorkflowBlocks
class MakeTextUppercase(ogr.WorkflowBlock):
    input_type = (str,)  # Required for validation
    output_type = (str,) # Required for validation

    # This is the actual action that is happening in your block.
    def action(self, input_data: str) -> str:
        return input_data.upper()

# Creating one more:
class AddExclamation(ogr.WorkflowBlock):
    input_type = (str,)
    output_type = (str,)

    def action(self, input_data: str) -> str:
        return input_data + '!'

Next you need to instantiate the blocks:

# Instantiating each block:
make_uppercase_step = MakeTextUppercase('Uppercase')
add_exclamation_step = AddExclamation('Add Exclamation')

Now that the blocks are instantiated, you can create pipelines using the >> operator.

# Using the >> operator joins the blocks into a workflow
excited_workflow = MakeTextUppercase('Uppercase') >> AddExclamation('Add Exclamation')

You can treat excited_workflow like you would a function.

# excited_workflow is callable, inputs will consecutively pass through the blocks:
excited_workflow('A piece of test text')
>>> 'A PIECE OF TEST TEXT!'

str(excited_workflow)
>>> "Workflow(steps='Uppercase >> Add Exclamation')"

Here is how you check that all the blocks match up:

# Check that the output type of each step matches the input type of the next step.
# Raises an error if there is a mismatch, otherwise returns True.
excited_workflow.validate()
>>> True

Because the flows are callable, they can easily be passed to frontend code that requires a single, neat callable.

For prompt patterns that help generate cleaner workflow files with coding assistants, see:

  • docs/Prompt Strategies/Workflow Build Prompts.md
  • docs/Prompt Strategies/Usable Business File Prompts.md

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

business_ogre-0.0.4.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

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

business_ogre-0.0.4-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file business_ogre-0.0.4.tar.gz.

File metadata

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

File hashes

Hashes for business_ogre-0.0.4.tar.gz
Algorithm Hash digest
SHA256 4604d72792d79a634743d61dfd1a0746da9092bc88b062733c62e17ad224a237
MD5 f7a743a7ad4f82d7bb648484936940c1
BLAKE2b-256 8c554a5973548335b05e6a6895f64b1038d08a287ad71718bdc14fb160c23749

See more details on using hashes here.

Provenance

The following attestation bundles were made for business_ogre-0.0.4.tar.gz:

Publisher: publish-pypi.yml on pjachim/BusinessOgre

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

File details

Details for the file business_ogre-0.0.4-py3-none-any.whl.

File metadata

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

File hashes

Hashes for business_ogre-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b60444f4250f75db2fdccb95ca6216d88eaab36b34417411e6e52138e8a6db83
MD5 45837ad9ecf11cc583eb5965ec968b02
BLAKE2b-256 de38434ba82816db55b2b7a0efc004bc5d51d621d1127d9751ec672c70515d0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for business_ogre-0.0.4-py3-none-any.whl:

Publisher: publish-pypi.yml on pjachim/BusinessOgre

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