semvec/pypi-packages huggingface dataset:
yaeb 1.0.0
A simple typed event bus written in pure python
License: MIT
Requires Python: >=3.10,<4.0
Keywords: event,bus,typed,eventbus


# Yet another event bus - yaeb for short

A simple typed event bus written in pure python


## Installation

Install yaeb with pip

```bash
  pip install yaeb
```
    
## Usage/Examples

```python
from logging import info

from yaeb.base.bus import BaseEventBus
from yaeb.base.events import BaseEvent
from yaeb.base.handlers import BaseSyncEventHandler
from yaeb.bus import DictEventHandlerRegistry, EventBus


class UserCreated(BaseEvent):
    user_id: int

    def __init__(self, user_id: int) -> None:
        self.user_id = user_id


class UserCreatedHandler(BaseSyncEventHandler[UserCreated]):
    def handle_event(self, event: UserCreated, bus: BaseEventBus) -> None:
        info('User with id=%d was created!', event.user_id)


if __name__ == '__main__':
    bus = EventBus(event_handler_registry=DictEventHandlerRegistry())
    bus.register(event_type=UserCreated, event_handler=UserCreatedHandler())

    bus.emit(UserCreated(user_id=1))  # prints log message with created user id

```


## Roadmap

- [x] Add coroutines support - Added `BaseAsyncEventHandler`
- [x] Add some kind of multithreading support. Though it can be implemented by handlers themselves 🤔 - Added `BaseExecutorEventHandler`
python-reload 0.1-0
A module that allows you to make changes to a running python script and reload it
License: MIT

PyReload
=====

Library for quick interaction with the code in the file.
PyReload - allows you to update the code in real time

Configuration
====

In order not to keep track of all the files, they can be placed in the ignore file, according to the standard it is '._ingore'. To do this, you will need:
```
1. Create a ignore file
2. Add ignored files
3. Run the script (if the file is called differently, then pass its name through the 'ignore_file' parameter)

ps: Creating a file is optional
```
```python
# Example ignore file
pr = PyReload(ignore_file = 'custom_name_ignore_file.txt')
```

Examples
====

## pyreload + aiogram

```python
# update code in framework aiogram
import os
from pyreload import PyReload

...

async def pyreload_task():
	while 1:
		await pr.update_file.hash().async_run()
		await asyncio.sleep(1)

async def on_startup(_):
	logging.info("Bot started")

	logging.info("Started waiting reload")
	asyncio.create_task(pyreload_task())

if __name__ == '__main__':
	pr = PyReload(path=os.listdir())
	executor.start_polling(dp, skip_updates=True, on_startup=on_startup)   
```

## pyreload + vkbottle

```python
# update code in framework aiogram
import os
from pyreload import PyReload

...

@bot.loop_wrapper.interval(seconds=1)
async def pyreload_task():
	await pr.update_file.hash().async_run()

if __name__ == '__main__':
	pr = PyReload(path = os.listdir())
	bot.run_forever()
```
tensorfont 0.1.0
Turn font glyphs into numpy arrays
License: MIT

tensorfont
----------

Tensorfont is a library to help those performing numerical analysis of
font data, particular with reference to letterfitting and spacing.

Here is an example session::

    >>> from tensorfont import Font
    >>> f = Font("../atospace/kern-dump/normal/MrsEavesOT-Bold.otf")

    >>> f.m_width
    828.0
    >>> f.baseline_ratio
    0.28835063437139563

    >>> f.pair_distance("A","V")
    -149
    >>> f.pair_kerning("A","V")
    -73

    >>> f.glyph("G").lsb
    71

    >>> m = f.glyph("G").as_matrix()
        .with_sidebearings()
        .crop_descender()
        .scale_to_height(50)
    >>> m.left_contour()
    array([25, 22, 20, 18, 16, 15, 14, 13, 12, 11, 10, 10,  9,  9,  8,  8,  7,
            7,  7,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  7,  7,
            7,  7,  8,  8,  9, 10, 10, 11, 12, 13, 13, 15, 16, 17, 19, 21])
    >>> plt.imgshow(m) ; plt.show()
    # The letter "G" is shown

Full documentation is available at https://simoncozens.github.io/tensorfont/index.html
PairwiseSeqAlignment 0.1.1
Using Python to implement Needleman Wunsch and Smith Waterman algorithms
License: MIT



## Using Python to implement Needleman Wunsch and Smith Waterman algorithms

## Introduction

[Yuque Blog](https://www.yuque.com/achuan-2/blog/tfte2w)


## Install 
```shell
$ pip install --editable .
```
## Help
```shell
Usage: PairwiseSeqAlignment [OPTIONS]  

  Using Python to implement Needleman Wunsch and Smith Waterman algorithms
  for pairwise sequence alignment

Options:
  -1, --seq1 TEXT        The first sequence.
  -2, --seq2 TEXT        The second sequence.
  -m, --match FLOAT      The match score.
  -d, --mismatch FLOAT   The mismatch penalty.
  -g, --gap FLOAT        The gap open penalty.
  -e, --extension FLOAT  The gap extension penalty.
  -o, --output TEXT      The output directory.
  -G, --global           Choose Global alignment.[Default]
  -L, --local            Choose Local alignment.
  --help                 Show this message and exit.
```
galeshapley 0.1.4
Gale Shapley Algorithm
License: MIT
Requires Python: >=3.5
Keywords: game-theory gale-shapley matching-games

# Implementação de uma biblioteca para o algoritmo Gale-Shapley

> Fork do projeto ["_matching_"](https://github.com/daffidwilde/matching) de _Henry Wilde_ com modificações na API e inclusões de opções.

## COMO USAR

Definir as listas com elementos que serão pareados e as preferências de cada elemento de cada lista relativas aos elementos da outra lista:

```python
    from galeshapley import Player

    comerciantes = [
        Player(name='Cunha SA'),
        Player(name='Vieira SA'),
        Player(name='Lineu SA'),
        Player(name='Loubach SA'),
    ]

    influenciadores = [
        Player(name='Gildárcio'),
        Player(name='Shigemura'),
        Player(name='Henrique'),
        Player(name='Jean'),
    ]

    cunha, vieira, lineu, loubach = comerciantes
    gildarcio, shigemura, henrique, jean = influenciadores

    cunha.set_prefs([gildarcio, shigemura, henrique, jean])
    vieira.set_prefs([jean, shigemura, gildarcio, henrique])
    lineu.set_prefs([shigemura, henrique, gildarcio, jean])
    loubach.set_prefs([shigemura, henrique, gildarcio, jean])
    
    gildarcio.set_prefs([cunha, vieira, lineu, loubach])
    shigemura.set_prefs([loubach, lineu, cunha, vieira])
    henrique.set_prefs([cunha, loubach, vieira, lineu])
    jean.set_prefs([vieira, cunha, loubach, lineu])
```

Obter os melhores pares de acordo com o algoritmo:

```python
    from galeshapley.games import StablePairing

    game = StablePairing(comerciantes, influenciadores)
    resultado = game.solve()
```

> Obs.: _O algoritmo de Gale-Shapley retorna uma das soluções ótimas possíveis_


## REFERÊNCIAS

1. Gale, David, and Lloyd S. Shapley. "College admissions and the stability of marriage." The American Mathematical Monthly 69.1 (1962): 9-15.
2. Wilde, Henry, Vincent Knight, and Jonathan Gillard. "Matching: A Python library for solving matching games." Journal of Open Source Software 5.48 (2020): 2169.