semvec/pypi-packages huggingface dataset:
fastapi-forward 0.0.1
FastAPI request forwarding middleware
License: MIT
Requires Python: ==3.10.*

# FastAPI Forward

FastAPI Forward is a middleware that enables request forwarding/proxying in FastAPI applications. It allows you to easily forward specific routes to different target URLs while maintaining the original request context.

## Features

- Simple decorator-based route forwarding
- Preserves request headers and body
- Supports conditional forwarding
- Easy integration with FastAPI applications

## Installation

```bash
pip install fastapi-forward
```

## Quick Start

Here's a simple example that forwards requests from your FastAPI application to another service:

```python
from fastapi import FastAPI
from fastapi_forward import forward, init_app

app = FastAPI()
init_app(app)

@app.get("/")
@forward("https://api.example.com")
async def root():
    return {"message": "This response will be replaced by the forwarded response"}
```

In this example, any GET request to "/" will be forwarded to "https://api.example.com/".

## Usage

### Basic Forwarding

The most basic usage is to forward a route to another URL:

```python
@app.get("/users")
@forward("https://api.example.com")
async def get_users():
    pass
```

All requests to "/users" will be forwarded to "https://api.example.com/users".

### Initialization

Make sure to initialize the middleware before using the forward decorator:

```python
from fastapi import FastAPI
from fastapi_forward import init_app

app = FastAPI()
init_app(app)
```

### Request Handling

The middleware:
- Preserves request headers
- Forwards request body
- Maintains HTTP methods
- Returns the response from the target URL

## Requirements

- Python 3.10
- FastAPI
- httpx >= 0.28.0

## Development

To set up the development environment:

```bash
# Install PDM if you haven't already
pip install pdm

# Install dependencies
pdm install

# Run tests
pdm run pytest
```

## License

This project is licensed under the MIT License.
ansys-api-dyna 0.4.2
Autogenerated python gRPC interface package for ansys-api-dyna, built on 07:27:35 on 29 November 2024
License: MIT
Requires Python: >=3.7

### ansys-api-dyna gRPC Interface Package

This Python package contains the auto-generated gRPC Python interface files for
dyna.


#### Installation

Provided that these wheels have been published to public PyPI, they can be
installed with:

```
pip install ansys-api-dyna
```

Otherwise, see the


#### Build

To build the gRPC packages, run:

```
pip install build
python -m build
```

This will create both the source distribution containing just the protofiles
along with the wheel containing the protofiles and build Python interface
files.

Note that the interface files are identical regardless of the version of Python
used to generate them, but the last pre-built wheel for ``grpcio~=1.17`` was
Python 3.7, so to improve your build time, use Python 3.7 when building the
wheel.


#### Manual Deployment

After building the packages, manually deploy them with:

```
pip install twine
twine upload dist/*
```

Note that this is automatically done through CI/CD.


#### Automatic Deployment

This repository contains GitHub CI/CD that enables the automatic building of
source and wheel packages for these gRPC Python interface files. By default,
these are built on PRs, the main branch, and on tags when pushing. Artifacts
are uploaded for each PR.

To publicly release wheels to PyPI, ensure your branch is up-to-date and then
push tags. For example, for the version ``v0.5.0``.

```bash
git tag v0.5.0
git push --tags
```