semvec/pypi-packages huggingface dataset:
aioitertools 0.13.0
itertools and builtins for AsyncIO and mixed iterables
Requires Python: >=3.9

aioitertools
============

Implementation of itertools, builtins, and more for AsyncIO and mixed-type iterables.

[![documentation](https://readthedocs.org/projects/aioitertools/badge/?version=latest)](https://aioitertools.omnilib.dev)
[![version](https://img.shields.io/pypi/v/aioitertools.svg)](https://pypi.org/project/aioitertools)
[![changelog](https://img.shields.io/badge/change-log-blue)](https://aioitertools.omnilib.dev/en/latest/changelog.html)
[![license](https://img.shields.io/pypi/l/aioitertools.svg)](https://github.com/omnilib/aioitertools/blob/main/LICENSE)


Install
-------

aioitertools requires Python 3.9 or newer.
You can install it from PyPI:

```sh
$ pip install aioitertools
```

Usage
-----

aioitertools shadows the standard library whenever possible to provide
asynchronous version of the modules and functions you already know.  It's
fully compatible with standard iterators and async iterators alike, giving
you one unified, familiar interface for interacting with iterable objects:

```python
from aioitertools import iter, next, map, zip

something = iter(...)
first_item = await next(something)

async for item in iter(something):
    ...


async def fetch(url):
    response = await aiohttp.request(...)
    return response.json

async for value in map(fetch, MANY_URLS):
    ...


async for a, b in zip(something, something_else):
    ...
```


aioitertools emulates the entire `itertools` module, offering the same
function signatures, but as async generators.  All functions support
standard iterables and async iterables alike, and can take functions or
coroutines:

```python
from aioitertools import chain, islice

async def generator1(...):
    yield ...

async def generator2(...):
    yield ...

async for value in chain(generator1(), generator2()):
    ...

async for value in islice(generator1(), 2, None, 2):
    ...
```


See [builtins.py][], [itertools.py][], and [more_itertools.py][] for full
documentation of functions and abilities.


License
-------

aioitertools is copyright [Amethyst Reese](https://noswap.com), and licensed under
the MIT license.  I am providing code in this repository to you under an open
source license.  This is my personal repository; the license you receive to
my code is from me and not from my employer. See the `LICENSE` file for details.


[builtins.py]: https://github.com/omnilib/aioitertools/blob/main/aioitertools/builtins.py
[itertools.py]: https://github.com/omnilib/aioitertools/blob/main/aioitertools/itertools.py
[more_itertools.py]: https://github.com/omnilib/aioitertools/blob/main/aioitertools/more_itertools.py
hqg-algorithms 0.1.0
Algorithmic trading research utilities for quant teams
Requires Python: >=3.8

# hqg-algorithms

Interfaces and helper types for writing HQG trading strategies.

## Install
```shell
python3 -m pip install --upgrade pip setuptools wheel
pip install hqg-algorithms
```

## Implement a strategy
Subclass `Strategy` and implement the three abstract methods the backtester calls.


Example:

```python
from datetime import timedelta
from hqg_algorithms import Strategy, Cadence, Slice, PortfolioView


class BuyAndRebalanceSpyIef(Strategy):
    def universe(self) -> list[str]:
        return ["SPY", "IEF"]

    def cadence(self) -> Cadence:
        return Cadence( 
            bar_size=timedelta(days=1), # default
            call_phase="on_bar_close", # default
            exec_lag_bars=1, # default
        )

    def on_data(self, data: Slice, portfolio: PortfolioView) -> dict[str, float] | None:
        # Rebalance daily
        return {"SPY": 0.6, "IEF": 0.4}
```

Key lifecycle methods:
- `universe()` tells the platform which symbols to load.
- `cadence()` specifies call frequency, trigger phase, and execution lag.
- `on_data(data, portfolio)` returns target portfolio weights, `{}` for all cash, or `None` to skip an update.

`Slice` exposes helper methods like `slice.close(symbol)` to inspect prices, while `PortfolioView` gives read-only access to current holdings and weights.

## Additional docs
- Publishing workflow and release checklist: `docs/publishing.md`
asgi-logging-middleware 0.2.0
ASGI middleware for logging HTTP requests and responses. Fork of asgi-logger.
Requires Python: >=3.10
Keywords: ASGI, logging, middleware

<h1 align="center">
    <strong>asgi-logging-middleware</strong>
</h1>

<p align="center">
    <a href="https://github.com/alv2017/asgi-logging-middleware" target="_blank">
        <!-- Last commit -->
        <img src="https://img.shields.io/github/last-commit/alv2017/asgi-logging-middleware" alt="Latest Commit">
        <!-- GitHub Actions tests status -->
        <img src="https://img.shields.io/github/actions/workflow/status/alv2017/asgi-logging-middleware/run_tests.yml?branch=main&label=tests" alt="Tests Status">
        <!-- Codecov coverage -->
        <img src="https://img.shields.io/codecov/c/github/alv2017/asgi-logging-middleware" alt="Code Coverage">
    </a>
    <br/>
    <a href="https://pypi.org/project/asgi-logging-middleware" target="_blank">
        <img src="https://img.shields.io/pypi/v/asgi-logging-middleware" alt="Package version">
    </a>
    <img src="https://img.shields.io/pypi/pyversions/asgi-logging-middleware" alt="Python Version">
    <img src="https://img.shields.io/github/license/alv2017/asgi-logging-middleware">
</p>

## Overview

This project was created as a fork of [asgi-logger](https://github.com/Kludex/asgi-logger) project. 

ASGI logging middleware logs HTTP request/response data in a configurable format, similar to how web servers 
like Nginx or Apache log requests. Initially it was created as an alternative for the uvicorn 
access logger.

Primarily the middleware is targeted at Starlette and FastAPI applications, but it can be used with any 
ASGI application.


## Installation

``` bash
pip install asgi-logging-middleware
```

## Usage

If you're using it with uvicorn, remember that you need to erase the handlers from uvicorn's logger that is writing the access logs.
To do that, just:

```python
logging.getLogger("uvicorn.access").handlers = []
```

Below you can see an example with FastAPI, but you can use it with any other ASGI application:

```python
from fastapi import FastAPI
from fastapi.middleware import Middleware
from asgi_logging_middleware import AccessLoggerMiddleware

app = FastAPI(middleware=[Middleware(AccessLoggerMiddleware)])


@app.get("/")
async def home():
    return "Hello world!"
```

In case you want to add a custom format to the access logs, you can do it using the `format` parameter on the `AccessLoggerMiddleware`:

```python
AccessLoggerMiddleware(app, format="%(s)s")
```

For now you can verify the possible format values [here](https://github.com/alv2017/asgi-logging-middleware/blob/main/asgi_logging_middleware/middleware.py).
The documentation will be available soon.

## License

This project is licensed under the terms of the MIT license.