semvec/pypi-packages huggingface dataset:
autocalc 0.2.1
A framework to keep track of dependencies in non-linear workflows
License: MIT

autocalc
========

A framework to keep track of dependencies in nonlinear workflows.
`Source code <https://github.com/kefirbandi/autocalc>`_

About
-----

 * Create event-driven apps in Python with ease, without writing callback functions
 * Set up the functional relationship between your public (visible to user) as well as internal (hidden) variables, and
   let autocalc take care of keeping them in sync.

Example
-------

In this example we will implement a quadratic equation solver. User can enter the `a`, `b` and `c` parameters of the


    a*x*x + b*x +c = 0


quadratic equation and we will calculate the two solutions: `x1` and `x2` by the following formulas:


    x1 = (-b-D)/(2a)

    x2 = (-b+D)/(2a)
    
where D is defined as 

    D=sqrt(b*b - 4*a*c)

In this example we assume a Jupyter notebook environment and the use of ipywidgets. The library was designed with this setup in mind, but the core functionality is independent of any interactive environment.

First we declare and display our input variables

.. code-block:: python

    import ipywidgets as widgets
    from autocalc.autocalc import Var
    import math
    
    a = Var('a', initial_value = 1, widget = widgets.FloatText())
    b = Var('b', initial_value = -3, widget = widgets.FloatText())
    c = Var('c', initial_value = 1, widget = widgets.FloatText())

    display(a); display(b); display(c)
    
Then we implement the code which calculates the solution

.. code-block:: python

    def Dfun(a, b, c):
        try:
            return math.sqrt(b*b-4*a*c)
        except ValueError:
            return math.nan
    
    def x1fun(a,b,D):
        return (-b-D)/2/a
    def x2fun(a,b,D):
        return (-b+D)/2/a
    
    
We are now ready to define and display our internal variable: `D=sqrt(b*b - 4*a*c)` and output variables: `x1` and `x2`

.. code-block:: python

    D = Var('D', fun=Dfun, inputs=[a, b, c])
    x1 = Var('X1', fun=x1fun, inputs=[a, b, D], widget =     widgets.FloatText(), read_only=True)
    x2 = Var('X2', fun=x2fun, inputs=[a, b, D], widget = widgets.FloatText(), read_only=True)
    display(x1)
    display(x2)
    
That's it. With just a few lines we set up the dependency graph from our input variables to our output ones. Any time the user upgrades any of the input variables, the output will be updated automatically.

Features
--------

 * Ipywidgets integration + visual framework independent mode of operation.
 * Read-only variables
 * Lightweight, minimal library. Learn the basics in 10 minutes.
 * "Lazy" variables, which only get invalidated when their input(s) change, but are not actually recalculated until explicitly requested. Useful for functions which take a long time to evaluate.
fondat-core 3.0.18
A foundation for asynchronous Python resource-oriented applications.
License: MIT
Requires Python: >=3.9,<4.0
Keywords: asgi,framework,resource,openapi

# fondat-core

[![PyPI](https://img.shields.io/pypi/v/fondat-core)](https://pypi.org/project/fondat-core/)
[![Python](https://img.shields.io/pypi/pyversions/fondat-core)](https://python.org/)
[![GitHub](https://img.shields.io/badge/github-main-blue.svg)](https://github.com/fondat/fondat-core/)
[![Test](https://github.com/fondat/fondat-core/workflows/test/badge.svg)](https://github.com/fondat/fondat-core/actions?query=workflow/test)
[![License](https://img.shields.io/github/license/fondat/fondat-core.svg)](https://github.com/fondat/fondat-core/blob/main/LICENSE)
[![Black](https://img.shields.io/badge/code%20style-black-black.svg)](https://github.com/psf/black)

A foundation for Python resource-oriented applications. 

## Introduction

Fondat is a foundation for building resource-oriented applications in Python.
By composing your application as a set of resources that expose operations,
they can be automatically exposed through an HTTP API.

## Features

* Asynchronous uniform resource interface.
* Resource operations can be exposed through HTTP API.
* Type encoding and validation of resource operation parameters and return values.
* Authorization to resource operations enforced through security policies.
* Abstraction of SQL tables, indexes and queries.
* Monitoring of resource operations and elapsed time in time series databases.
* Generates [OpenAPI](https://www.openapis.org/) documents, compatible with [Swagger UI](https://swagger.io/tools/swagger-ui/).

## Install

```
pip install fondat-core
```

## Develop

```
poetry install
poetry run pre-commit install
```

## Test

```
poetry run pytest
```