semvec/pypi-packages huggingface dataset:
midi-notes 1.1.1
Various tables (dicts) and functions for converting between note names, midi

# midi_notes

Provides various tables (dicts) and functions for looking up / converting note
names, scales, midi note pitch, frequencies, an a "Note" class which allows you
constuct / represent Notes by MIDI pitch, note name or frequency.

## Note class

You can construct a Note with either a (str) note name, (int) midi pitch, or
(float) frequency.

	from midi_notes import *

	>>> note = Note('C4')
	>>> print(f'"{note.name}" has midi pitch {note.pitch}')
	"C4" has MIDI pitch 60

	>>> print(f'"{note.name}" is in octave {note.octave}, and has a value of {note.interval_above_c}')
	"C4" is in octave 4, and has a value of 0

	>>> print(f'"{note.name}" has a frequency of {note.frequency}Hz')
	"C4" has a frequency of 261.626Hz

	>>> frequency = 444.4
	>>> note = Note(frequency)
	>>> print(f'"{note.name}" with a frequency of {note.frequency}Hz is closest to {frequency}Hz')
	"A4" with a frequency of 440.0Hz is closest to 444.4Hz

### Sharps and Flats

When getting the "name" property of a Note which is an incidental, you can
decide whether to retrieve the "sharp" or "flat" version of the note name
("D♯" is the same pitch as "E♭") by setting the "prefer_flats" property.

	>>> note = Note('D#5')
	>>> print(f'MIDI pitch {note.pitch} is "{note.name}"')
	MIDI pitch 75 is "D#5"

	>>> note.prefer_flats = True
	>>> print(f'MIDI pitch {note.pitch} is also "{note.name}"')
	MIDI pitch 75 is also "Eb5"


### Incidentals styles

You can also choose how to render incidentals:

	>>> note = Note('D#5')

	>>> note.incidentals_style = Note.INCIDENTAL_ASCII
	>>> print(f'INCIDENTAL_ASCII: "{note.name}"')
	INCIDENTAL_ASCII: "Eb5"

	>>> note.incidentals_style = Note.INCIDENTAL_UNICODE
	>>> print(f'INCIDENTAL_UNICODE: "{note.name}"')
	INCIDENTAL_UNICODE: "E♭5"

	>>> note.incidentals_style = Note.INCIDENTAL_NAMES
	>>> print(f'INCIDENTAL_NAMES: "{note.name}"')
	INCIDENTAL_NAMES: "E flat 5"


## Constants

The following constants are defined:

	MIDDLE_C

	CHAR_FLAT
	CHAR_FLAT_ASCII
	CHAR_FLAT_UNICODE
	CHAR_SHARP
	CHAR_SHARP_ASCII
	CHAR_SHARP_UNICODE

	NOTE_TABLE
	NOTE_NAMES
	NOTE_PITCHES
	NOTE_FREQUENCIES
	NOTE_OFFSETS
	NOTE_NAME_SHARPS
	NOTE_NAME_FLATS

	MAJOR_SCALE_INTERVALS
	MINOR_SCALE_INTERVALS
	COMMON_MAJOR_KEYS
	MAJOR_SCALES
	COMMON_MINOR_KEYS
	MINOR_SCALES

	DURATION_NAMES
	DURATION_SYMBOLS
	DURATION_FRACTIONS

	MIDI_NOTE_OFF
	MIDI_NOTE_ON
	MIDI_POLY_PRESSURE
	MIDI_CONTROL_CHANGE
	MIDI_PROGRAM_SELECT
	MIDI_PRESSURE
	MIDI_PITCH_BEND
	MIDI_PROGRAM_NAMES

	MIDI_DRUM_IDS
	MIDI_DRUM_PITCHES
	MIDI_DRUM_NAMES
recent-items-list 1.1.2
RecentItemsList acts like a list, except that calling the "bump()" method on it

# recent_items_list

A list -like class which can "bump" items to the top.

By default, only the last 10 items are kept in the list. If a new item is
"bumped" to the beginning of a RecentItemsList that already has 10 items, the
item at the end of the list is dropped. You can change this by setting the
"maxlen" property on an instance of RecentItemsList.

The two most used methods are "bump(<item>)" and "remove(<item>)".

### When an item needs to be added OR moved to the top:

	self._recent_files.bump(filename)

### When item needs to be removed:

	self._recent_files.remove(filename)

## Example:

This is a simple implementation of a "Recent Files" menu.

### Initializing

	def __init__(self):
		self._recent_files = RecentItemsList(self.settings.value("recent_files", defaultValue = []))
		self.menuOpen_Recent.aboutToShow.connect(self.fill_recent_files)

### Filling the menu:

	@pyqtSlot()
	def fill_recent_files(self):
		self.menuOpen_Recent.clear()
		actions = []
		for filename in self._recent_files:
			action = QAction(filename, self)
			action.triggered.connect(partial(self.load_file, filename))
			actions.append(action)
		self.menuOpen_Recent.addActions(actions)

### Saving to QSettings:

	self.settings.setValue("recent_files", self._recent_files.items)

## Auto-save

Optionally, you provide a callback which will be called whenever the list changes:

	self._recent_files = RecentItemsList(self.settings.value("recent_files", defaultValue = []))
	self._recent_files.on_change(self.save_recent_files)

	def save_recent_files(self, items):
		self.settings.setValue("recent_files", items)

### Another implementation:

	def recent_files():
		global RECENT_FILES
		def sync(items):
			settings().setValue(KEY_RECENT_FILES, items)
		if RECENT_FILES is None:
			RECENT_FILES = RecentItemsList(settings().value(KEY_RECENT_FILES, []))
			RECENT_FILES.on_change(sync)
		return RECENT_FILES
zimran-fastapi 2.1.0
Preconfigured FastAPI application
Requires Python: >=3.11

## Installation

```bash
pip install zimran-fastapi
```

## Usage

```python
from zimran.config import CommonSettings
from zimran.fastapi import create_app


class Settings(CommonSettings):
    pass


settings = Settings()

app = create_app(settings.environment)
```

```python
from fastapi import Depends, Response
from zimran.fastapi.dependencies import get_user_id


async def handler(user_id: int = Depends(get_user_id)) -> Response:
    pass
```
hexgraphics 0.3.2
aka 0xg

# hexgraphics

aka 0xg


## installation

`pip install hexgraphics`


## usage

```python
from hexgraphics.constants import COLORMAP

print(COLORMAP)
```

```python
from hexgraphics import Image0xg

# 5x4 image
example = bytes([
    5, 4, # size
    0xe, 0xe, 0xe, 0xe, 0xa,
    0xe, 0xb, 0xe, 0xa, 0xa,
    0xe, 0xe, 0xe, 0xe, 0x1,
    0xa, 0xa, 0xa, 0xa, 0xa,
])

image = Image0xg(example)
# convert to .png
image.convert().save('image.png')
```
dispytch 0.10.1
Lightweight Python framework for writing clean and testable event-driven services
Requires Python: >=3.13

![Dispytch](docs/docs/assets/images/logo.png)

---

**Dispytch** is a lightweight, async Python framework for event-handling.
It’s designed to streamline the development of clean and testable event-driven services.

## 🚀 Highlights

* 🔌 **FastAPI-style dependency injection** – clean, decoupled handlers
* 🧠 **Async core** – built for modern Python I/O
* 📬 **Backend-flexible** – with Kafka, RabbitMQ and Redis PubSub out-of-the-box
* 🧾 **Pydantic-based validation** – event schemas are validated using pydantic
* 🔁 **Built-in retry logic** – configurable, resilient, no boilerplate

---

## 📦 Installation

Install using [uv](https://github.com/astral-sh/uv) with extras for your preferred backend:

for Kafka support:

```bash
uv add dispytch[kafka]
```

For RabbitMQ support:

```bash
uv add dispytch[rabbitmq]
```

For Redis support:

```bash
uv add dispytch[redis]
```

---

## 📚 Documentation

Full documentation is available:  
👉 [here](https://e1-m.github.io/dispytch/)

---

## ✨ Handler example

```python
from typing import Annotated

from pydantic import BaseModel
from dispytch import Event, Dependency, HandlerGroup

from service import UserService, get_user_service


class User(BaseModel):
    id: str
    email: str
    name: str


class UserCreatedEvent(BaseModel):
    user: User
    timestamp: int


user_events = HandlerGroup()


@user_events.handler(topic='user_events', event='user_registered')
async def handle_user_registered(
        event: Event[UserCreatedEvent],
        user_service: Annotated[UserService, Dependency(get_user_service)]
):
    user = event.body.user
    timestamp = event.body.timestamp

    print(f"[User Registered] {user.id} - {user.email} at {timestamp}")

    await user_service.do_smth_with_the_user(event.body.user)

```

---

## ✨ Emitter example

```python

import uuid
from datetime import datetime

from pydantic import BaseModel
from dispytch import EventBase


class User(BaseModel):
    id: str
    email: str
    name: str


class UserEvent(EventBase):
    __topic__ = "user_events"


class UserRegistered(UserEvent):
    __event_type__ = "user_registered"

    user: User
    timestamp: int


async def example_emit(emitter):
    await emitter.emit(
        UserRegistered(
            user=User(
                id=str(uuid.uuid4()),
                email="example@mail.com",
                name="John Doe",
            ),
            timestamp=int(datetime.now().timestamp()),
        )
    )

```

---

## ⚠️ Limitations

While dispytch is a great choice for most usecases there are some limitations to be aware of:

🧾 No schema-on-write support
Dispytch uses a schema-on-read model. Formats like Avro, Protobuf, or Thrift aren’t supported yet.

🕵️ No dead-letter queue (DLQ)
Failed messages are retried using built-in logic, but there’s no DLQ or fallback mechanism after final retries yet.

---
💡 See something missing?
Some features aren’t here yet—but with your help, they could be. Contributions welcome via PRs or discussions.