semvec/pypi-packages huggingface dataset:
pymiddy 0.1.0
Middleware engine for AWS Lambda - Inspired by middyjs
License: MIT

## PyMiddy

Heavily inspired from middyjs.

### Quick start

```python
from pymiddy import Middy
from pymiddy.middlewares import CORS

@Middy
def handler(event, context):
    return {
        'statusCode': 200,
        'body': 'lorem ipsum dolor sit amet'
    }


handler.use(TestMiddleware(1)) \
    .use(CORS({
        'credentials': True,
        'origins': ['https://website.xyz/']
    }))
```

### Custom middlewares

A middleware class should have 3 methods:

```python
class MyCustomMiddleware(object):
    def before(self, state):
        pass

    def after(self, state):
        pass

    def error(self, state):
        pass
```

The `state` contains the following keys:
- `event` - the event which triggered the lambda function, passed from the aws handler
- `context` - the context from the aws handler
- `response` - the handler response, if any
- `exception` - during error handler you can have access to this key which contains the exception which triggered the error
sqlfs 0.1.0
SQLite FUSE filesystem
License: MIT

SQLite FUSE filesystem
======

Stores files and directories in the tables inside the SQLite database:
 - by default, maximum file size is 16 MB and number of inodes is 2^16,
 - can create in-memory filesystem without using RAM disk,
 - "df -h" should be used to estimate the amount of occupied/free inodes only, as reported size is greater than actual.


Usage: 
```
sqlfs [-h] [--block-size B] [--max-filesize F] [--max-inodes I]
                [--use-cache C] [--cache-size N] [--log-file L]
                [--debug | --verbose | --quiet | --silent]
                path mount
```

positional arguments: 
  - **path**              Path to the SQLite v3 database with the filesystem, or
                    'memory' for the in-memory filesystem 
  - **mount**             Mount point directory

optional arguments:
  - *-h, --help*     show this help message and exit
  - *--debug, -d*     Enable debug logging (default: False)
  - *--verbose, -v*     Enable verbose logging (default: False)
  - *--quiet, -q*     Normal logging (default: True)
  - *--silent, -s*     No logging (default: False)

SQLFS settings:
  - *--block-size B*    Filesystem block size, in bytes (default: 512)
  - *--max-filesize F*  Maximum file size, in bytes (default: 16777216)
  - *--max-inodes I*    Maximum number of inodes (default: 65536)
  - *--use-cache C*     Use in-memory cache, 'Y' (yes) or 'N' (no) (default: Y)
  - *--cache-size N*    If above is set to Y, cache size (default: 8192)
  - *--log-file L*      Log file (default: sqlfs.log)

Run "fusermount -u mount" to unmount.
falcon-openapi 0.5.1
Falcon router to map openapi spec to resources
License: MIT
Requires Python: >3.5.0
Keywords: falcon,openapi,api

# Falcon OpenApi

Falcon OpenApi is a plugin for the [Falcon Web Framework](https://github.com/falconry/falcon).

### Install

```bash
pip3 install falcon-openapi
```

## OpenApi Router

Reads an openapi spec and provides automatic routing to Falcon resources. This is achieved by defining either an operationId or x-falcon property on an endpoint. This removes the need to define all endpoints in your main Falcon file. Instead just set the router to OpenApiRouter.

This router inherits from the default Falcon CompiledRouter class, so it supports all methods available to the default router.

Supports json files, yaml files, raw json strings, and raw yaml strings. If no params are specified the plugin will attempt to find `openapi-spec.yml` or `openapi-spec.yaml` in the current working directory (see example for structure).

```python
import falcon
import json
import yaml
from falcon_openapi import OpenApiRouter

spec = {
    'paths': {
        '/foo': {
            'get': {
                'operationId': 'controllers.foo.Foo.on_get'
            }
        }
    }
}

# load from file
app = falcon.API(
    router=OpenApiRouter(file_path='openapi-spec.yml')
)

# load from raw json
app = falcon.API(
    router=OpenApiRouter(raw_json=json.dumps(spec))
)

# load from raw yaml
app = falcon.API(
    router=OpenApiRouter(raw_yaml=yaml.dump(spec))
)
```

### operationId

The example below will route all `GET` `/foo` requests to `controllers.foo.Foo.on_get`. Where `controllers.foo` is the module name, `Foo` is the class name, and `on_get` is the method name. Every operationId in your spec should be unique (See [openapi operationId](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#operationObject)). All three parts of the operationId must be specified for the router to work.

```yaml
openapi: "3.0.0"
info:
  version: 1.0.0
  title: Falcon Openapi Demo
paths:
  /foo:
    get:
      summary: Do foo things
      operationId: controllers.foo.Foo.on_get
```

I am unsure if operationId will make it into the final version. I may change this to only check for the x-falcon property. I plan on doing more research to determine if this an appropriate way to use the [operationId property](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#operationObject).

### x-falcon

The example below will route all `POST` `/foo` requests to the module `controllers.foo`, the class `Foo`, and the method `on_post`. Note: the standard in Falcon is to use the naming scheme on_get, on_post, etc. If no method name is defined in x-falcon, the plugin will attempt to route to the appropriate on_* method.

```yaml
openapi: "3.0.0"
info:
  version: 1.0.0
  title: Falcon Openapi Demo
paths:
  /foo:
    post:
      summary: Do foo things
      x-falcon:
        module: controllers.foo
        class: Foo
        method: on_post
```