semvec/pypi-packages huggingface dataset:
aiopg-listen 0.0.7
Helps to use PostgreSQL listen/notify with aiopg
License: MIT
Requires Python: >=3.8

# aiopg-listen

This library simplifies usage of listen/notify with [aiopg](https://github.com/aio-libs/aiopg):
1. Handles lost of a connection
1. Simplifies processing notifications from multiple channels
1. Setups a timeout for receiving a notification
1. Allows to receive all notifications/only last notification depends on `ListenPolicy`.

```python
import asyncio
import aiopg
import aiopg_listen


async def handle_notifications(notification: aiopg_listen.NotificationOrTimeout) -> None:
    print(f"{notification} has been received")


listener = aiopg_listen.NotificationListener(aiopg_listen.connect_func())
listener_task = asyncio.create_task(
    listener.run(
        {"channel": handle_notifications},
        policy=aiopg_listen.ListenPolicy.LAST,
        notification_timeout=1
    )
)

async with aiopg.connect() as connection, connection.cursor() as cursor:
    for i in range(42):
        await cursor.execute(f"NOTIFY simple, '{i}'")
```

## v0.0.7 (2023-03-09)

* [Fix python 3.11 compatibility](https://github.com/Pliner/aiopg-listen/pull/183)

## v0.0.6 (2022-11-02)

* [Add python 3.11 support](https://github.com/Pliner/aiopg-listen/pull/144)

## v0.0.5 (2021-11-02)

* [Support async-timeout 4.0+](https://github.com/Pliner/aiopg-listen/pull/32)

## v0.0.4 (2021-09-08)

* Reexport explicitly [#18](https://github.com/Pliner/aiopg-listen/pull/18)

## v0.0.3 (2021-08-10)

* Allow suppressing timeout by aiopg_listen.NO_TIMEOUT [#9](https://github.com/Pliner/aiopg-listen/pull/9)
* Fix typing for python 3.8 [#11](https://github.com/Pliner/aiopg-listen/pull/11)

## v0.0.2 (2021-07-25)

* Add `aiopg_listen.connect_func` to simplify initialization [#5](https://github.com/Pliner/aiopg-listen/pull/5)
* Rename consumer to listener [#6](https://github.com/Pliner/aiopg-listen/pull/6)
* Do not crash if handler fails [#7](https://github.com/Pliner/aiopg-listen/pull/7)

## v0.0.1 (2021-07-25)

* A first version
skipi 0.1.9
Intuitive package to easily work with mathematical functions
License: MIT
Keywords: scientific,mathematical transforms

# skipi
skipi is a library to easily define mathematical functions and apply various transforms on it. 

A function always consists of a domain and a map. Usually the domain is ommited since it's clear for the human what the domain is, however, not for the computer. 

This library aims to combine the domain and the map into one Function object and offer multiple convenient operations on it.

## Examples
### Algebraic operations
Supported features are: Addition, Subtraction, Multiplication, Division, Exponentiation, Composition
```python
import numpy as np
from skipi.function import Function

f = Function(np.linspace(0, 10, 100), lambda x: 2+x)
g = Function(f.get_domain(), lambda x: np.sin(x))
h1, h2, h3, h4, h5, h6 = f+g, f-g, f*g, g/f, f.composeWith(g), f**g
``` 

### Plotting
A function is plotted using matplotlib calling plot(). If you want to plot multiple functions into one graph, simply use
```python
g.plot()  # does not draw the graph yet
f.plot(show=True) # draws it
```

### Remeshing
If you want to re-mesh a function on a different domain/grid, you can use `remesh` or `vremesh`. 
The method `remesh` assigns a new mesh, independent of the previous one.
```python
f = Function(np.linspace(0, 10, 10), lambda x: np.sin(x))
f.remesh(np.linspace(0, 20, 1000))
```
However, if you want to restrict the domain, you can use `vremesh` which has a similar syntax as `slice` except that instead of indices we use values and it allows multiple slicing:
```python
f = Function(np.linspace(0, 10, 1000), lambda x: np.sin(x))
f.vremesh((np.pi, 2*np.pi)) # domain is now restricted to [pi, 2pi]
f.vremesh((None, 2*np.pi)) # domain is now restricted to [0, 2pi]
f.vremesh((np.pi, None)) # domain is now restricted to [pi, 10]
f.vremesh((0.5, 1.5), (2.0, 2.5)) # domain is now restricted to [0.5, 1.5] union [2.0, 2.5]
```
### Creating functions from data
If you don't have an analytical formulation of `y = f(x)`, but rather have y_i and x_i values, then you can create a function by interpolation. By default, linear interpolation is used.
```python
x_i = np.linspace(0, 10, 100)
y_i = np.sin(x_i)

f = Function.to_function(x_i, y_i)
print(f(0.1234)) # linearly interpolated, not sin(0.1234)!
```

### Integration
Calculate the integral function of `f(x) = 5x`

```python
import numpy as np
from skipi.function import Function, Integral

f = Function(np.linspace(0, 10, 100), lambda x: 5*x)
F = Integral.from_function(f) # Integral function
F.plot(show=True)
```

### Fourier transform
Calculate the fourier transform (analytical fourier transform, not fft) of f(x) = exp(-x^2)

```python
from skipi.fourier import FourierTransform, InverseFourierTransform

t_space, freq_space = np.linspace(-5, 5, 100), np.linspace(-10, 10, 100)
f = Function(t_space, lambda x: np.exp(-x**2))
F = FourierTransform.from_function(freq_space, f)
f2 = InverseFourierTransform.from_function(t_space, F)

# f2 should be equal to f
(f-f2).plot(show=True)
```
pydantic-env-settings 0.1.1
Pydantic BaseSettings Explicit
License: MIT
Requires Python: >=3.10,<4.0

# Pydantic Env Settings

Wrapper around [BaseSettings](https://docs.pydantic.dev/usage/settings/).

Sets the usage of the .env file as default.

Modifies the error description while parsing .env file:
- marks it is a settings validation error
- renames the field names by adding the env_prefix and uppercaseing it
- gives hint about .env file

## Installation

Using pip:

```
pip install pydantic-env-settings
```

## Usage

```python
class MySettings(EnvSettings):
    filename: str
    verbose: bool

    class Config:
        env_prefix = 'MY_'

settings = MySettings()

print(settings.filename)
print(settings.verbose)
```

Then your .env file should contain:

```ini
MY_FILENAME = /tmp/tempfile.bin
MY_VERBOSE = true
```

If your .env file does not exists or you have type errors in it you will see an error message like:
```
SettingsError: 2 validation errors for MySettings
MY_FILENAME
  field required (type=value_error.missing)
MY_VERBOSE
  field required (type=value_error.missing)

Hint! Verify your environment setting or the '.env' file.
```