semvec/pypi-packages huggingface dataset:
cuteshop 0.5.0
Package manager for Qt projects.
License: MIT
Keywords: cuteshop,qt

===============================
Cuteshop
===============================

.. image:: https://badge.fury.io/py/cuteshop.png
    :target: http://badge.fury.io/py/cuteshop

.. image:: https://travis-ci.org/uranusjr/cuteshop.png?branch=master
        :target: https://travis-ci.org/uranusjr/cuteshop

.. image:: https://pypip.in/d/cuteshop/badge.png
        :target: https://pypi.python.org/pypi/cuteshop


Package manager for Qt projects.

* Free software: MIT license
* Documentation: https://cuteshop.readthedocs.org.


What is Cuteshop?
=================

Short Version
-------------

It's like CocoaPods, but for Qt (qmake-based) projects, if you know what that
means.

Long Version
-------------

Cuteshop manages library dependencies for Qt (qmake-based) projects.

You describe your depedencies in a file called ``Shopfile``. Cuteshop analyzes
it, resolves all the library dependencies for you, and generate boilerplate
qmake configurations for you to use.




=======
History
=======

0.5.0 (2019-01-24)
---------------------

* Support for per-pattern prefix in public header configurations.
* Fix error on Windows when there are too many headers to copy.
* Fix error on Windows when re-creating directories.
* Add extra flags to make compilation log less verbose.


0.4.0 (2019-01-21)
---------------------

* Add syntax support to exclude files from a glob pattern.
* Improve directory creation to support nested include structure.
* Add support to load extra sources form environment variables.
* Add support to non-lib projects (i.e. header-only).
* Fix templating with spaces in path.
* Add QtCollections spec.
* Add LibXLSXWriter spec.


0.3.1 (2016-01-05)
---------------------

* Git download plan now raises an exception on error.
* Fix error caused by missing spec-source option.


0.3.0 (2016-01-04)
---------------------

* Add option for additional spec sources.
* Add support for OTHER_FILES.
* Minor wording fixes.


0.2.1 (2015-09-20)
---------------------

* Add support for RESOURCES.
* Add QtHandlebarsJS spec.


0.2.0 (2015-07-07)
---------------------

* Add specs for QtSignal and QtYAML.
* Fix implementation for usage on Windows.
* More spec parameters made available.
* More bug fixes.


0.1.0 (2014-12-16)
---------------------

* First release on PyPI.
flask-jsonschema-validator 0.0.4
Validate Flask JSON request data with schema files and route decorators
License: MIT
Keywords: flask jsonschema validator validation json schema

# Flask JSON Schema Validator

Validate Flask JSON request data with schema files and route decorators.


# Author

Daniel 'Vector' Kerr (<vector@vector.id.au>)


# License

Refer to [LICENSE.txt](LICENSE.txt).


# Installation

pip install flask-jsonschema-validator


# Sample Usage

## Python Code

`main.py`
```python
from flask import Flask, request, jsonify
from flask_jsonschema_validator import JSONSchemaValidator

app = Flask()
JSONSchemaValidator( app = app, root = "schemas" )

# Define a normal flask route, and then apply the `validate` decorator.
# Look for the `users.json` file, and use the `register` key as the schema source.
@app.route( '/register', methods = [ 'POST' ] )
@app.validate( 'users', 'register' )
def routeRegister():
  user = request.json
  return jsonify( user )

if __name__ == '__main__':
  app.run( port = 8080 )
```


## Schema File

`schemas/users.json`
```json
{
  "register": {
    "type": "object",
    "properties": {
      "name": { "type": "string", "minLength": 2, "maxLength": 100 },
      "email": { "type": "string", "format": "email" },
      "password": { "type": "string", "minLength": 8, "maxLength": 32 }
    },
    "required": [ "name", "email", "password" ]
  }
}
```


## Run Server

```sh
python main.py
```


## POST Data to Server
```http
POST /register HTTP/1.0
Content-Type: application/json
Content-Length: 76

{
	"name": "fred",
	"email": "fred@foo.com",
	"password": "frediscool"
}
```


## Handling Validation Errors

If the data validates correctly then the server will respond with the POST data as a JSON object.

If the data fails to validate, a `jsonschema.ValidationError` exception will be raised.

To handle the exception, you could register a Flask errorhandler. For example:

```python
import jsonschema
from flask import Response

@app.errorhandler( jsonschema.ValidationError )
def onValidationError( e ):
  return Response( "There was a validation error: " + str( e ), 400 )
```