Skip to main content

Let you use function annotations (PEP 3107) to parseand validate arguments

Project description

=========
Thunderargs
=========

Abstract
--------

Bla-bla-bla bla-bla-bla


Installation
------------

.. code-block:: bash

sudo pip install thunderargs

Usage
-----

You can use it like this:

.. code-block:: python

from thunderargs import Arg
from thunderargs.endpoint import Endpoint


@Endpoint
def max_int(x: Arg(int), y: Arg(int)):
return max(x,y)

Or you can use it with flask, like this:

.. code-block:: python

@app.route('/calc_with_expander/')
def calc_with_expander(x:Arg(int), y:Arg(int),
op:Arg(str, default='+', expander=OPERATION)):
return str(op(x,y))

(Since version 0.3 this feature was moved to `other repo <https://bitbucket.org/dsupiev/flask-thunderargs>`_.)

Or you can write your own proxy to any other framework!

Read the example.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thunderargs-0.3.1.zip (7.1 kB view details)

Uploaded Source

File details

Details for the file thunderargs-0.3.1.zip.

File metadata

  • Download URL: thunderargs-0.3.1.zip
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for thunderargs-0.3.1.zip
Algorithm Hash digest
SHA256 ba18f6de3828a50003c7ee38a416484b75d42647a70c96e5e592d23da3ab0bbe
MD5 79e058fc4b636cde438448cf9d6139f6
BLAKE2b-256 5bde6d0c79fd2fbc86b3ea8bbed8003a505eb7b43d0525816e7dd4f85da8a2e1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page