semvec/pypi-packages huggingface dataset:
httpx_ratelimiter 0.0.6
Ratelimiting for httpx
Requires Python: >3.9
Keywords: httpx, rate-limiting, leaky-bucket

# httpx-ratelimit
[![PyPI version](https://badge.fury.io/py/httpx_ratelimiter.svg)](https://badge.fury.io/py/httpx_ratelimiter)


Simple wrapper around
[PyrateLimiter](https://pyratelimiter.readthedocs.io/en/latest/)
that adds integration with
[httpx](https://www.python-httpx.org/) library

### Usage
##### Using per_* kwargs:
```py
from time import time

from httpx import Client

from httpx_ratelimiter import LimiterTransport

# Apply a rate limit of 5 requests per second to all requests
# if wait time between request will be more than 600ms, raise an BucketFullException
with Client(transport=LimiterTransport(per_second=5, max_delay=600)) as c:
    start = time()
    for _i in range(100):
        print(
            f'[t + {time() - start: .2f}] got response: {c.get("https://httpbin.org/status/200,429")}'
        )
```
##### Using custom list of rates
```py
from time import time

from httpx import Client

from httpx_ratelimiter import LimiterTransport
from pyrate_limiter import Limiter, Rate, Duration

# limit 5 requests over 2 seconds and 10 requests over 1 minute
rates = [Rate(5, Duration.SECOND * 2), Rate(10, Duration.MINUTE)]
# if wait time between request will be more than 600ms, silently fail
with Client(transport=LimiterTransport(rates=rates, max_delay=600, raise_when_fail=False)) as c:
    start = time()
    for _i in range(100):
        print(
            f'[t + {time() - start: .2f}] got response: {c.get("https://httpbin.org/status/200,429")}'
        )
```


### Thanks
Thank to original [Requests-ratelimiter](https://github.com/JWCook/requests-ratelimiter/tree/main) author for idea and backbone of a project.
pdlogger 0.0.3
An example package
Requires Python: >=3.6

# pdlogger

pdlogger is a python based logger that let's you push your logging.info() calls to an AMQP queue.

## Installation
pdlogger is available on pypi. Just do:

```sh
pip install pdlogger
```

## Usage

### Client application 
Once you have installed pdlogger, setup the logger in the initial steps of your application by doing:

```python
import logging
from pdlogger.Logging import AMQPLoggingHandler
from pdlogger.Logging import AMQPLogger
from pdlogger.Logging import EnvVarChecker


logging.setLoggerClass(AMQPLogger)
logger = logging.getLogger("pdlogs")
logger.setLevel(logging.INFO)
handler = AMQPLoggingHandler()
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
```

Then, in all other modules of your application, just do

```python
import logging
logger = logging.getLogger('pdlogs')
logger.info(<your data here>)
```

You can either set AMQP_URL, QUEUE_NAME in the environment variables, or they can be passed to the AMQPLoggingHandler like:

```python
AMQPLoggingHandler(amqp_url, queue_name, msg_priority)
```

logger.info takes the following arguments:

- msg: Logs that you want to push. Anything that is JSON serializable goes.
- project_id (Optional): Project ID. Can be left None. E.g. hf38fgf883fg3bs3
- test_image_id (Optional): Test Image ID. Can be left None. E.g. 73184492
- application_name (Optional): Application Name. Can be left None. E.g. all-in-1
- checkpoint_name: Arbitrary string to keep track of where the log is coming from. E.g. opensetThreshApplied, otherRemoved.

### Producer

You need atleast 1 consumer running to consume the logs.
To run a consumer application, just run:

```python
from pdlogger.Logging import AMQPConsumer
consumer = AMQPConsumer()
consumer.start_consuming()
```

You can either set AMQP_URL, QUEUE_NAME, SQL_HOST, SQL_USER, SQL_PASSWORD, SQL_DATABASE in the environment variables, or they can be passed to the AMQPConsumer like:


```python
AMQPConsumer(amqp_url, queue_name, sql_host, sql_user, sql_password, sql_database)
```
dockerr 0.2.1
A simple python package to manage external testing of docker containers
Requires Python: >=3.10
Keywords: docker, testing, containers, pytest


[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/) [![linting: pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/pylint-dev/pylint) [![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)

[![PyPI - Version](https://img.shields.io/pypi/v/dockerr.svg?logo=pypi&label=PyPI&logoColor=gold)](https://pypi.org/project/dockerr/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/dockerr.svg?logo=python&label=Python&logoColor=gold)](https://pypi.org/project/dockerr/) [![Coverage Status](https://coveralls.io/repos/github/Tranquility2/dockerr/badge.svg?branch=master)](https://coveralls.io/github/Tranquility2/dockerrr?branch=master)

# dockerr

> [!IMPORTANT]
> Happy to update that I got this framework cabablities merged into [testcontainers-python](https://github.com/testcontainers/testcontainers-python)
> (Checkout the [PR](https://github.com/testcontainers/testcontainers-python/pull/585))  
> This Repo will hopefully (oneday) be reporposed into something new 😃

## Description

This is a python framwork for running docker containers in order to test them.
Fox example: you can run a container, test something while its still running and the framework will take care of cleaning up afterwards.
It's designed to be simple and easy to use.

## Installation

```bash
pip install dockerr
```

## Usage

```python
from dockerr.runner import DockerRunner

with DockerRunner(tag, name, ports, path, dockerfile=DOCKER_FILE):
    # Do something
```

## Status
~~This is an early version of the framework and it's still under development.~~

**Deprecated** - please see note above

## Examples
Please checkout the samples folder for more examples.
csr 0.5.2
Compressed Sparse Row matrices for Python, with Numba API.
Requires Python: >=3.8

# CSR Matrices for Python

[![codecov](https://codecov.io/gh/lenskit/csr/branch/main/graph/badge.svg?token=6UQ4O8FCKK)](https://codecov.io/gh/lenskit/csr)

This package provides an implementation of sparse matrices in compressed sparse
row format for Python. Routines are implemented with Numba, and both the CSR
data structure and most related matrix and vector operations can be used from
Numba's nopython mode.

Right now the feature set is very limited --- don't expect this to be a drop-in
replacement for SciPy's sparse matrices.  Some features we expect to develop as
people take an interest in the package and contribute updates, but we also hope
to keep a relatively tight scope.  This package aims to provide efficient support
for compressed sparse row matrices, with some routines that can also treat them
as CSC matrices.
gscp 1.0.10
A tool to quickly commit your work with git.
Requires Python: <4.0,>=3.8

# gscp: *G*it, *S*tage all, *C*ommit, *P*ush

I often find myself writing a bunch of code and wanting to commit it all, in one singular command. It's not
very hard:

```commandline
$ git add -u
$ git commit -v
$ git push
```

However, this is two commands two long. This should be in a singular command! This is why I once
had a `gscp` script in `$PATH` that did pretty much that. However, I wanted to add features over time:

- The ability to specify a commit message (sometimes)
- The ability to force push
- The ability to create amend commits
- And maybe more

It would have been easy enough to have those features in my shell script, but parsing
the flags in shell seemed harder than it needs to be. Therefore, I created a python package.
Yay python!

## Installation

```shell
> pip install gscp
```

## Requirements

This is a rather simple script. It requires python 3.7 or higher. Because it uses git, you
obviously need to have git in path. It relies on the `pty` module. If the `pty` module is
limited in some OSes, those limits apply here. All the other requirements are in `pyproject.toml`.

## Building / Running

This project is built with poetry.


## Usage:

```commandline
usage: gscp [-h] [-a] [-f] [message]

positional arguments:
  message      Commit message to use. If no message specified, it falls back to git's default behaviour with verbose mode

options:
  -h, --help   show this help message and exit
  -a, --amend  If we using git amend mode (warning, this triggers a force push)
  -f, --force  If we use `git push --force`
```

## Disclaimer

Use at your own risk. This can force push stuff, after all.
fastboot-log-parser 0.1.1
A parser for Fastboot logs
Requires Python: >=3.6

# Fastboot Log Parser

Fastboot Log Parser is a Python module designed to parse logs from stdout during Fastboot flash image process. It converts the status into events and outputs the current status in JSON format.

## Usage

To use the Fastboot Log Parser module in your Python project, follow these steps:

1. Install the module using pip:
   ```bash
   $ pip install fastboot-log-parser

2. Import the parser module and initialize in your Python code:
   ```python
   from fastboot_log_parser import FlashLogParser

   # Initialize the parser
   parser = FlashLogParser

3. Parse the log and get result as json
   # Parse log
   parser.parse_log(self.logger)

   # Output the parsed log as json event
   print(self.parser.get_event_as_json())

   # Output the parsed history as json list
   print(self.parser.get_event_history_as_json())