semvec/pypi-packages huggingface dataset:
flask-hintful 0.0.7
Flask extension for generating restful apis using type hints to automatically (de)serialize parameters and generate openapi docs.
License: MIT

[![Build Status](https://travis-ci.org/GabrielCappelli/flask-hintful.svg?branch=master)](https://travis-ci.org/GabrielCappelli/flask-hintful)
[![codecov](https://codecov.io/gh/GabrielCappelli/flask-hintful/branch/master/graph/badge.svg)](https://codecov.io/gh/GabrielCappelli/flask-hintful)
[![Documentation Status](https://readthedocs.org/projects/flask-hintful/badge/?version=latest)](https://flask-hintful.readthedocs.io/en/latest/?badge=latest)
# Flask-Hintful
Flask-Hintful helps you write Restful APIs using Flask by taking advantage of Python's type hints.

Includes support for serializing/deserializing parameters according to type hints and automatically generating OpenApi documentation for your registered routes.

## Requirements

* Python 3.7+
* Flask
* Marshmallow < 3

## Installation

Install using pip

```pip install flask-hintful```

## Quick Start

Construct a FlaskHintful object by passing the Flask application as a parameter, then use the FlaskHintful object `@route` and `.register_blueprint` to register routes.

Create your view functions with type hints and FlaskHintful will serialize pass path args, query args and even the request body for you.

```python
from dataclasses import dataclass
from datetime import date, datetime

from flask import Flask

from flask_hintful import FlaskHintful

app = Flask('My API')
api = FlaskHintful(app)


@dataclass
class NestedModel():
    str_field: str


@dataclass
class DataclassModel():
    str_field: str
    int_field: int
    float_field: float
    boolean_field: bool
    list_field: list
    date_field: date
    datetime_field: datetime
    nested_field: NestedModel


@api.route('/<id>/dataclass_test', methods=['POST'])
def dataclass_route(id: str, query_arg: int, model: DataclassModel) -> DataclassModel:
    '''my dataclass route'''
    return model


app.run()
```

You will be able to access the generated OpenApi on `/swagger`.

![Preview1](./docs/images/sample_openapi.png)

## Documentation

https://flask-hintful.readthedocs.io/

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
rktools 0.0.1
The Régis Kla Python tools library
License: MIT

# rktools

A general purpose Python library.

[![Build Status][travis-image]][travis-url]
[![Downloads Stats][npm-downloads]][npm-url]

*rktools* is a general purpose Python Library. It is originally designed after the needs of several small tools during Python projects development.

## Introduction

The library is organized around dedicated modules for monitoring processes, for loggings events, and so forth:

- *loggers:*  A simple Python *logging* wrapper that provide additional features such as http server logging handler management...
- *monitors:* A set of monitoring tools to provide visibility to the end user. For instance, it provide *ProgressBar* which is a *tqdm* wrapper, and so forth 

## Install

*rktools* is currently supported only for Linux systems. However, since it is written with pure Python, it should run without any problem on all platforms. 

### Using pip

The easiest way to install *rktools* is using *pip* to fetch it from [Pypi](https://pypi.org/project/rktools/) as follows:

~~~bash
$ pip install rktools 
~~~

## Using rktools

The modules usage is as follows.

### Loggers

Import the *init_logger* function from the *rktools.loggers* module:

~~~python
from rktools.loggers import init_logger
~~~

Declare and initialize a *logger* global (or local variable) : 

~~~python
...
logger = init_logger(name="test_monitors", config = config)
...
~~~

The returned *logger* object is an instance of Python *logging.Logger*  class.
Also notice that the Python *logging* package can be required if you want to override the logging level: 

~~~python
import logging
...
logger = init_logger(name="test_monitors", config = config, level = logging.getLevelName("DEBUG"))
...
~~~

Use the *logger* object the same way you use the Python  *logging.Logger*  object:

~~~python
...
logger.debug("A debug message!")
logger.info("A info message!")
logger.warning("A warn message!")
logger.error("A error message!")
logger.critical("A critical message!")
...
~~~

Find more details in the reference documentation [here](#).

### Monitoring

Import the *ProgressBar* class from the *monitors* module:

~~~python
from rktools.monitors import ProgressBar
~~~


## Changes

* 0.0.1
    * Lib creation. Work in progress




## Feedback

Open a ticket / fork the project on [GitHub](#), or send me an email at klaregis@gmail.com.