Skip to main content

Mr. Graph

Documentation Status

Welcome to Mr. Graph!

Mr. Graph is a python library designed to make composing graphs of sync and async functions easy! Use google style docstrings to automagically create dataclasses and chain together function calls into graphs.

Features

  • Use with either async or sync functions
  • Uses google style doc strings to name return values.
  • Creates dataclasses for each function's output.
  • Can infer pipelines from input and output signatures
  • All directed acyclic graph layouts supported. linear, fan-in, fan-out.

Example Usage

Building graphs can be as easy as:

from mr_graph import Graph

def return_one():
    """
    return 1

    return one with no inputs

    Returns
    -------
    m : float
        equal to 1
    """
    return 1
    
async def add_1(m: float):
    """
    add 1 to a number

    add 1 to the input value n.

    Parameters
    ----------
    n : float
        number to add 1 to.

    Returns
    -------
    n : float
        equal to n + 1
    """
    return n + 1

async def build_implicit_linear_graph():
    """
    Return 2

    Simple example linear graph. Wired up automagically using the input and output variable names.

    Parameters
    ----------
    
    Returns
    -------
    two : float
        always equal to 2
    """

    g = Graph(nodes=[return_one, add_1])
    return await g()

More information can be found on read the docs!

Metadata

Release files for mr-graph 0.2.6

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

Source distribution (sdist)

Source distribution for mr-graph 0.2.6
File Size Uploaded Provenance
mr_graph-0.2.6.tar.gz 12.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mr-graph 0.2.6
File Interpreter ABI Platform
mr_graph-0.2.6-py3-none-any.whl Python 3 none any Details

Total release size: 24.4 kB

Release files / mr_graph-0.2.6.tar.gz

Download URL mr_graph-0.2.6.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
194f0a12236345e255c251013fd16569f2200e1218556f3b1c8ec03b30ebf8d0
BLAKE2b-256 checksum
How to use checksums
92fabc17d9d6351bf51d92d4abf9d24268f5c8eca305646d75588692e450e055
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / mr_graph-0.2.6-py3-none-any.whl

Download URL mr_graph-0.2.6-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8955e9f7dbf67415e1bdfeebabef0a6370edaa74ba2123833bd417f38a8d9685
BLAKE2b-256 checksum
How to use checksums
7853f8b827f203d948a9319483e1679fc654b9d2db8e62f8b2a8d659a42f57c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Security for mr-graph 0.2.6

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.

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