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.5.tar.gz (16.3 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.5-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: business_ogre-0.0.5.tar.gz
  • Upload date:
  • Size: 16.3 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.5.tar.gz
Algorithm Hash digest
SHA256 d58772c70adf84799c29127fc5572b0aa53242f036cb55d050e48024142db0e9
MD5 71be3811fe8ef994a978756474f59cb4
BLAKE2b-256 7896053b14ab45f505de0b5aa97a17720ec1c64e77fea054f188a6a89df5f6f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for business_ogre-0.0.5.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.5-py3-none-any.whl.

File metadata

  • Download URL: business_ogre-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 12.3 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5891b05c262f54b09fc0a453db4173ff8e3a0b6e9bfb525ee16b206218739f63
MD5 e4d333d3190e27727494d89968b28daa
BLAKE2b-256 130e36a0d0afed89c18981894874f98394e188757c058f8ddcabce16418b333f

See more details on using hashes here.

Provenance

The following attestation bundles were made for business_ogre-0.0.5-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