semvec/pypi-packages huggingface dataset:
h2client 0.2.3
A connection-aware, cache-control respecting http/2 over tls client

# H2Client

This library is intended to provide improved control when writing an http/2
client without adding a significant amount of boilerplate. In particular this
allows for easy connection management, since when an http/2 connection is opened
and closed will have a very significant impact on performance, and respects
Cache-Control headers (request and response) using `diskcached`, since
respecting these headers is often an insane performance improvement as it will
prevent a large number of requests from requiring any network calls at all.

This does not support ETag style validation as it doesn't tend to result in any
significant improvements on REST api's where even the largest responses are
measured in kilobytes since ETags do not prevent network calls.

## Getting Started

```bash
python -m venv venv
. venv/bin/activate  # for windows, "venv/Scripts/activate.bat"
python -m pip install --upgrade pip
pip install h2client
```

```py
"""Make some requests using the postman-echo service run by
https://www.postman.com/. h2client is not in any way affiliated with or
endorsed by Postman.
"""
import asyncio
from h2client.session import Session
import json


USER_AGENT = 'H2ClientExamples/1 by /u/Tjstretchalot (+https://github.com/tjstretchalot/h2client)'


async def main():
    client = Session(
        'postman-echo.com',
        default_headers={
            'user-agent': USER_AGENT,
            'accept': 'application/json'
        }
    )

    async with client.conn() as conn:
        responses = await asyncio.gather(
            conn.get('/get', params={'foo1': 'bar1'}),
            conn.post('/post', json={'payload': 'asdf'}),
            conn.delete('/delete', data=b'look some data!', headers={
                'content-type': 'text/plain'
            })
        )

    for response in responses:
        print(f'{response.method} {response.path} - {response.status_code} {response.status_text}')
        print('Request Headers:')
        for key, val in response.request_headers.items():
            print(f'  {key}: {val}')

        print('Headers:')
        for key, val in response.headers.items():
            print(f'  {key}: {val}')

        print()
        print('Body (interpreted):')
        print(json.dumps(response.json(), indent=2, sort_keys=True))


if __name__ == '__main__':
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    loop.run_until_complete(main())

    # Wait for the `ensure_future`s to finish cleanly
    pending = asyncio.all_tasks(loop)
    while pending:
        loop.run_until_complete(asyncio.wait(pending, return_when=asyncio.ALL_COMPLETED))
        pending = asyncio.all_tasks(loop)
```
pydantic-django-utils 0.0.1
Utils to help integrate pydantic into Django projects
Requires Python: >=3.6

Pydanic Django Utils
====================

Some utils for working with `Django <https://www.djangoproject.com/>`_ and
`Pydantic <https://pydantic-docs.helpmanual.io/>`_ (and `Django REST Framework
<https://www.django-rest-framework.org/>`_).

More info in `the docs
<https://matthewhughes.gitlab.io/pydantic-django-utils/index.html>`_
PandaTex 1.0.0
PandaTex is a package to transform Pandas data tables into .tex files

# PandaTex

## What is PandaTex?

PandaTex is a package to transform Pandas data tables into .tex files

## Getting started

### Install the package
To install the package you can use the Pypi using the command 

```
pip install PandaTex
```

### Example

Input
```
import pandatex as pdtex
import pandas as pd

df = pd.DataFrame({
    'Discipline':['Math','Portuguese','Math','Portuguese','Math','Portuguese'],
    'Class':['A','A','B','B','C','C'],
    'Average Grade':[9.0,6.0,7.3,6.0,9.3,7.5]})
    
table = pdtex.TexTable(name="AvGrades",caption="Table with the data",label="Table",dataframe=df)

table.printtextable()
```

Output
```
\begin{table}[htb!]
\centering
\begin{small}
\caption{Table with the data}\label{Table}
\begin{tabular}{*{4}{|c}|}
\hline
  & Discipline & Class & Average Grade \\ \hline
0 & Math & A & 9.0 \\ \hline
1 & Portuguese & A & 6.0 \\ \hline
2 & Math & B & 7.3 \\ \hline
3 & Portuguese & B & 6.0 \\ \hline
4 & Math & C & 9.3 \\ \hline
5 & Portuguese & C & 7.5 \\ \hline
\end{tabular}
\end{small}\end{table}
```
If you want to generate a .tex file with the dataframe from the example above you can use the method "writetextable"

```
table.filename = 'myDocs'
table.writetextable()
```
---
## TexTable
### Constructor

**TexTable**(name= "", filename="Default",label = " ", caption = " ", dataframe = None)

## Functions
**TexTable.printtextable(\*\*kwargs):**
This function can be used to print the result of the pandas table in latex format

**TexTable.writetextable(\*\*kwargs):**
This function can be used to write a .tex file with the result of the pandas table in latex format

When printing or writing tables you can use some included arguments to format the table

## **kwargs

* **coltype** (default:"grid" or ["indexed","nogrid"])
This argument controls.

<!--* **overfill** (default:"scale" or ["newtable","encode"]) This argument controls how should the table deal with extra wide tables
    * scale - scale the table down to fit the content
    * newtable - create a new table to fit the remaining content
    * encode - create a list that encodes each column -->
* **align** (default:"c" or ["l", "r"]) This argument controls the alignment of the data.
    * c - align center
    * l - align left
    * r - align right
* **indexed** (dtype: boolean, default:True) This argument can be deactivated if the table does not contain indexes.
* **hlines** (dtype: boolean, default:True) This argument can be deactivated if you want to remove the horizontal lines from the table.
Bilu 0.0.3
Asynchronous ODM (Object Document Mapper) for MongoDB
Requires Python: >=3.6

# bilu

Asynchronous ODM (Object Document Mapper) for MongoDB

### Requirements

**Python**: 3.6 and later (tested against 3.6, 3.7, 3.8 and 3.9)

**MongoDB**: 4.0 and later

**pydantic**: 1.8.2 and later

Two direct dependencies:

- <a href="https://pydantic-docs.helpmanual.io/" target="_blank">pydantic</a>: makes
  data validation and schema definition both handy and elegant.

- <a href="https://motor.readthedocs.io/en/stable/" target="_blank">motor</a>: an
  asyncio MongoDB driver officially developed by the MongoDB team.


### Installation

```shell
pip install Bilu
```

### Environments
```shell
export MONGODB_URI='mongodb://localhost:27017'
export MONGODB_USERNAME=''
export MONGODB_PASSWORD=''
export MONGODB_DATABASE='test'
export MONGODB_MIN_POOL_SIZE=0
export MONGODB_MAX_POOL_SIZE=100
```

### Example

**Connecting to mongodb**
```python
from bilu.database import db_manager
db_manager.connect()
```

**Define model**
```python
from bilu.model import BaseModel

class TesteModel(BaseModel):
    attr_str: str
    attr_int: int

    class Meta:
        name = 'testemodel'
```

**Creating a document**
```python
data = {
    'attr_str': 'bla',
    'attr_int': 123
}
model = TesteModel(**data)
await model.save()
```

**Listing documents**
```python
await model.documents.list(attr_int=123)
```

**Getting a document**
```python
item = await model.documents.get(attr_int=123)
```

**Removing a document**
```python
await item.delete()
```
callback-executor 0.0.2
A callback queue that execute each callback in a configured interval between calls.
Requires Python: >=3.9

# Request Sender

This module provides a `CallbackExecutor` class to receive and queue callbacks to 
be executed in a configured interval between calls. 

The time between calls can be greater than the configured interval, but not less.


## Use Case
If one needs to limit the rate of request to an API endpoint.

### Sample Code

```
import asyncio
from callback_executor import ExecutorQueue

async main():
    exec_queue = ExecutorQueue(call_interval=0.5)
    await exec_queue.ready()
    
    tasks = [
        exec_queue.enqueue_callback(blocking_request_to_api_1),
        exec_queue.enqueue_callback(blocking_request_to_api_2),
    ]
    
    responses = await asyncio.gather(*tasks)
    
    # Handle responses

if __name__ == "__main__":
    asyncio.run(main())
```