semvec/pypi-packages huggingface dataset:
fastapi-redis 0.1.11
Fastapi Redis client with decorator for controllers
License: MIT
Keywords: fastapi,redis,cache

# Fastapi Redis

This package provides a client that integrates with Fastapi and provides a decorator to cache fastapi controllers responses.

## Installation

`$ pip install fastapi_redis`

## Usage

### Client

#### Setting the data

```python
import redis_client from fastapi_redis

redis_client.set('some_key', 'some_data')
```

Models can be saved as well and the client will serialize them to json:

```python
import redis_client from fastapi_redis
from pydantic.main import BaseModel

MyModel(BaseModel):
    data: str

redis_client.set('some_key', MyModel(data='some_data'))
redis_client.set('some_key', MyModel(data='some_data_that_expires'), expiration=timedelta(days=1))
```

The data can be saved using the [Fastapi Background Tasks](https://fastapi.tiangolo.com/tutorial/background-tasks/) so it wouldn't generate any delay on the response to the user:

```python
import redis_client from fastapi_redis

@router.get('/')
async def my_controller_method(background_tasks: BackgroundTasks):
    redis_client.set_in_background(background_tasks, 'some_key', 'some_data')
    redis_client.set_in_background(background_tasks, 'some_key', MyModel(data='some_data_that_expires'), expiration=timedelta(days=1))
```

#### Getting the data

```python
import redis_client from fastapi_redis

some_data = redis_client.get('some_key')
```

### @redis_cache decorator

The `@redis_cache` decorator can be used to cache the response from a controller. Any argument of the controller can be used to specify the key of the data to store and if `background_tasks: BackgroundTasks` is defined as an argument it will store the data in the background as well:

```python
import redis_client from fastapi_redis


@router.get('/resource/{id}')
@router_cache('resource_{id}_{user.id}', timedelta(days=1))
async def my_controller_method(id: str,
                               user: User = Depends(get_current_user)
                               background_tasks: BackgroundTasks):
    return some_data_that_will_be_cached
```
minos-apigateway 0.4.0
Python Package containing the main API Gateway implementation used in Minos Microservices.
License: MIT
Requires Python: >=3.9,<4.0
Keywords: clariteia,minos,microservice,api_gateway

# API Gateway

[![codecov](https://codecov.io/gh/Clariteia/api_gateway/branch/main/graph/badge.svg)](https://codecov.io/gh/Clariteia/api_gateway)
![Tests](https://github.com/Clariteia/api_gateway/actions/workflows/python-tests.yml/badge.svg)

Minos is a framework which helps you create [reactive](https://www.reactivemanifesto.org/) microservices in Python.
Internally, it leverages Event Sourcing, CQRS and a message driven architecture to fulfil the commitments of an
asynchronous environment.

## Documentation

The official documentation as well as the API you can find it under https://clariteia.github.io/api_gateway/. 
Please, submit any issue regarding documentation as well!

## Set up a development environment

Minos uses `poetry` as its default package manager. Please refer to the
[Poetry installation guide](https://python-poetry.org/docs/#installation) for instructions on how to install it.

Now you con install all the dependencies by running
```bash
make install
```

In order to make the pre-commits checks available to git, run
```bash
pre-commit install
```

Make yourself sure you are able to run the tests. Refer to the appropriate section in this guide.

## Run the tests

In order to run the tests, please make sure you have the [Docker Engine](https://docs.docker.com/engine/install/)
and [Docker Compose](https://docs.docker.com/compose/install/) installed.

Move into `tests/` directory

```bash
cd tests/
```
Run service dependencies:

```bash
docker-compose up -d
```

Install library dependencies:

```bash
make install
```

Run tests:

```bash
make test
```

## How to contribute

Minos being an open-source project, we are looking forward to having your contributions. No matter whether it is a pull
request with new features, or the creation of an issue related to a bug you have found.

Please consider these guidelines before you submit any modification.

### Create an issue

1. If you happen to find a bug, please file a new issue filling the 'Bug report' template.
2. Set the appropriate labels, so we can categorise it easily.
3. Wait for any core developer's feedback on it.

### Submit a Pull Request

1. Create an issue following the previous steps.
2. Fork the project.
3. Push your changes to a local branch.
4. Run the tests!
5. Submit a pull request from your fork's branch.

## Credits

This package was created with ![Cookiecutter](https://github.com/audreyr/cookiecutter) and the ![Minos Package](https://github.com/Clariteia/minos-pypackage) project template.
type-heed 0.1.0
Auto-remove mypy type: ignore comments from Python source files.
License: MIT
Requires Python: >=3.8
Keywords: mypy,type checking,code health,auto-fixer,pre-commit hook

# Type Heed

[![Tests](https://github.com/janosh/type-heed/actions/workflows/test.yml/badge.svg)](https://github.com/janosh/type-heed/actions/workflows/test.yml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/janosh/type-heed/main.svg)](https://results.pre-commit.ci/latest/github/janosh/type-heed/main)
[![Requires Python 3.8+](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://python.org/downloads)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)

Python code formatter (and [`pre-commit`](https://pre-commit.com) hook) for auto-removing [`mypy`](https://github.com/python/mypy) `#type: ignore` comments from lines that no longer cause type errors.

## Installation

```sh
pip install type-heed
```

## Usage

### CLI

```sh
type-heed path/to/file.py
# or
type-heed **/*.py
```

### As `pre-commit` hook

Add this to your `.pre-commit-config.yaml`:

```yml
repos
  - repo: https://github.com/janosh/type-heed
    rev: v0.1.0
    hooks:
      - id: type-heed
```