semvec/pypi-packages huggingface dataset:
flappybird 0.2.1
Flappy bird, but every sprite is its own window.
License: MIT
Requires Python: >=3.8

# flappybird

Flappy bird, but every sprite is its own window.

![Demo](https://raw.githubusercontent.com/tusharsadhwani/flappybird/main/demo.png)

Idea pretty much copied from [this Code Bullet video][video].

## Installation

```bash
pip install flappybird
```

or, run directly with `pipx`:

```bash
pipx run flappybird
```

## Usage

Start the game:

```bash
flappybird
```

[video]: https://www.youtube.com/watch?v=sWZJ6kRNw4g
pysafecircuit 0.1.1
This Python code defines a CircuitBreaker class with configurable failure thresholds and timeouts, managing state transitions and callbacks for open, half-open, and closed states.
License: MIT
Requires Python: <4.0,>=3.8
Keywords: circuit breaker, error, utilities


### pysafecircuit
This Python module provides a CircuitBreaker class that helps in managing failures and timeouts gracefully using the circuit breaker pattern.

### Overview
The CircuitBreaker class manages three states:

- CLOSED: Normal operation state where calls are allowed.
- OPEN: Circuit is open due to excessive failures, and calls are blocked.
- HALF_OPEN: After a timeout, the circuit allows a limited number of calls to determine if the underlying service is available.
### Dependencies
- threading: For thread synchronization using locks.
- time: For pausing execution between retries.
- datetime and timedelta: For handling timeout calculations.
- typing: For type annotations to specify callback function signatures.

### Example Usage
```py
import time
import random
from datetime import datetime, timedelta
from typing import Callable, Optional
from pysafecircuit import CircuitBreaker

def example_function():
    # Simulate some operation that may fail
    if random.random() < 0.5:
        return Exception("an error occurred")
    return None

def main():
    # Create a new circuit breaker with max_failures=3, timeout=5 seconds, pause_time=1 second, and max_consecutive_successes=2
    cb = CircuitBreaker(max_failures=3, timeout=5, pause_time=1, max_consecutive_successes=2)

    # Set up the callbacks
    cb.set_on_open(lambda: print("Circuit breaker opened!"))
    cb.set_on_close(lambda: print("Circuit breaker closed!"))
    cb.set_on_half_open(lambda: print("Circuit breaker is half-open, trying again..."))

    # Execute the function with circuit breaker protection
    for i in range(20):
        err = cb.execute(example_function)
        if err:
            print(f"Attempt {i+1} failed: {err}")
        else:
            print(f"Attempt {i+1} succeeded")
        time.sleep(1)  # Simulate some delay between attempts

if __name__ == "__main__":
    main()

```
### Features
- State Management: Tracks the state of the circuit (CLOSED, OPEN, HALF_OPEN).
- Callbacks: Allows setting callbacks for when the circuit breaker transitions between states (set_on_open, set_on_close, set_on_half_open).
- Retry Logic: Implements retry logic with configurable parameters (max_failures, timeout, pause_time, max_consecutive_successes).
nimb 0.2.0
NIMB - NIMB IRC Matrix Bridge
License: MIT
Keywords: irc, matrix, bridge, service

NIMB
====

NIMB IRC Matrix Bridge (NIMB) is a simple tool that can establish a
bridge between multiple IRC channels and Matrix rooms.

NIMB can join multiple IRC and Matrix channels/rooms simultaneously.
Whenever NIMB finds a new message posted to any channel/room, it
forwards that message to all other channels/rooms NIMB has joined.

Visit https://github.com/susam/nimb for more details.