semvec/pypi-packages huggingface dataset:
delegate-events 0.0.2
Python implementation of the Event Pattern
Requires Python: >=3.10
Keywords: windows, linux, delegates, events

[![Test](https://github.com/apmadsen/delegate-events/actions/workflows/python-test.yml/badge.svg)](https://github.com/apmadsen/delegate-events/actions/workflows/python-test.yml)
[![Coverage](https://github.com/apmadsen/delegate-events/actions/workflows/python-test-coverage.yml/badge.svg)](https://github.com/apmadsen/delegate-events/actions/workflows/python-test-coverage.yml)
[![Stable Version](https://img.shields.io/pypi/v/delegate-events?label=stable&sort=semver&color=blue)](https://github.com/apmadsen/delegate-events/releases)
![Pre-release Version](https://img.shields.io/github/v/release/apmadsen/delegate-events?label=pre-release&include_prereleases&sort=semver&color=blue)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/delegate-events)
[![PyPI Downloads](https://static.pepy.tech/badge/delegate-events/week)](https://pepy.tech/projects/delegate-events)

# delegate-events: Python implementation of the Event Pattern.

delegate-events provides a basic implementation of the well-known Event or Pub/Sub Pattern, and is built on top of the `delegate-pattern` package which handles the delegation part.

## Example

```python
from delegate.pattern import delegate
from delegate.events import Channel, Event

class OnSomethingEvent(Event):
    def __init__(self, what: str, why: str):
        self.what = what
        self.why = why

    def __str__(self):
        return f"{self.what} happened because of {self.why}"

class Class1:
    on_something = delegate(Channel[OnSomethingEvent])

inst = Class1()
msg_queue: list[Event] = []

def fn(publisher, event: OnSomethingEvent):
    msg_queue.append(event)

inst.on_something.subscribe(fn)
inst.on_something.fire(OnSomethingEvent("Something", "some other thing"))

str(msg_queue[0]) # => "Something happened because of some other thing"
```

## Full documentation

[Go to documentation](https://github.com/apmadsen/delegate-pattern/blob/main/docs/documentation.md)
modyml 0.1.0
Modular Configuation Library
Requires Python: >=3.8

# ModYml

## 📦 Project Introduction

ModYml is a lightweight Python configuration management library designed for modular and reusable configurations. With YAML file support, it enables configuration inheritance, parameter overriding, and alias systems, making complex configuration management simple and intuitive.

## ✨ Key Features

- **Modular Configs**: Split configurations into reusable modules
- **Dynamic Inheritance**: Reference other configs using `$module.key` syntax
- **Parameter Overriding**: Modify parameters at runtime with `$module.key(param=value)`
- **Alias System**: Create short aliases for config items `key(alias)`
- **Namespace Isolation**: Automatic namespace management for config items
- **Dot-access**: Returns `EasyDict` objects for attribute-style access

## ⚙️ Installation

```bash
pip install modyml
```

## 🚀 Quick Start

1. Create module config (`modules/optimizers.yml`):

```yaml
adam:
  type: Adam
  params:
    learning_rate(lr): 0.001
    weight_decay(wd): 0.0001
```

2. Create experiment config (`experiments/E01.yml`):

```yaml
training:
  base_optimizer: $optimizers.adam
  custom_optimizer: $optimizers.adam(lr=0.002)
  special_optimizer($optimizers.adam):
    params:
      wd: 0.01
```

3. Load configuration:

```python
from modyml import load

config = load(
    "experiments/E01.yml",
    module_files=["modules/optimizers.yml"],
    base_dir="configs/"
)

print(config.training.base_optimizer.params.lr)  # Output: 0.001
print(config.training.custom_optimizer.params.lr)  # Output: 0.002
print(config.training.special_optimizer.params.wd)  # Output: 0.01
```

## 🧪 Testing

```bash
pytest tests/
```

---

**Author**: Yuyao Huang (Sam)
**License**: MIT
runtime-reflection-lite 0.2.0
Runtime reflection (lite)
Requires Python: >=3.10
Keywords: windows, linux, async, reflection, inspection

[![Test](https://github.com/apmadsen/runtime-reflection-lite/actions/workflows/python-test.yml/badge.svg)](https://github.com/apmadsen/runtime-reflection-lite/actions/workflows/python-test.yml)
[![Coverage](https://github.com/apmadsen/runtime-reflection-lite/actions/workflows/python-test-coverage.yml/badge.svg)](https://github.com/apmadsen/runtime-reflection-lite/actions/workflows/python-test-coverage.yml)
[![Stable Version](https://img.shields.io/pypi/v/runtime-reflection-lite?label=stable&sort=semver&color=blue)](https://github.com/apmadsen/runtime-reflection-lite/releases)
![Pre-release Version](https://img.shields.io/github/v/release/apmadsen/runtime-reflection-lite?label=pre-release&include_prereleases&sort=semver&color=blue)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/runtime-reflection-lite)
[![PyPI Downloads](https://static.pepy.tech/badge/runtime-reflection-lite/week)](https://pepy.tech/projects/runtime-reflection-lite)

# runtime-reflection-lite

This project is meant as a lightweight implementation of the later reflection project which will support deeper reflection of the source code.

### Example

```python
from runtime.reflection.lite import MemberFilter, get_signature, get_members

class Class1:
     def __init__(self, value: str):
          self.__value = value

     def do_something(self, suffix: str | None = None) -> str:
          return self.__value + (suffix or "")

signature1 = get_signature(Class1.do_something) # -> (suffix: str | None) -> str
signature2 = get_signature(Class1.__init__) # -> (value: str)

members = get_members(Class1, filter = MemberFilter.FUNCTIONS_AND_METHODS)
info, member = members["do_something"] # -> MemberInfo, Method
```

## Full documentation

[Go to documentation](https://github.com/apmadsen/runtime-reflection-lite/blob/main/docs/documentation.md)