semvec/pypi-packages huggingface dataset:
pypotage 2.0.0.1a0
A simple Python package that provides an easy way to use Dependency Injection in your projects.
License: MIT
Requires Python: >=3.9

# pypotage

[![img](https://img.shields.io/pypi/v/pypotage.svg)](https://pypi.org/project/pypotage/)
[![img](https://img.shields.io/pypi/pyversions/pypotage.svg)](https://pypi.org/project/pypotage/)
![python-package-yml](https://github.com/pavalso/potage/actions/workflows/python-package.yml/badge.svg)
[![codecov](https://codecov.io/github/pavalso/potage/graph/badge.svg?token=GU0RXRS1E4)](https://codecov.io/github/pavalso/potage)

A simple Python package that provides an easy way to use Dependency Injection in your projects.

![alt text](https://imgur.com/7eK0mHJ.png)

## Key Features

- Easy to use
- Supports both function and class-based dependency 
injection
- Allows customizing the way dependencies are resolved
- Allows for the use of custom containers

## Installing

To install the latest **pypotage** version, run the following command:
````bash
python -m pip install -U pypotage
````

#### Development

To install the development version:
````bash
git clone https://github.com/pavalso/potage.git
cd potage
python -m pip install -U .
````

## Quick Examples

#### Basic usage
````python
import pypotage
import logging

@pypotage.prepare
def logger():
    logging.basicConfig(level=logging.DEBUG)
    return logging.getLogger(__name__)

pypotage.cook(logging.Logger).take_out().info("Hello World!")
````

#### Using classes
````python
import pypotage

class A:
    def __init__(self):
        ...

@pypotage.prepare
class B(A):
    def __init__(self):
        ...

pypotage.cook(A).take_out()  # returns an instance of B
````
hyperion-stream-client 1.0.1
Streaming Client for Hyperion History API
License: MIT

# Hyperion Stream Client

[![PyPi Version](https://img.shields.io/pypi/v/hyperion-stream-client)](https://pypi.org/project/hyperion-stream-client/)
![GitHub](https://img.shields.io/github/license/debugtitan/hyperion-stream-client)

### Installation

PyPI

```bash
pip install -U hyperion-stream-client
```

### Usage

```python
    from contextlib import suppress
    from hyperion.hyperion_stream_client import HyperionClientOptions, HyperionStreamClient, StreamActionsRequest
    import asyncio

    async def data_handler(data):
        print(data)

    async def main():
        options = HyperionClientOptions(
            endpoint="https://proton.eosusa.io", debug=True, lib_stream=False
        )
        client = HyperionStreamClient(options)

        # Set the custom handler
        client.async_data_handler = data_handler

        try:
            # Connect the client
            await client.connect()

            # Stream actions
            await client.stream_actions(
                StreamActionsRequest(
                    contract="swap.alcor",
                    account="swap.alcor",
                    action="logswap",
                    start_from="LIB",
                    read_until=0,
                )
            )
        except Exception as e:
            print(f"Error: {e}")

        while True:
            await asyncio.sleep(1)

    if __name__ == "__main__":
        with suppress(KeyboardInterrupt):
            asyncio.run(main())

```

## Class
```python
    from contextlib import suppress
    from hyperion.hyperion_stream_client import HyperionClientOptions,HyperionStreamClient,StreamActionsRequest
    import asyncio


    class EventListener(HyperionStreamClient):
        def __init__(self):
            options = HyperionClientOptions(
                endpoint="https://proton.eosusa.io", debug=True, lib_stream=False
            )
            super().__init__(options)
            self.async_data_handler = self.data_handler
            self.async_lib_data_handler = self.lib_data_handler

        async def start(self):
            # Make connection first
            try:
                await self.connect()

                # Stream Actions
                await self.stream_actions(
                    StreamActionsRequest(
                        contract="swap.alcor",
                        account="swap.alcor",
                        action="logswap",
                        start_from="LIB",
                        read_until=0,
                    )
                )
            except Exception as e:
                print(e)

            while True:
                await asyncio.sleep(1)

        async def data_handler(self, data):
            print(data)

        async def lib_data_handler(self, data):
            print(data)


    if __name__ == "__main__":
        with suppress(KeyboardInterrupt) as _err:
            asyncio.run(EventListener().start())
```



## License
[MIT](https://choosealicense.com/licenses/mit/)