semvec/pypi-packages huggingface dataset:
fastapi-router 0.0.5
Fastapi like Next.js. Efficient Backend, Agile Development.
Requires Python: >=3.11,<4.0

# FastAPI-Router

*Efficient Backend, Agile Development.*

installation from Test PyPI
```shell

pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.python.org/simple/ fastapi-router

```

FastAPI-Router is a plugin for applications built with `FastAPI` that enables the development of backend applications with a workflow similar to Next.js. This means you can create efficient and modern backend applications with FastAPI-Router, taking advantage of its capabilities in a manner akin to the workflow in Next.js.

Example:

```python
from fastapi import FastAPI
from fastapi_router import init_main_route

# Init FastAPI application
app = FastAPI()

# Init fastapi-route
init_main_route(app)

```

## API Folder organization

In the FastAPI-Router library, the organization of files within the directory mirrors the route structure, akin to the approach in `Next.js`.

Each nested folder signifies a route segment, aligning with a corresponding segment in the URL path.

However, the definition of a route doesn't become publicly accessible until a route.py file is added to the respective route segment. This file, acting as the handler, determines the behavior and functionality associated with the specific endpoint. FastAPI-Router leverages this file structure to seamlessly generate and map routes, providing an intuitive and efficient way to structure and manage API endpoints.

![API Folder Structure](docs/pics/image.png)

### route.py

A route file enables the creation of customized request handlers for a specified route. It supports the following HTTP methods: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, `TRACE` and `OPTIONS`.

```python

def GET(): ...

def POST(): ...

def PUT(): ...

def PATH(): ...

def DELETE(): ...

def HEAD(): ...

def TRACE(): ...

def OPTIONS(): ...

```

By default, fastapi-router expects a folder named `'api'` to exist. In case you need to change the name or have a project where you want to implement fastapi-router without that specific name, you can modify this by passing `pathDir` as an argument to the `init_main_route` function.

Example:

```python

# For root folder
init_main_route(app, pathDir='app')

init_main_route(app2, pathDir='app/routes')

```

If the name `'route'` doesn't suit you and you want to change it to another name to define the methods of the routes, you can pass `nameRouteFile` as an argument to the `init_main_route` function.

Example:

```python

# Changing the route file name
init_main_route(app, nameRouteFile='methods')

```
qmicroscope 0.0.5
A camera widget for qt GUIs using qtpy
Requires Python: >=3.8

Early stage Qt widget for monitoring cameras at NSLS-II
=======================================================

This is a simple Qt-based widget for monitoring a camera on the network, and
performing some overdrawing of the images. It is still subject to change.

It depends upon qtpy which needs PySide2 or PyQt5 in order to show anything.

This currently expects a network endpoint that offers a single JPEG file, which
it will use to download from periodically. Things like the FFMPEG plugin for the
area detector and the AXIS webcams support this. Likely soon I will add support
for the MJPEG stream that is offered by some of the cameras for more efficient
data streaming from the cameras.

Expected camera urls/endpoints:
- Endpoints that offer single JPEG files that are downloaded periodically based on frame rate
- MJPEG stream (URL must end with `mjpg` or `cgi`)

## Installation and usage
As of v0.0.2 the widget is not pip installable. 

To use clone the repo and run either of the 2 apps developed that use the widget
`python main.py` - Shows a grid of camera feeds 
`python monitor.py` - Shows a grid of camera feeds as thumnails which can be clicked to shown on the "main" camera feed. Sort of like a [Master Control](https://en.wikipedia.org/wiki/Master_control) in TV stations

## Plugins API
A number of plugins have been developed to allow each instance of the QMicroscope camera to have it's own set of features as defined by the application. Plugins defined for the two implemented apps are as follows:

### main.py
- Record plugin (alpha testing)
    - Allows user to record video feed into MJPG format

### monitor.py
#### Main camera feed
- Crosshair plugin
    - Draws a crosshair with a specific color and position
    - Option available to always center the crosshair regardless of size of image
- Grid plugin
    - Draws a grid with specified number of rows and columns
    - Options to change color, hide or show grid and selector
- Scale plugin
    - Draws a scale in the x-y direction
    - Options to change color, location, text shown on each axis and toggle visibility
- Crop plugin
    - Crop the video feed to a specific area
- Preset plugin
    - Allows settings of other plugins to be named and saved
    - Settings can be restored at any point

#### Thumbnail camera feed
- Toggle plugin
    - Adds a checkbox to the camera feed that will pause or resume the video feed

## Plugin API
Instructions to write your own plugin, coming soon (checkout the plugins folder)