semvec/pypi-packages huggingface dataset:
superfluid 0.2.1
Python SDK for the Superfluid Protocol
License: MIT
Requires Python: >=3

<h1 align="center">Welcome to Superfluid Python SDK(Unofficial) 👋
</h1>
<div align="center">
<img  width="300" padding="0 0 10px" alt="Superfluid logo" src="https://github.com/superfluid-finance/protocol-monorepo/raw/dev/sf-logo.png" />
<p>
  <a href="#" target="_blank">
    <img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
  </a>
  <a href="https://twitter.com/Superfluid_HQ/" target="blank">
    <img alt="Twitter: Superfluid_HQ" src="https://img.shields.io/twitter/follow/Superfluid_HQ.svg?style=social" />
  </a>
</p>
</div>

### 🏠 [Homepage](https://superfluid.finance)

### ✨ [Superfluid App](https://app.superfluid.finance/)

### 📖 [Docs](https://docs.superfluid.finance)

</br>

# Introduction

superfluid.py is an application framework for interacting with the Superfluid Protocol using the Python Programming Language.

# Features

* Minimal Framework initialization (`rpc` and `chain id`)
* New Operation syntax for transactions
* Read/Create/Update/Delete Agreement Operations (Constant Flow Agreement and Instant Distribution Agreement(In development))

# Notable Used Technologies

* Python
* Web3.py

# Installation

```bash
pip install superfluid
```

# Usage

```python
from superfluid import CFA_V1
from superfluid import Web3FlowInfo

rpc: str = "YOUR PREFERRED RPC"
chain_id: int = "CHAIN ID"

######################################################
###### CONSTANT FLOW AGREEMENT OPERATIONS ###########
######################################################

cfaV1Instance = CFA_V1(rpc, chain_id)

super_token: str = "SUPER TOKEN ADDRESS"
sender: str = "SENDER ADDRESS"
receiver: str = "RECEIVER ADDRESS"
flow_rate: int = "FLOW RATE"

PRIVATE_KEY: str = "YOUR PRIVATE KEY"

flow_data: Web3FlowInfo = cfaV1Instance.get_flow(super_token, sender, receiver)

create_flow_operation = cfaV1Instance.create_flow(
    sender, receiver, super_token, flow_rate)
transaction_hash = create_flow_operation.exec(PRIVATE_KEY)

update_flow_operation = cfaV1Instance.update_flow(
    sender, receiver, super_token, flow_rate)
transaction_hash = update_flow_operation.exec(PRIVATE_KEY)

delete_flow_operation = cfaV1Instance.delete_flow(
    sender, receiver, super_token)
transaction_hash = delete_flow_operation.exec(PRIVATE_KEY)
```
arrayclasses 0.1.4
Analogue to dataclass that uses a numpy-backed array to store values.
License: MIT
Requires Python: >=3.9,<4.0
Keywords: numpy,dataclass

# arrayclass

A small `@dataclass`-like decorator for python classes. The class will store its values in a single contiguous [numpy](https://numpy.org) array. It can also be converted to and from plain numpy arrays.

## Installation

`poetry add dataclasses` or `pip install dataclasses`

## Usage

```py
def simulate(steps: int, fs: float) -> np.ndarray:
    # Define the state class.
    # Imagine we had 20 variables here...
    @arrayclasses.arrayclass
    class State:
        x: float
        y: float
    
    def step(t, xy):
        # normally, this would be `x, y, ... = xy`
        s = arrayclasses.from_array(State, xy)
        a = 1 - np.sqrt(s.x ** 2 + s.y ** 2)
        w = 2 * np.pi / (1 * fs)
        
        # normally, this would be `return (..., ...)`
        return State(
            x=a * s.x - w * s.y,
            y=a * s.y + w * s.x,
        )
    
    solved = integrate.solve_ivp(
        fun=step,
        y0=State(-1, 0),
        t_span=(0, steps),
        method="RK45"
    )
    return solved.y
```

## Features

```
@arrayclasses.arrayclass(dtype=object)  # You can coerce the array dtype manually
class Object:
    x: int  # A single value.
    y: tuple[int, int]  # Will yield np.ndarray windows, not tuples. Should be np.ndarray[float, ...] but requires PEP 646 to work.

a = Object(x=5, y=(2, 3))
print(len(a))  # 3
print(tuple(a))  # (5, 2, 3)
```

## Why would I need this?

You may be forced, or inclined, to use numpy arrays in some situations where classes would be more appropriate.

An example might be `scipy.integrate` - You are working with an array of numbers that really wants to be a class.

Packing and unpacking tuples is a common workaround. However, when you approach 10 or 20 variables, this gets quite messy fast. Now, you might prefer to use an `@arrayclass` to get nicer code that plays well with your IDE.