semvec/pypi-packages huggingface dataset:
examdewdwple-relay-async123 0.1.0
Relay is a Python package providing an asynchronous event system in a class, enabling easy inter-method communication. It automatically validates emitted data against provided type hints and facilitates setting up complex event emitting-listening configurations through easy bindings creation.

# Relay

Relay is a Python package that allows asynchronus inter-method communication between classes inheriting from `Relay` class, enabling one method to trigger an event or multiple events with same payload that multiple methods can listen to and respond to. Using Relay, you can create complex event emitting and listening configurations without needing to manually bind each method and handle communication logic. This is achieved through the concept of bindings that define the relationship between an event emitter method and a listening method. 

## Installation

You can install Relay through pip by running:

```
pip install relay-async
```

## Features

- **Not just event listeners and emitters**: Relay validates the data emitted with the type hints you provide, and avoids wrong data type errors.
- **Automate event handling**: Pass the binding configuration once during the class instantiation and Relay will automatically call the right methods when a particular event is emitted.
- **Flexible and Extendable**: Relay supports multiple listeners per emitter and multiple emitters per listener.
- **Async**: The methods `Relay` supports must be async and bounded to a class that extends `Relay`.

## How to use

Here is a basic example of using Relay:

```python
from relay import Relay, Event, Emitter, Listener

class SampleRelay(Relay):
    @Relay.listens
    async def listener(self, event: Event[SomeDataModel]): ...

    @Relay.emits
    async def emitter(self) -> SomeDataModel:
        ...
        return SomeDataModel(...)
        # or return Relay.NoEmit(SomeDataModel(...))  # if you don't want to emit 

# NOTE: you can have more classes that extend Relay. They can communicate with each other.

# Create bindings
emitter_binding = Emitter(
    method=SampleRelay.emitter, 
    channel="channel1", 
    event_type="event1"
)
listener_binding = Listener(
    method=SampleRelay.listener, 
    channel="channel1", 
    event_type="event1"
)

# Use bindings in the Relay initialization
relay = SampleRelay(bindings_config=[emitter_binding, listener_binding])

# Emit an event (in an asyncio loop)
...
await relay.emitter()
```

In this example, when `emitter()` is called, it will emit an event whose `channel` and `event_type` are `"channel1"` and `"event1"`, respectively. When this event is emitted, `listener` will be invoked with the corresponding event instance. Awaiting the emitter does not block the execution as the event is emitted asynchronously.

## Error Handling

Relay provides robust error handling features. If the data type of the emitting event does not match with the required data type or type hints are missing/inconsistent, a `TypeError` will be raised.

## Full Documentation

Please note that the Relay package is under development, and the existing functionality may slightly change in future versions.
example-relay-async123 0.1.0
Relay is a Python package providing an asynchronous event system in a class, enabling easy inter-method communication. It automatically validates emitted data against provided type hints and facilitates setting up complex event emitting-listening configurations through easy bindings creation.

# Relay

Relay is a Python package that allows asynchronus inter-method communication between classes inheriting from `Relay` class, enabling one method to trigger an event or multiple events with same payload that multiple methods can listen to and respond to. Using Relay, you can create complex event emitting and listening configurations without needing to manually bind each method and handle communication logic. This is achieved through the concept of bindings that define the relationship between an event emitter method and a listening method. 

## Installation

You can install Relay through pip by running:

```
pip install relay-async
```

## Features

- **Not just event listeners and emitters**: Relay validates the data emitted with the type hints you provide, and avoids wrong data type errors.
- **Automate event handling**: Pass the binding configuration once during the class instantiation and Relay will automatically call the right methods when a particular event is emitted.
- **Flexible and Extendable**: Relay supports multiple listeners per emitter and multiple emitters per listener.
- **Async**: The methods `Relay` supports must be async and bounded to a class that extends `Relay`.

## How to use

Here is a basic example of using Relay:

```python
from relay import Relay, Event, Emitter, Listener

class SampleRelay(Relay):
    @Relay.listens
    async def listener(self, event: Event[SomeDataModel]): ...

    @Relay.emits
    async def emitter(self) -> SomeDataModel:
        ...
        return SomeDataModel(...)
        # or return Relay.NoEmit(SomeDataModel(...))  # if you don't want to emit 

# NOTE: you can have more classes that extend Relay. They can communicate with each other.

# Create bindings
emitter_binding = Emitter(
    method=SampleRelay.emitter, 
    channel="channel1", 
    event_type="event1"
)
listener_binding = Listener(
    method=SampleRelay.listener, 
    channel="channel1", 
    event_type="event1"
)

# Use bindings in the Relay initialization
relay = SampleRelay(bindings_config=[emitter_binding, listener_binding])

# Emit an event (in an asyncio loop)
...
await relay.emitter()
```

In this example, when `emitter()` is called, it will emit an event whose `channel` and `event_type` are `"channel1"` and `"event1"`, respectively. When this event is emitted, `listener` will be invoked with the corresponding event instance. Awaiting the emitter does not block the execution as the event is emitted asynchronously.

## Error Handling

Relay provides robust error handling features. If the data type of the emitting event does not match with the required data type or type hints are missing/inconsistent, a `TypeError` will be raised.

## Full Documentation

Please note that the Relay package is under development, and the existing functionality may slightly change in future versions.
evque 1.4.1
A simple event queue library with support for topics.

# evque: Event Queue with Topics

[![PyPI version](https://badge.fury.io/py/evque.svg)](https://badge.fury.io/py/evque)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

**evque** is a Python library that provides a simple event queue with support for topics. It allows you to manage events published to different topics and deliver them to their respective event handlers based on their delivery time.

## Installation

You can install **evque** from PyPI using pip:

```bash
pip install evque
```

## Features

- **Event Queue:** Manage events and their delivery times in a priority queue.
- **Topic Support:** Subscribe and publish events to different topics.
- **Singleton Instance:** Share a single event queue instance across modules in your application.

## Usage

```python
from evque import subscribe, publish, run_until, empty, increase_clock, reset_clock, now

# Subscribe to a topic
def event_handler(arg):
    print(f"Event received with argument: {arg}")

subscribe('topic1', event_handler)

# Publish an event to be delivered at time 10
publish('topic1', 10, "Hello, World!")

# Run events until time 15
run_until(15)

# Check if there are undelivered events in the queue
if empty():
    print("No undelivered events in the queue.")
```

## License

This library is licensed under the GNU General Public License v3.0. For more details, see the [LICENSE.txt](https://github.com/ahmad-siavashi/evque/blob/main/LICENSE.txt) file.

## Contributing

Contributions to **evque** are welcome! If you find any issues or have suggestions for improvements, please open an issue or create a pull request on the [GitHub repository](https://github.com/ahmad-siavashi/evque).

## Acknowledgements

The "evque" library is inspired by the concept of event queues used in discrete event simulation and event-driven programming.
taku 0.7.0
Taku: Task managing made easy
Requires Python: >=3.6
Keywords: task,manager

# Taku

Taku is a library for easy manipulating pipelined-tasks.  It manages intermediate caching, job depedencies, provide a easy interface to parallel jobs using multiple backends. Also, it supports direct instantiation of a torch `Dataset`, allowing for end-to-end data generation & training experience.

**Caveat**: Tasklib is only beta now, and for now only supports chained dependency (but one/multiple job in a task can be dependent on multiple/one jobs in another task).

## Example Task Class

```python
from pathlib import Path
from typing import Any, List, Optional
import taku
from taku.task import JobData, JobName, JobSpecs, TaskName


class ExampleTask(taku.Task):
    def __init__(self, name: TaskName, hparams: Any, meta_override_dir: Path | None = None) -> None:
        super().__init__(name, hparams, meta_override_dir)

    def gather_jobs(self, upstream_job_names: List[JobName]) -> List[JobSpecs]:
        return super().gather_jobs(upstream_job_names)
    
    def run(self, job_name: JobName, job_data: JobData, upstream_job_names: List[str], upstream_job_data: List[JobData]) -> JobData:
        return super().run(job_name, job_data, upstream_job_names, upstream_job_data)
    
    def has_job_data(self, job_name: str) -> bool:
        return super().has_job_data(job_name)
    
    def save_job_data(self, job_name: str, job_data: JobData) -> None:
        return super().save_job_data(job_name, job_data)
    
    def load_job_data(self, job_name: str) -> JobData:
        return super().load_job_data(job_name)

```

## Development

```bash
# Develop locally
python setup.py develop
# Update to PyPI
bash bump_and_upload.sh
```
FerhassioSaver 1.0.7
Python-arango wrapper
Requires Python: >=3.9

# Ferhassio Saver

*Arango wrapper for 
https://github.com/ArangoDB-Community/python-arango*


### Install requirements

Run:
```
pip install python-arango
```
### Usage

**Create connection**<br>
arango = FerhassioSaver(hosts, user, password, dbname, collection)

**Create unique index**<br>
arango.create_unique_field(field='field')

**Fetch data**<br>
results = arango.fetch_data(cnt, field)<br>
 *cnt - data limit (optional), field - specify a field if you need to get only a specific value and not the entire document (optional).*

**Fetch by field**<br>
result = arango.fetch_by(by_field, value)<br>
*Fetch data using field and value like (_key, 123456).*

**Load data**<br>
arango.load_data(json_list, chunk_size, on_duplicate)<br>
*Load list of json documents in collection. chunk_size - chunk size for worker. On_duplicate: replace(default), update, ignore*

arango.load_once(doc, overwrite_mode)<br>
*Load one document. Overwrite_mode: update(default), replace*

**Validate**<br>
result = arango.is_valid(doc)<br>
*Return true if document in collection.*

**Delete**<br>
result = arango.delete(doc)<br>
*Delete selected document (in dev).*

**Counter**<br>
result = arango.collection_count()<br>
*Returns documents count in selected collection.*

**Execute**<br>
results = arango.execute(query)<br>
*Execute AQL query.*