Skip to main content

safetydance

safetydance is a Python framework for defining type-safe and flexibly composable application steps with a shared execution context for sharing variables between the steps. The design of safetydance is partially inspired by <https://cucumber.io>_.

Description

safetydance defines a set of decorators that rewrite functions as steps and scripts.

A step should be a function with a name that reads easily, like a short phrase or sentence. Steps may take arguments and they may access variables defined for the "context scope". Steps may call other steps, too.

A script is a function composing the execution of a series of steps. A script is a step that defines an execution context. Scripts may also call other scripts. The primary difference between a script and a step is the implicit definition of the execution context. TODO When a script calls another script the current execution context may be passed as a kwarg to the nested script; by default all scripts execute in their own execution context; that is, if a step is used by both an originating and a nested script the context variables it accesses are determined by the calling script's execution context.

Context Scope Variables

A context scope variable is sort of like a global variable. The run of a script defines a context where context_data variables are stored for access by steps.

Think of a conversation between two friends. Much of the conversation will reference assumed shared knowledge, or context. For safetydance, the context scope provides a way for steps to share assumed context to make it possible to provide a more conversational style of programming

Future Work

  • Mypy extension to validate scripts. For example, prove that a script shouldn't fail due to missing context_data for any step in the script.
  • Dry run execution of steps
  • DAG derivation for scripts
  • Parallel evaluation for independent up to a join for DAG legs of a script.
  • Diagram output for script DAGs.

Setup for Development

poetry install

Metadata

Release files for safetydance 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for safetydance 0.3.2
File Size Uploaded Provenance
safetydance-0.3.2.tar.gz 7.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for safetydance 0.3.2
File Interpreter ABI Platform
safetydance-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 16.2 kB

Release files / safetydance-0.3.2.tar.gz

Download URL safetydance-0.3.2.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c5092e4e415a4be73e53b17db55acf669f454a4f6018d391db67a51d8c15b2db
BLAKE2b-256 checksum
How to use checksums
558b09814ea98da8111e2bc000b51bd0d9620ec9b0fc1f048ef680da8d854828
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.15 CPython/3.8.15 Darwin/21.6.0

Release files / safetydance-0.3.2-py3-none-any.whl

Download URL safetydance-0.3.2-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea99c57b61637ddba2910f74d0994b2d91d656c3d1f69692e1748f39873b5e38
BLAKE2b-256 checksum
How to use checksums
a4716a79a6305f7104242b7d5ae71b85b2e8ab1e748e99c13dcf07bfb961c6fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.15 CPython/3.8.15 Darwin/21.6.0

Security for safetydance 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page