falcon


Namefalcon JSON
Version 3.1.3 PyPI version JSON
download
home_pagehttps://falconframework.org
SummaryThe ultra-reliable, fast ASGI+WSGI framework for building data plane APIs at scale.
upload_time2023-12-05 06:19:32
maintainer
docs_urlNone
authorKurt Griffiths
requires_python>=3.5
licenseApache 2.0
keywords asgi wsgi web api framework rest http cloud
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            |Build Status| |Docs| |codecov.io| |Blue|

The Falcon Web Framework
========================

`Falcon <https://falconframework.org>`__ is a minimalist ASGI/WSGI framework for
building mission-critical REST APIs and microservices, with a focus on
reliability, correctness, and performance at scale.

When it comes to building HTTP APIs, other frameworks weigh you down with tons
of dependencies and unnecessary abstractions. Falcon cuts to the chase with a
clean design that embraces HTTP and the REST architectural style.

Falcon apps work with any `WSGI <https://www.python.org/dev/peps/pep-3333/>`_
or `ASGI <https://asgi.readthedocs.io/en/latest/>`_ server, and run like a
champ under CPython 3.5+ and PyPy 3.5+ (3.6+ required for ASGI).

Quick Links
-----------

* `Read the docs <https://falcon.readthedocs.io/en/stable>`_
  (`FAQ <https://falcon.readthedocs.io/en/stable/user/faq.html>`_ -
  `getting help <https://falcon.readthedocs.io/en/stable/community/help.html>`_ -
  `reference <https://falcon.readthedocs.io/en/stable/api/index.html>`_)
* `Falcon add-ons and complementary packages <https://github.com/falconry/falcon/wiki>`_
* `Falcon articles, talks and podcasts <https://github.com/falconry/falcon/wiki/Articles,-Talks-and-Podcasts>`_
* `falconry/user for Falcon users <https://gitter.im/falconry/user>`_ @ Gitter
* `falconry/dev for Falcon contributors <https://gitter.im/falconry/dev>`_ @ Gitter

What People are Saying
----------------------

"Falcon is rock solid and it's fast."

"We have been using Falcon as a replacement for [another framework] and
we simply love the performance (three times faster) and code base size (easily
half of our [original] code)."

"I'm loving #falconframework! Super clean and simple, I finally
have the speed and flexibility I need!"

"Falcon looks great so far. I hacked together a quick test for a
tiny server of mine and was ~40% faster with only 20 minutes of
work."

"I feel like I'm just talking HTTP at last, with nothing in the
middle. Falcon seems like the requests of backend."

"The source code for Falcon is so good, I almost prefer it to
documentation. It basically can't be wrong."

"What other framework has integrated support for 786 TRY IT NOW ?"

Features
--------

Falcon tries to do as little as possible while remaining highly effective.

- ASGI, WSGI, and WebSocket support
- Native ``asyncio`` support
- No reliance on magic globals for routing and state management
- Stable interfaces with an emphasis on backwards-compatibility
- Simple API modeling through centralized RESTful routing
- Highly-optimized, extensible code base
- Easy access to headers and bodies through request and response
  classes
- DRY request processing via middleware components and hooks
- Strict adherence to RFCs
- Idiomatic HTTP error responses
- Straightforward exception handling
- Snappy testing with WSGI/ASGI helpers and mocks
- CPython 3.5+ and PyPy 3.5+ support

Support Falcon Development
--------------------------

Has Falcon helped you make an awesome app? Show your support today with a one-time donation or by becoming a patron. Supporters get cool gear, an opportunity to promote their brand to Python developers, and
prioritized support.

* `Learn how to support Falcon development <https://falconframework.org/#sectionSupportFalconDevelopment>`_

Thanks!

How is Falcon Different?
------------------------

    Perfection is finally attained not when there is no longer anything
    to add, but when there is no longer anything to take away.

    *- Antoine de Saint-Exupéry*

We designed Falcon to support the demanding needs of large-scale
microservices and responsive app backends. Falcon complements more
general Python web frameworks by providing bare-metal performance,
reliability, and flexibility wherever you need it.

**Reliable.** We go to great lengths to avoid introducing breaking changes, and
when we do they are fully documented and only introduced (in the spirit of
`SemVer <http://semver.org/>`_) with a major version increment. The code is
rigorously tested with numerous inputs and we require 100% coverage at all
times. Falcon has no dependencies outside the standard library, helping
minimize your app's attack surface while avoiding transitive bugs and breaking
changes.

**Debuggable.** Falcon eschews magic. It's easy to tell which inputs lead to
which outputs. Unhandled exceptions are never encapsulated or masked.
Potentially surprising behaviors, such as automatic request body parsing, are
well-documented and disabled by default. Finally, when it comes to the
framework itself, we take care to keep logic paths simple and understandable.
All this makes it easier to reason about the code and to debug edge cases in
large-scale deployments.

**Fast.** Same hardware, more requests. Falcon turns around requests
significantly faster than other popular Python frameworks like Django and
Flask. For an extra speed boost, Falcon compiles itself with Cython when
available, and also works well with `PyPy <https://pypy.org>`_. Considering a
move to another programming language? Benchmark with Falcon+PyPy first!

**Flexible.** Falcon leaves a lot of decisions and implementation details to
you, the API developer. This gives you a lot of freedom to customize and tune
your implementation. It also helps you understand your apps at a deeper level,
making them easier to tune, debug, and refactor over the long run. Falcon's
minimalist design provides space for Python community members to independently
innovate on `Falcon add-ons and complementary packages
<https://github.com/falconry/falcon/wiki>`_.

Who's Using Falcon?
-------------------

Falcon is used around the world by a growing number of organizations,
including:

- 7ideas
- Cronitor
- EMC
- Hurricane Electric
- Leadpages
- OpenStack
- Rackspace
- Shiftgig
- tempfil.es
- Opera Software

If you are using the Falcon framework for a community or commercial
project, please consider adding your information to our wiki under
`Who's Using Falcon? <https://github.com/falconry/falcon/wiki/Who's-using-Falcon%3F>`_

Community
---------

A number of Falcon add-ons, templates, and complementary packages are
available for use in your projects. We've listed several of these on the
`Falcon wiki <https://github.com/falconry/falcon/wiki>`_ as a starting
point, but you may also wish to search PyPI for additional resources.

The Falconry community on Gitter is a great place to ask questions and
share your ideas. You can find us in `falconry/user
<https://gitter.im/falconry/user>`_. We also have a
`falconry/dev <https://gitter.im/falconry/dev>`_ room for discussing
the design and development of the framework itself.

Per our
`Code of Conduct <https://github.com/falconry/falcon/blob/master/CODEOFCONDUCT.md>`_,
we expect everyone who participates in community discussions to act
professionally, and lead by example in encouraging constructive
discussions. Each individual in the community is responsible for
creating a positive, constructive, and productive culture.

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

PyPy
^^^^

`PyPy <http://pypy.org/>`__ is the fastest way to run your Falcon app.
PyPy3.5+ is supported as of PyPy v5.10.

.. code:: bash

    $ pip install falcon

Or, to install the latest beta or release candidate, if any:

.. code:: bash

    $ pip install --pre falcon

CPython
^^^^^^^

Falcon also fully supports
`CPython <https://www.python.org/downloads/>`__ 3.5+.

The latest stable version of Falcon can be installed directly from PyPI:

.. code:: bash

    $ pip install falcon

Or, to install the latest beta or release candidate, if any:

.. code:: bash

    $ pip install --pre falcon

In order to provide an extra speed boost, Falcon can compile itself with
Cython. Wheels containing pre-compiled binaries are available from PyPI for
several common platforms. However, if a wheel for your platform of choice is not
available, you can install the source distribution. The installation process
will automatically try to cythonize Falcon for your environment, falling back to
a normal pure-Python install if any issues are encountered during the
cythonization step:

.. code:: bash

    $ pip install --no-binary :all: falcon

If you want to verify that Cython is being invoked, simply
pass the verbose flag `-v` to pip in order to echo the compilation commands.

The cythonization step is only active when using the ``CPython`` Python
implementation, so installing using ``PyPy`` will skip it.
If you want to skip Cython compilation step and install
the pure-Python version directly you can set the environment variable
``FALCON_DISABLE_CYTHON`` to a non empty value before install:

.. code:: bash

    $ FALCON_DISABLE_CYTHON=Y pip install -v --no-binary :all: falcon

Please note that ``pip>=10`` is required to be able to install Falcon from
source.

**Installing on OS X**

Xcode Command Line Tools are required to compile Cython. Install them
with this command:

.. code:: bash

    $ xcode-select --install

The Clang compiler treats unrecognized command-line options as
errors, for example:

.. code:: bash

    clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

You might also see warnings about unused functions. You can work around
these issues by setting additional Clang C compiler flags as follows:

.. code:: bash

    $ export CFLAGS="-Qunused-arguments -Wno-unused-function"

Dependencies
^^^^^^^^^^^^

Falcon does not require the installation of any other packages, although if
Cython has been installed into the environment, it will be used to optimize
the framework as explained above.

WSGI Server
-----------

Falcon speaks `WSGI <https://www.python.org/dev/peps/pep-3333/>`_ (or
`ASGI <https://asgi.readthedocs.io/en/latest/>`_; see also below). In order to
serve a Falcon app, you will need a WSGI server. Gunicorn and uWSGI are some of
the more popular ones out there, but anything that can load a WSGI app will do.

.. code:: bash

    $ pip install [gunicorn|uwsgi]

ASGI Server
-----------

In order to serve a Falcon ASGI app, you will need an ASGI server. Uvicorn
is a popular choice:

.. code:: bash

    $ pip install uvicorn

Source Code
-----------

Falcon `lives on GitHub <https://github.com/falconry/falcon>`_, making the
code easy to browse, download, fork, etc. Pull requests are always welcome! Also,
please remember to star the project if it makes you happy. :)

Once you have cloned the repo or downloaded a tarball from GitHub, you
can install Falcon like this:

.. code:: bash

    $ cd falcon
    $ pip install .

Or, if you want to edit the code, first fork the main repo, clone the fork
to your desktop, and then run the following to install it using symbolic
linking, so that when you change your code, the changes will be automagically
available to your app without having to reinstall the package:

.. code:: bash

    $ cd falcon
    $ pip install -e .

You can manually test changes to the Falcon framework by switching to the
directory of the cloned repo and then running pytest:

.. code:: bash

    $ cd falcon
    $ pip install -r requirements/tests
    $ pytest tests

Or, to run the default set of tests:

.. code:: bash

    $ pip install tox && tox

See also the `tox.ini <https://github.com/falconry/falcon/blob/master/tox.ini>`_
file for a full list of available environments.

Read the Docs
-------------

The docstrings in the Falcon code base are quite extensive, and we
recommend keeping a REPL running while learning the framework so that
you can query the various modules and classes as you have questions.

Online docs are available at: https://falcon.readthedocs.io

You can build the same docs locally as follows:

.. code:: bash

    $ pip install tox && tox -e docs

Once the docs have been built, you can view them by opening the following
index page in your browser. On OS X it's as simple as::

    $ open docs/_build/html/index.html

Or on Linux:

.. code:: bash

    $ xdg-open docs/_build/html/index.html

Getting Started
---------------

Here is a simple, contrived example showing how to create a Falcon-based
WSGI app (the ASGI version is included further down):

.. code:: python

    # examples/things.py

    # Let's get this party started!
    from wsgiref.simple_server import make_server

    import falcon


    # Falcon follows the REST architectural style, meaning (among
    # other things) that you think in terms of resources and state
    # transitions, which map to HTTP verbs.
    class ThingsResource:
        def on_get(self, req, resp):
            """Handles GET requests"""
            resp.status = falcon.HTTP_200  # This is the default status
            resp.content_type = falcon.MEDIA_TEXT  # Default is JSON, so override
            resp.text = ('\nTwo things awe me most, the starry sky '
                         'above me and the moral law within me.\n'
                         '\n'
                         '    ~ Immanuel Kant\n\n')


    # falcon.App instances are callable WSGI apps...
    # in larger applications the app is created in a separate file
    app = falcon.App()

    # Resources are represented by long-lived class instances
    things = ThingsResource()

    # things will handle all requests to the '/things' URL path
    app.add_route('/things', things)

    if __name__ == '__main__':
        with make_server('', 8000, app) as httpd:
            print('Serving on port 8000...')

            # Serve until process is killed
            httpd.serve_forever()

You can run the above example directly using the included wsgiref server:

.. code:: bash

    $ pip install falcon
    $ python things.py

Then, in another terminal:

.. code:: bash

    $ curl localhost:8000/things

The ASGI version of the example is similar:

.. code:: python

    # examples/things_asgi.py

    import falcon
    import falcon.asgi


    # Falcon follows the REST architectural style, meaning (among
    # other things) that you think in terms of resources and state
    # transitions, which map to HTTP verbs.
    class ThingsResource:
        async def on_get(self, req, resp):
            """Handles GET requests"""
            resp.status = falcon.HTTP_200  # This is the default status
            resp.content_type = falcon.MEDIA_TEXT  # Default is JSON, so override
            resp.text = ('\nTwo things awe me most, the starry sky '
                         'above me and the moral law within me.\n'
                         '\n'
                         '    ~ Immanuel Kant\n\n')


    # falcon.asgi.App instances are callable ASGI apps...
    # in larger applications the app is created in a separate file
    app = falcon.asgi.App()

    # Resources are represented by long-lived class instances
    things = ThingsResource()

    # things will handle all requests to the '/things' URL path
    app.add_route('/things', things)

You can run the ASGI version with uvicorn or any other ASGI server:

.. code:: bash

    $ pip install falcon uvicorn
    $ uvicorn things_asgi:app

A More Complex Example (WSGI)
-----------------------------

Here is a more involved example that demonstrates reading headers and query
parameters, handling errors, and working with request and response bodies.
Note that this example assumes that the
`requests <https://pypi.org/project/requests/>`_ package has been installed.

(For the equivalent ASGI app, see: `A More Complex Example (ASGI)`_).

.. code:: python

    # examples/things_advanced.py

    import json
    import logging
    import uuid
    from wsgiref import simple_server

    import falcon
    import requests


    class StorageEngine:

        def get_things(self, marker, limit):
            return [{'id': str(uuid.uuid4()), 'color': 'green'}]

        def add_thing(self, thing):
            thing['id'] = str(uuid.uuid4())
            return thing


    class StorageError(Exception):

        @staticmethod
        def handle(ex, req, resp, params):
            # TODO: Log the error, clean up, etc. before raising
            raise falcon.HTTPInternalServerError()


    class SinkAdapter:

        engines = {
            'ddg': 'https://duckduckgo.com',
            'y': 'https://search.yahoo.com/search',
        }

        def __call__(self, req, resp, engine):
            url = self.engines[engine]
            params = {'q': req.get_param('q', True)}
            result = requests.get(url, params=params)

            resp.status = str(result.status_code) + ' ' + result.reason
            resp.content_type = result.headers['content-type']
            resp.text = result.text


    class AuthMiddleware:

        def process_request(self, req, resp):
            token = req.get_header('Authorization')
            account_id = req.get_header('Account-ID')

            challenges = ['Token type="Fernet"']

            if token is None:
                description = ('Please provide an auth token '
                               'as part of the request.')

                raise falcon.HTTPUnauthorized(title='Auth token required',
                                              description=description,
                                              challenges=challenges,
                                              href='http://docs.example.com/auth')

            if not self._token_is_valid(token, account_id):
                description = ('The provided auth token is not valid. '
                               'Please request a new token and try again.')

                raise falcon.HTTPUnauthorized(title='Authentication required',
                                              description=description,
                                              challenges=challenges,
                                              href='http://docs.example.com/auth')

        def _token_is_valid(self, token, account_id):
            return True  # Suuuuuure it's valid...


    class RequireJSON:

        def process_request(self, req, resp):
            if not req.client_accepts_json:
                raise falcon.HTTPNotAcceptable(
                    description='This API only supports responses encoded as JSON.',
                    href='http://docs.examples.com/api/json')

            if req.method in ('POST', 'PUT'):
                if 'application/json' not in req.content_type:
                    raise falcon.HTTPUnsupportedMediaType(
                        title='This API only supports requests encoded as JSON.',
                        href='http://docs.examples.com/api/json')


    class JSONTranslator:
        # NOTE: Normally you would simply use req.media and resp.media for
        # this particular use case; this example serves only to illustrate
        # what is possible.

        def process_request(self, req, resp):
            # req.stream corresponds to the WSGI wsgi.input environ variable,
            # and allows you to read bytes from the request body.
            #
            # See also: PEP 3333
            if req.content_length in (None, 0):
                # Nothing to do
                return

            body = req.stream.read()
            if not body:
                raise falcon.HTTPBadRequest(title='Empty request body',
                                            description='A valid JSON document is required.')

            try:
                req.context.doc = json.loads(body.decode('utf-8'))

            except (ValueError, UnicodeDecodeError):
                description = ('Could not decode the request body. The '
                               'JSON was incorrect or not encoded as '
                               'UTF-8.')

                raise falcon.HTTPBadRequest(title='Malformed JSON',
                                            description=description)

        def process_response(self, req, resp, resource, req_succeeded):
            if not hasattr(resp.context, 'result'):
                return

            resp.text = json.dumps(resp.context.result)


    def max_body(limit):

        def hook(req, resp, resource, params):
            length = req.content_length
            if length is not None and length > limit:
                msg = ('The size of the request is too large. The body must not '
                       'exceed ' + str(limit) + ' bytes in length.')

                raise falcon.HTTPPayloadTooLarge(
                    title='Request body is too large', description=msg)

        return hook


    class ThingsResource:

        def __init__(self, db):
            self.db = db
            self.logger = logging.getLogger('thingsapp.' + __name__)

        def on_get(self, req, resp, user_id):
            marker = req.get_param('marker') or ''
            limit = req.get_param_as_int('limit') or 50

            try:
                result = self.db.get_things(marker, limit)
            except Exception as ex:
                self.logger.error(ex)

                description = ('Aliens have attacked our base! We will '
                               'be back as soon as we fight them off. '
                               'We appreciate your patience.')

                raise falcon.HTTPServiceUnavailable(
                    title='Service Outage',
                    description=description,
                    retry_after=30)

            # NOTE: Normally you would use resp.media for this sort of thing;
            # this example serves only to demonstrate how the context can be
            # used to pass arbitrary values between middleware components,
            # hooks, and resources.
            resp.context.result = result

            resp.set_header('Powered-By', 'Falcon')
            resp.status = falcon.HTTP_200

        @falcon.before(max_body(64 * 1024))
        def on_post(self, req, resp, user_id):
            try:
                doc = req.context.doc
            except AttributeError:
                raise falcon.HTTPBadRequest(
                    title='Missing thing',
                    description='A thing must be submitted in the request body.')

            proper_thing = self.db.add_thing(doc)

            resp.status = falcon.HTTP_201
            resp.location = '/%s/things/%s' % (user_id, proper_thing['id'])

    # Configure your WSGI server to load "things.app" (app is a WSGI callable)
    app = falcon.App(middleware=[
        AuthMiddleware(),
        RequireJSON(),
        JSONTranslator(),
    ])

    db = StorageEngine()
    things = ThingsResource(db)
    app.add_route('/{user_id}/things', things)

    # If a responder ever raises an instance of StorageError, pass control to
    # the given handler.
    app.add_error_handler(StorageError, StorageError.handle)

    # Proxy some things to another service; this example shows how you might
    # send parts of an API off to a legacy system that hasn't been upgraded
    # yet, or perhaps is a single cluster that all data centers have to share.
    sink = SinkAdapter()
    app.add_sink(sink, r'/search/(?P<engine>ddg|y)\Z')

    # Useful for debugging problems in your API; works with pdb.set_trace(). You
    # can also use Gunicorn to host your app. Gunicorn can be configured to
    # auto-restart workers when it detects a code change, and it also works
    # with pdb.
    if __name__ == '__main__':
        httpd = simple_server.make_server('127.0.0.1', 8000, app)
        httpd.serve_forever()

Again this code uses wsgiref, but you can also run the above example using
any WSGI server, such as uWSGI or Gunicorn. For example:

.. code:: bash

    $ pip install requests gunicorn
    $ gunicorn things:app

On Windows you can run Gunicorn and uWSGI via WSL, or you might try Waitress:

.. code:: bash

    $ pip install requests waitress
    $ waitress-serve --port=8000 things:app

To test this example, open another terminal and run:

.. code:: bash

    $ http localhost:8000/1/things authorization:custom-token

You can also view the application configuration from the CLI via the
``falcon-inspect-app`` script that is bundled with the framework:

.. code:: bash

    falcon-inspect-app things_advanced:app

A More Complex Example (ASGI)
-----------------------------

Here's the ASGI version of the app from above. Note that it uses the
`httpx <https://pypi.org/project/httpx/>`_ package in lieu of
`requests <https://pypi.org/project/requests/>`_.

.. code:: python

    # examples/things_advanced_asgi.py

    import json
    import logging
    import uuid

    import falcon
    import falcon.asgi
    import httpx


    class StorageEngine:

        async def get_things(self, marker, limit):
            return [{'id': str(uuid.uuid4()), 'color': 'green'}]

        async def add_thing(self, thing):
            thing['id'] = str(uuid.uuid4())
            return thing


    class StorageError(Exception):

        @staticmethod
        async def handle(ex, req, resp, params):
            # TODO: Log the error, clean up, etc. before raising
            raise falcon.HTTPInternalServerError()


    class SinkAdapter:

        engines = {
            'ddg': 'https://duckduckgo.com',
            'y': 'https://search.yahoo.com/search',
        }

        async def __call__(self, req, resp, engine):
            url = self.engines[engine]
            params = {'q': req.get_param('q', True)}

            async with httpx.AsyncClient() as client:
                result = await client.get(url, params=params)

            resp.status = result.status_code
            resp.content_type = result.headers['content-type']
            resp.text = result.text


    class AuthMiddleware:

        async def process_request(self, req, resp):
            token = req.get_header('Authorization')
            account_id = req.get_header('Account-ID')

            challenges = ['Token type="Fernet"']

            if token is None:
                description = ('Please provide an auth token '
                               'as part of the request.')

                raise falcon.HTTPUnauthorized(title='Auth token required',
                                              description=description,
                                              challenges=challenges,
                                              href='http://docs.example.com/auth')

            if not self._token_is_valid(token, account_id):
                description = ('The provided auth token is not valid. '
                               'Please request a new token and try again.')

                raise falcon.HTTPUnauthorized(title='Authentication required',
                                              description=description,
                                              challenges=challenges,
                                              href='http://docs.example.com/auth')

        def _token_is_valid(self, token, account_id):
            return True  # Suuuuuure it's valid...


    class RequireJSON:

        async def process_request(self, req, resp):
            if not req.client_accepts_json:
                raise falcon.HTTPNotAcceptable(
                    description='This API only supports responses encoded as JSON.',
                    href='http://docs.examples.com/api/json')

            if req.method in ('POST', 'PUT'):
                if 'application/json' not in req.content_type:
                    raise falcon.HTTPUnsupportedMediaType(
                        description='This API only supports requests encoded as JSON.',
                        href='http://docs.examples.com/api/json')


    class JSONTranslator:
        # NOTE: Normally you would simply use req.get_media() and resp.media for
        # this particular use case; this example serves only to illustrate
        # what is possible.

        async def process_request(self, req, resp):
            # NOTE: Test explicitly for 0, since this property could be None in
            # the case that the Content-Length header is missing (in which case we
            # can't know if there is a body without actually attempting to read
            # it from the request stream.)
            if req.content_length == 0:
                # Nothing to do
                return

            body = await req.stream.read()
            if not body:
                raise falcon.HTTPBadRequest(title='Empty request body',
                                            description='A valid JSON document is required.')

            try:
                req.context.doc = json.loads(body.decode('utf-8'))

            except (ValueError, UnicodeDecodeError):
                description = ('Could not decode the request body. The '
                               'JSON was incorrect or not encoded as '
                               'UTF-8.')

                raise falcon.HTTPBadRequest(title='Malformed JSON',
                                            description=description)

        async def process_response(self, req, resp, resource, req_succeeded):
            if not hasattr(resp.context, 'result'):
                return

            resp.text = json.dumps(resp.context.result)


    def max_body(limit):

        async def hook(req, resp, resource, params):
            length = req.content_length
            if length is not None and length > limit:
                msg = ('The size of the request is too large. The body must not '
                       'exceed ' + str(limit) + ' bytes in length.')

                raise falcon.HTTPPayloadTooLarge(
                    title='Request body is too large', description=msg)

        return hook


    class ThingsResource:

        def __init__(self, db):
            self.db = db
            self.logger = logging.getLogger('thingsapp.' + __name__)

        async def on_get(self, req, resp, user_id):
            marker = req.get_param('marker') or ''
            limit = req.get_param_as_int('limit') or 50

            try:
                result = await self.db.get_things(marker, limit)
            except Exception as ex:
                self.logger.error(ex)

                description = ('Aliens have attacked our base! We will '
                               'be back as soon as we fight them off. '
                               'We appreciate your patience.')

                raise falcon.HTTPServiceUnavailable(
                    title='Service Outage',
                    description=description,
                    retry_after=30)

            # NOTE: Normally you would use resp.media for this sort of thing;
            # this example serves only to demonstrate how the context can be
            # used to pass arbitrary values between middleware components,
            # hooks, and resources.
            resp.context.result = result

            resp.set_header('Powered-By', 'Falcon')
            resp.status = falcon.HTTP_200

        @falcon.before(max_body(64 * 1024))
        async def on_post(self, req, resp, user_id):
            try:
                doc = req.context.doc
            except AttributeError:
                raise falcon.HTTPBadRequest(
                    title='Missing thing',
                    description='A thing must be submitted in the request body.')

            proper_thing = await self.db.add_thing(doc)

            resp.status = falcon.HTTP_201
            resp.location = '/%s/things/%s' % (user_id, proper_thing['id'])


    # The app instance is an ASGI callable
    app = falcon.asgi.App(middleware=[
        # AuthMiddleware(),
        RequireJSON(),
        JSONTranslator(),
    ])

    db = StorageEngine()
    things = ThingsResource(db)
    app.add_route('/{user_id}/things', things)

    # If a responder ever raises an instance of StorageError, pass control to
    # the given handler.
    app.add_error_handler(StorageError, StorageError.handle)

    # Proxy some things to another service; this example shows how you might
    # send parts of an API off to a legacy system that hasn't been upgraded
    # yet, or perhaps is a single cluster that all data centers have to share.
    sink = SinkAdapter()
    app.add_sink(sink, r'/search/(?P<engine>ddg|y)\Z')

You can run the ASGI version with any ASGI server, such as uvicorn:

.. code:: bash

    $ pip install falcon httpx uvicorn
    $ uvicorn things_advanced_asgi:app

Contributing
------------

Thanks for your interest in the project! We welcome pull requests from
developers of all skill levels. To get started, simply fork the master branch
on GitHub to your personal account and then clone the fork into your
development environment.

If you would like to contribute but don't already have something in mind,
we invite you to take a look at the issues listed under our
`next milestone <https://github.com/falconry/falcon/milestones>`_.
If you see one you'd like to work on, please leave a quick comment so that we don't
end up with duplicated effort. Thanks in advance!

Please note that all contributors and maintainers of this project are subject to our `Code of Conduct <https://github.com/falconry/falcon/blob/master/CODEOFCONDUCT.md>`_.

Before submitting a pull request, please ensure you have added/updated
the appropriate tests (and that all existing tests still pass with your
changes), and that your coding style follows PEP 8 and doesn't cause
pyflakes to complain.

Commit messages should be formatted using `AngularJS
conventions <https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines>`__.

Comments follow `Google's style guide <https://google.github.io/styleguide/pyguide.html?showone=Comments#Comments>`__,
with the additional requirement of prefixing inline comments using your
GitHub nick and an appropriate prefix:

- TODO(riker): Damage report!
- NOTE(riker): Well, that's certainly good to know.
- PERF(riker): Travel time to the nearest starbase?
- APPSEC(riker): In all trust, there is the possibility for betrayal.

The core Falcon project maintainers are:

- Kurt Griffiths, Project Lead (**kgriffs** on GH, Gitter, and Twitter)
- John Vrbanac (**jmvrbanac** on GH, Gitter, and Twitter)
- Vytautas Liuolia (**vytas7** on GH and Gitter, and **vliuolia** on Twitter)
- Nick Zaccardi (**nZac** on GH and Gitter)
- Federico Caselli (**CaselIT** on GH and Gitter)

Please don't hesitate to reach out if you have any questions, or just need a
little help getting started. You can find us in
`falconry/dev <https://gitter.im/falconry/dev>`_ on Gitter.

See also: `CONTRIBUTING.md <https://github.com/falconry/falcon/blob/master/CONTRIBUTING.md>`__

Legal
-----

Copyright 2013-2023 by Individual and corporate contributors as
noted in the individual source files.

Licensed under the Apache License, Version 2.0 (the "License"); you may
not use any portion of the Falcon framework except in compliance with
the License. Contributors agree to license their work under the same
License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

.. |Docs| image:: https://readthedocs.org/projects/falcon/badge/?version=stable
    :target: https://falcon.readthedocs.io/en/stable/?badge=stable
    :alt: Falcon web framework docs
.. |Build Status| image:: https://github.com/falconry/falcon/workflows/Run%20tests/badge.svg
   :target: https://github.com/falconry/falcon/actions?query=workflow%3A%22Run+tests%22
.. |codecov.io| image:: https://codecov.io/gh/falconry/falcon/branch/master/graphs/badge.svg
   :target: http://codecov.io/gh/falconry/falcon
.. |Blue| image:: https://img.shields.io/badge/code%20style-blue-blue.svg
    :target: https://blue.readthedocs.io/
    :alt: code style: blue

            

Raw data

            {
    "_id": null,
    "home_page": "https://falconframework.org",
    "name": "falcon",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "asgi,wsgi,web,api,framework,rest,http,cloud",
    "author": "Kurt Griffiths",
    "author_email": "mail@kgriffs.com",
    "download_url": "https://files.pythonhosted.org/packages/3b/30/a7bc770025b6a7a36d0508e3d735dca239df7c27b862856e54d661f24632/falcon-3.1.3.tar.gz",
    "platform": null,
    "description": "|Build Status| |Docs| |codecov.io| |Blue|\n\nThe Falcon Web Framework\n========================\n\n`Falcon <https://falconframework.org>`__ is a minimalist ASGI/WSGI framework for\nbuilding mission-critical REST APIs and microservices, with a focus on\nreliability, correctness, and performance at scale.\n\nWhen it comes to building HTTP APIs, other frameworks weigh you down with tons\nof dependencies and unnecessary abstractions. Falcon cuts to the chase with a\nclean design that embraces HTTP and the REST architectural style.\n\nFalcon apps work with any `WSGI <https://www.python.org/dev/peps/pep-3333/>`_\nor `ASGI <https://asgi.readthedocs.io/en/latest/>`_ server, and run like a\nchamp under CPython 3.5+ and PyPy 3.5+ (3.6+ required for ASGI).\n\nQuick Links\n-----------\n\n* `Read the docs <https://falcon.readthedocs.io/en/stable>`_\n  (`FAQ <https://falcon.readthedocs.io/en/stable/user/faq.html>`_ -\n  `getting help <https://falcon.readthedocs.io/en/stable/community/help.html>`_ -\n  `reference <https://falcon.readthedocs.io/en/stable/api/index.html>`_)\n* `Falcon add-ons and complementary packages <https://github.com/falconry/falcon/wiki>`_\n* `Falcon articles, talks and podcasts <https://github.com/falconry/falcon/wiki/Articles,-Talks-and-Podcasts>`_\n* `falconry/user for Falcon users <https://gitter.im/falconry/user>`_ @ Gitter\n* `falconry/dev for Falcon contributors <https://gitter.im/falconry/dev>`_ @ Gitter\n\nWhat People are Saying\n----------------------\n\n\"Falcon is rock solid and it's fast.\"\n\n\"We have been using Falcon as a replacement for [another framework] and\nwe simply love the performance (three times faster) and code base size (easily\nhalf of our [original] code).\"\n\n\"I'm loving #falconframework! Super clean and simple, I finally\nhave the speed and flexibility I need!\"\n\n\"Falcon looks great so far. I hacked together a quick test for a\ntiny server of mine and was ~40% faster with only 20 minutes of\nwork.\"\n\n\"I feel like I'm just talking HTTP at last, with nothing in the\nmiddle. Falcon seems like the requests of backend.\"\n\n\"The source code for Falcon is so good, I almost prefer it to\ndocumentation. It basically can't be wrong.\"\n\n\"What other framework has integrated support for 786 TRY IT NOW ?\"\n\nFeatures\n--------\n\nFalcon tries to do as little as possible while remaining highly effective.\n\n- ASGI, WSGI, and WebSocket support\n- Native ``asyncio`` support\n- No reliance on magic globals for routing and state management\n- Stable interfaces with an emphasis on backwards-compatibility\n- Simple API modeling through centralized RESTful routing\n- Highly-optimized, extensible code base\n- Easy access to headers and bodies through request and response\n  classes\n- DRY request processing via middleware components and hooks\n- Strict adherence to RFCs\n- Idiomatic HTTP error responses\n- Straightforward exception handling\n- Snappy testing with WSGI/ASGI helpers and mocks\n- CPython 3.5+ and PyPy 3.5+ support\n\nSupport Falcon Development\n--------------------------\n\nHas Falcon helped you make an awesome app? Show your support today with a one-time donation or by becoming a patron. Supporters get cool gear, an opportunity to promote their brand to Python developers, and\nprioritized support.\n\n* `Learn how to support Falcon development <https://falconframework.org/#sectionSupportFalconDevelopment>`_\n\nThanks!\n\nHow is Falcon Different?\n------------------------\n\n    Perfection is finally attained not when there is no longer anything\n    to add, but when there is no longer anything to take away.\n\n    *- Antoine de Saint-Exup\u00e9ry*\n\nWe designed Falcon to support the demanding needs of large-scale\nmicroservices and responsive app backends. Falcon complements more\ngeneral Python web frameworks by providing bare-metal performance,\nreliability, and flexibility wherever you need it.\n\n**Reliable.** We go to great lengths to avoid introducing breaking changes, and\nwhen we do they are fully documented and only introduced (in the spirit of\n`SemVer <http://semver.org/>`_) with a major version increment. The code is\nrigorously tested with numerous inputs and we require 100% coverage at all\ntimes. Falcon has no dependencies outside the standard library, helping\nminimize your app's attack surface while avoiding transitive bugs and breaking\nchanges.\n\n**Debuggable.** Falcon eschews magic. It's easy to tell which inputs lead to\nwhich outputs. Unhandled exceptions are never encapsulated or masked.\nPotentially surprising behaviors, such as automatic request body parsing, are\nwell-documented and disabled by default. Finally, when it comes to the\nframework itself, we take care to keep logic paths simple and understandable.\nAll this makes it easier to reason about the code and to debug edge cases in\nlarge-scale deployments.\n\n**Fast.** Same hardware, more requests. Falcon turns around requests\nsignificantly faster than other popular Python frameworks like Django and\nFlask. For an extra speed boost, Falcon compiles itself with Cython when\navailable, and also works well with `PyPy <https://pypy.org>`_. Considering a\nmove to another programming language? Benchmark with Falcon+PyPy first!\n\n**Flexible.** Falcon leaves a lot of decisions and implementation details to\nyou, the API developer. This gives you a lot of freedom to customize and tune\nyour implementation. It also helps you understand your apps at a deeper level,\nmaking them easier to tune, debug, and refactor over the long run. Falcon's\nminimalist design provides space for Python community members to independently\ninnovate on `Falcon add-ons and complementary packages\n<https://github.com/falconry/falcon/wiki>`_.\n\nWho's Using Falcon?\n-------------------\n\nFalcon is used around the world by a growing number of organizations,\nincluding:\n\n- 7ideas\n- Cronitor\n- EMC\n- Hurricane Electric\n- Leadpages\n- OpenStack\n- Rackspace\n- Shiftgig\n- tempfil.es\n- Opera Software\n\nIf you are using the Falcon framework for a community or commercial\nproject, please consider adding your information to our wiki under\n`Who's Using Falcon? <https://github.com/falconry/falcon/wiki/Who's-using-Falcon%3F>`_\n\nCommunity\n---------\n\nA number of Falcon add-ons, templates, and complementary packages are\navailable for use in your projects. We've listed several of these on the\n`Falcon wiki <https://github.com/falconry/falcon/wiki>`_ as a starting\npoint, but you may also wish to search PyPI for additional resources.\n\nThe Falconry community on Gitter is a great place to ask questions and\nshare your ideas. You can find us in `falconry/user\n<https://gitter.im/falconry/user>`_. We also have a\n`falconry/dev <https://gitter.im/falconry/dev>`_ room for discussing\nthe design and development of the framework itself.\n\nPer our\n`Code of Conduct <https://github.com/falconry/falcon/blob/master/CODEOFCONDUCT.md>`_,\nwe expect everyone who participates in community discussions to act\nprofessionally, and lead by example in encouraging constructive\ndiscussions. Each individual in the community is responsible for\ncreating a positive, constructive, and productive culture.\n\nInstallation\n------------\n\nPyPy\n^^^^\n\n`PyPy <http://pypy.org/>`__ is the fastest way to run your Falcon app.\nPyPy3.5+ is supported as of PyPy v5.10.\n\n.. code:: bash\n\n    $ pip install falcon\n\nOr, to install the latest beta or release candidate, if any:\n\n.. code:: bash\n\n    $ pip install --pre falcon\n\nCPython\n^^^^^^^\n\nFalcon also fully supports\n`CPython <https://www.python.org/downloads/>`__ 3.5+.\n\nThe latest stable version of Falcon can be installed directly from PyPI:\n\n.. code:: bash\n\n    $ pip install falcon\n\nOr, to install the latest beta or release candidate, if any:\n\n.. code:: bash\n\n    $ pip install --pre falcon\n\nIn order to provide an extra speed boost, Falcon can compile itself with\nCython. Wheels containing pre-compiled binaries are available from PyPI for\nseveral common platforms. However, if a wheel for your platform of choice is not\navailable, you can install the source distribution. The installation process\nwill automatically try to cythonize Falcon for your environment, falling back to\na normal pure-Python install if any issues are encountered during the\ncythonization step:\n\n.. code:: bash\n\n    $ pip install --no-binary :all: falcon\n\nIf you want to verify that Cython is being invoked, simply\npass the verbose flag `-v` to pip in order to echo the compilation commands.\n\nThe cythonization step is only active when using the ``CPython`` Python\nimplementation, so installing using ``PyPy`` will skip it.\nIf you want to skip Cython compilation step and install\nthe pure-Python version directly you can set the environment variable\n``FALCON_DISABLE_CYTHON`` to a non empty value before install:\n\n.. code:: bash\n\n    $ FALCON_DISABLE_CYTHON=Y pip install -v --no-binary :all: falcon\n\nPlease note that ``pip>=10`` is required to be able to install Falcon from\nsource.\n\n**Installing on OS X**\n\nXcode Command Line Tools are required to compile Cython. Install them\nwith this command:\n\n.. code:: bash\n\n    $ xcode-select --install\n\nThe Clang compiler treats unrecognized command-line options as\nerrors, for example:\n\n.. code:: bash\n\n    clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]\n\nYou might also see warnings about unused functions. You can work around\nthese issues by setting additional Clang C compiler flags as follows:\n\n.. code:: bash\n\n    $ export CFLAGS=\"-Qunused-arguments -Wno-unused-function\"\n\nDependencies\n^^^^^^^^^^^^\n\nFalcon does not require the installation of any other packages, although if\nCython has been installed into the environment, it will be used to optimize\nthe framework as explained above.\n\nWSGI Server\n-----------\n\nFalcon speaks `WSGI <https://www.python.org/dev/peps/pep-3333/>`_ (or\n`ASGI <https://asgi.readthedocs.io/en/latest/>`_; see also below). In order to\nserve a Falcon app, you will need a WSGI server. Gunicorn and uWSGI are some of\nthe more popular ones out there, but anything that can load a WSGI app will do.\n\n.. code:: bash\n\n    $ pip install [gunicorn|uwsgi]\n\nASGI Server\n-----------\n\nIn order to serve a Falcon ASGI app, you will need an ASGI server. Uvicorn\nis a popular choice:\n\n.. code:: bash\n\n    $ pip install uvicorn\n\nSource Code\n-----------\n\nFalcon `lives on GitHub <https://github.com/falconry/falcon>`_, making the\ncode easy to browse, download, fork, etc. Pull requests are always welcome! Also,\nplease remember to star the project if it makes you happy. :)\n\nOnce you have cloned the repo or downloaded a tarball from GitHub, you\ncan install Falcon like this:\n\n.. code:: bash\n\n    $ cd falcon\n    $ pip install .\n\nOr, if you want to edit the code, first fork the main repo, clone the fork\nto your desktop, and then run the following to install it using symbolic\nlinking, so that when you change your code, the changes will be automagically\navailable to your app without having to reinstall the package:\n\n.. code:: bash\n\n    $ cd falcon\n    $ pip install -e .\n\nYou can manually test changes to the Falcon framework by switching to the\ndirectory of the cloned repo and then running pytest:\n\n.. code:: bash\n\n    $ cd falcon\n    $ pip install -r requirements/tests\n    $ pytest tests\n\nOr, to run the default set of tests:\n\n.. code:: bash\n\n    $ pip install tox && tox\n\nSee also the `tox.ini <https://github.com/falconry/falcon/blob/master/tox.ini>`_\nfile for a full list of available environments.\n\nRead the Docs\n-------------\n\nThe docstrings in the Falcon code base are quite extensive, and we\nrecommend keeping a REPL running while learning the framework so that\nyou can query the various modules and classes as you have questions.\n\nOnline docs are available at: https://falcon.readthedocs.io\n\nYou can build the same docs locally as follows:\n\n.. code:: bash\n\n    $ pip install tox && tox -e docs\n\nOnce the docs have been built, you can view them by opening the following\nindex page in your browser. On OS X it's as simple as::\n\n    $ open docs/_build/html/index.html\n\nOr on Linux:\n\n.. code:: bash\n\n    $ xdg-open docs/_build/html/index.html\n\nGetting Started\n---------------\n\nHere is a simple, contrived example showing how to create a Falcon-based\nWSGI app (the ASGI version is included further down):\n\n.. code:: python\n\n    # examples/things.py\n\n    # Let's get this party started!\n    from wsgiref.simple_server import make_server\n\n    import falcon\n\n\n    # Falcon follows the REST architectural style, meaning (among\n    # other things) that you think in terms of resources and state\n    # transitions, which map to HTTP verbs.\n    class ThingsResource:\n        def on_get(self, req, resp):\n            \"\"\"Handles GET requests\"\"\"\n            resp.status = falcon.HTTP_200  # This is the default status\n            resp.content_type = falcon.MEDIA_TEXT  # Default is JSON, so override\n            resp.text = ('\\nTwo things awe me most, the starry sky '\n                         'above me and the moral law within me.\\n'\n                         '\\n'\n                         '    ~ Immanuel Kant\\n\\n')\n\n\n    # falcon.App instances are callable WSGI apps...\n    # in larger applications the app is created in a separate file\n    app = falcon.App()\n\n    # Resources are represented by long-lived class instances\n    things = ThingsResource()\n\n    # things will handle all requests to the '/things' URL path\n    app.add_route('/things', things)\n\n    if __name__ == '__main__':\n        with make_server('', 8000, app) as httpd:\n            print('Serving on port 8000...')\n\n            # Serve until process is killed\n            httpd.serve_forever()\n\nYou can run the above example directly using the included wsgiref server:\n\n.. code:: bash\n\n    $ pip install falcon\n    $ python things.py\n\nThen, in another terminal:\n\n.. code:: bash\n\n    $ curl localhost:8000/things\n\nThe ASGI version of the example is similar:\n\n.. code:: python\n\n    # examples/things_asgi.py\n\n    import falcon\n    import falcon.asgi\n\n\n    # Falcon follows the REST architectural style, meaning (among\n    # other things) that you think in terms of resources and state\n    # transitions, which map to HTTP verbs.\n    class ThingsResource:\n        async def on_get(self, req, resp):\n            \"\"\"Handles GET requests\"\"\"\n            resp.status = falcon.HTTP_200  # This is the default status\n            resp.content_type = falcon.MEDIA_TEXT  # Default is JSON, so override\n            resp.text = ('\\nTwo things awe me most, the starry sky '\n                         'above me and the moral law within me.\\n'\n                         '\\n'\n                         '    ~ Immanuel Kant\\n\\n')\n\n\n    # falcon.asgi.App instances are callable ASGI apps...\n    # in larger applications the app is created in a separate file\n    app = falcon.asgi.App()\n\n    # Resources are represented by long-lived class instances\n    things = ThingsResource()\n\n    # things will handle all requests to the '/things' URL path\n    app.add_route('/things', things)\n\nYou can run the ASGI version with uvicorn or any other ASGI server:\n\n.. code:: bash\n\n    $ pip install falcon uvicorn\n    $ uvicorn things_asgi:app\n\nA More Complex Example (WSGI)\n-----------------------------\n\nHere is a more involved example that demonstrates reading headers and query\nparameters, handling errors, and working with request and response bodies.\nNote that this example assumes that the\n`requests <https://pypi.org/project/requests/>`_ package has been installed.\n\n(For the equivalent ASGI app, see: `A More Complex Example (ASGI)`_).\n\n.. code:: python\n\n    # examples/things_advanced.py\n\n    import json\n    import logging\n    import uuid\n    from wsgiref import simple_server\n\n    import falcon\n    import requests\n\n\n    class StorageEngine:\n\n        def get_things(self, marker, limit):\n            return [{'id': str(uuid.uuid4()), 'color': 'green'}]\n\n        def add_thing(self, thing):\n            thing['id'] = str(uuid.uuid4())\n            return thing\n\n\n    class StorageError(Exception):\n\n        @staticmethod\n        def handle(ex, req, resp, params):\n            # TODO: Log the error, clean up, etc. before raising\n            raise falcon.HTTPInternalServerError()\n\n\n    class SinkAdapter:\n\n        engines = {\n            'ddg': 'https://duckduckgo.com',\n            'y': 'https://search.yahoo.com/search',\n        }\n\n        def __call__(self, req, resp, engine):\n            url = self.engines[engine]\n            params = {'q': req.get_param('q', True)}\n            result = requests.get(url, params=params)\n\n            resp.status = str(result.status_code) + ' ' + result.reason\n            resp.content_type = result.headers['content-type']\n            resp.text = result.text\n\n\n    class AuthMiddleware:\n\n        def process_request(self, req, resp):\n            token = req.get_header('Authorization')\n            account_id = req.get_header('Account-ID')\n\n            challenges = ['Token type=\"Fernet\"']\n\n            if token is None:\n                description = ('Please provide an auth token '\n                               'as part of the request.')\n\n                raise falcon.HTTPUnauthorized(title='Auth token required',\n                                              description=description,\n                                              challenges=challenges,\n                                              href='http://docs.example.com/auth')\n\n            if not self._token_is_valid(token, account_id):\n                description = ('The provided auth token is not valid. '\n                               'Please request a new token and try again.')\n\n                raise falcon.HTTPUnauthorized(title='Authentication required',\n                                              description=description,\n                                              challenges=challenges,\n                                              href='http://docs.example.com/auth')\n\n        def _token_is_valid(self, token, account_id):\n            return True  # Suuuuuure it's valid...\n\n\n    class RequireJSON:\n\n        def process_request(self, req, resp):\n            if not req.client_accepts_json:\n                raise falcon.HTTPNotAcceptable(\n                    description='This API only supports responses encoded as JSON.',\n                    href='http://docs.examples.com/api/json')\n\n            if req.method in ('POST', 'PUT'):\n                if 'application/json' not in req.content_type:\n                    raise falcon.HTTPUnsupportedMediaType(\n                        title='This API only supports requests encoded as JSON.',\n                        href='http://docs.examples.com/api/json')\n\n\n    class JSONTranslator:\n        # NOTE: Normally you would simply use req.media and resp.media for\n        # this particular use case; this example serves only to illustrate\n        # what is possible.\n\n        def process_request(self, req, resp):\n            # req.stream corresponds to the WSGI wsgi.input environ variable,\n            # and allows you to read bytes from the request body.\n            #\n            # See also: PEP 3333\n            if req.content_length in (None, 0):\n                # Nothing to do\n                return\n\n            body = req.stream.read()\n            if not body:\n                raise falcon.HTTPBadRequest(title='Empty request body',\n                                            description='A valid JSON document is required.')\n\n            try:\n                req.context.doc = json.loads(body.decode('utf-8'))\n\n            except (ValueError, UnicodeDecodeError):\n                description = ('Could not decode the request body. The '\n                               'JSON was incorrect or not encoded as '\n                               'UTF-8.')\n\n                raise falcon.HTTPBadRequest(title='Malformed JSON',\n                                            description=description)\n\n        def process_response(self, req, resp, resource, req_succeeded):\n            if not hasattr(resp.context, 'result'):\n                return\n\n            resp.text = json.dumps(resp.context.result)\n\n\n    def max_body(limit):\n\n        def hook(req, resp, resource, params):\n            length = req.content_length\n            if length is not None and length > limit:\n                msg = ('The size of the request is too large. The body must not '\n                       'exceed ' + str(limit) + ' bytes in length.')\n\n                raise falcon.HTTPPayloadTooLarge(\n                    title='Request body is too large', description=msg)\n\n        return hook\n\n\n    class ThingsResource:\n\n        def __init__(self, db):\n            self.db = db\n            self.logger = logging.getLogger('thingsapp.' + __name__)\n\n        def on_get(self, req, resp, user_id):\n            marker = req.get_param('marker') or ''\n            limit = req.get_param_as_int('limit') or 50\n\n            try:\n                result = self.db.get_things(marker, limit)\n            except Exception as ex:\n                self.logger.error(ex)\n\n                description = ('Aliens have attacked our base! We will '\n                               'be back as soon as we fight them off. '\n                               'We appreciate your patience.')\n\n                raise falcon.HTTPServiceUnavailable(\n                    title='Service Outage',\n                    description=description,\n                    retry_after=30)\n\n            # NOTE: Normally you would use resp.media for this sort of thing;\n            # this example serves only to demonstrate how the context can be\n            # used to pass arbitrary values between middleware components,\n            # hooks, and resources.\n            resp.context.result = result\n\n            resp.set_header('Powered-By', 'Falcon')\n            resp.status = falcon.HTTP_200\n\n        @falcon.before(max_body(64 * 1024))\n        def on_post(self, req, resp, user_id):\n            try:\n                doc = req.context.doc\n            except AttributeError:\n                raise falcon.HTTPBadRequest(\n                    title='Missing thing',\n                    description='A thing must be submitted in the request body.')\n\n            proper_thing = self.db.add_thing(doc)\n\n            resp.status = falcon.HTTP_201\n            resp.location = '/%s/things/%s' % (user_id, proper_thing['id'])\n\n    # Configure your WSGI server to load \"things.app\" (app is a WSGI callable)\n    app = falcon.App(middleware=[\n        AuthMiddleware(),\n        RequireJSON(),\n        JSONTranslator(),\n    ])\n\n    db = StorageEngine()\n    things = ThingsResource(db)\n    app.add_route('/{user_id}/things', things)\n\n    # If a responder ever raises an instance of StorageError, pass control to\n    # the given handler.\n    app.add_error_handler(StorageError, StorageError.handle)\n\n    # Proxy some things to another service; this example shows how you might\n    # send parts of an API off to a legacy system that hasn't been upgraded\n    # yet, or perhaps is a single cluster that all data centers have to share.\n    sink = SinkAdapter()\n    app.add_sink(sink, r'/search/(?P<engine>ddg|y)\\Z')\n\n    # Useful for debugging problems in your API; works with pdb.set_trace(). You\n    # can also use Gunicorn to host your app. Gunicorn can be configured to\n    # auto-restart workers when it detects a code change, and it also works\n    # with pdb.\n    if __name__ == '__main__':\n        httpd = simple_server.make_server('127.0.0.1', 8000, app)\n        httpd.serve_forever()\n\nAgain this code uses wsgiref, but you can also run the above example using\nany WSGI server, such as uWSGI or Gunicorn. For example:\n\n.. code:: bash\n\n    $ pip install requests gunicorn\n    $ gunicorn things:app\n\nOn Windows you can run Gunicorn and uWSGI via WSL, or you might try Waitress:\n\n.. code:: bash\n\n    $ pip install requests waitress\n    $ waitress-serve --port=8000 things:app\n\nTo test this example, open another terminal and run:\n\n.. code:: bash\n\n    $ http localhost:8000/1/things authorization:custom-token\n\nYou can also view the application configuration from the CLI via the\n``falcon-inspect-app`` script that is bundled with the framework:\n\n.. code:: bash\n\n    falcon-inspect-app things_advanced:app\n\nA More Complex Example (ASGI)\n-----------------------------\n\nHere's the ASGI version of the app from above. Note that it uses the\n`httpx <https://pypi.org/project/httpx/>`_ package in lieu of\n`requests <https://pypi.org/project/requests/>`_.\n\n.. code:: python\n\n    # examples/things_advanced_asgi.py\n\n    import json\n    import logging\n    import uuid\n\n    import falcon\n    import falcon.asgi\n    import httpx\n\n\n    class StorageEngine:\n\n        async def get_things(self, marker, limit):\n            return [{'id': str(uuid.uuid4()), 'color': 'green'}]\n\n        async def add_thing(self, thing):\n            thing['id'] = str(uuid.uuid4())\n            return thing\n\n\n    class StorageError(Exception):\n\n        @staticmethod\n        async def handle(ex, req, resp, params):\n            # TODO: Log the error, clean up, etc. before raising\n            raise falcon.HTTPInternalServerError()\n\n\n    class SinkAdapter:\n\n        engines = {\n            'ddg': 'https://duckduckgo.com',\n            'y': 'https://search.yahoo.com/search',\n        }\n\n        async def __call__(self, req, resp, engine):\n            url = self.engines[engine]\n            params = {'q': req.get_param('q', True)}\n\n            async with httpx.AsyncClient() as client:\n                result = await client.get(url, params=params)\n\n            resp.status = result.status_code\n            resp.content_type = result.headers['content-type']\n            resp.text = result.text\n\n\n    class AuthMiddleware:\n\n        async def process_request(self, req, resp):\n            token = req.get_header('Authorization')\n            account_id = req.get_header('Account-ID')\n\n            challenges = ['Token type=\"Fernet\"']\n\n            if token is None:\n                description = ('Please provide an auth token '\n                               'as part of the request.')\n\n                raise falcon.HTTPUnauthorized(title='Auth token required',\n                                              description=description,\n                                              challenges=challenges,\n                                              href='http://docs.example.com/auth')\n\n            if not self._token_is_valid(token, account_id):\n                description = ('The provided auth token is not valid. '\n                               'Please request a new token and try again.')\n\n                raise falcon.HTTPUnauthorized(title='Authentication required',\n                                              description=description,\n                                              challenges=challenges,\n                                              href='http://docs.example.com/auth')\n\n        def _token_is_valid(self, token, account_id):\n            return True  # Suuuuuure it's valid...\n\n\n    class RequireJSON:\n\n        async def process_request(self, req, resp):\n            if not req.client_accepts_json:\n                raise falcon.HTTPNotAcceptable(\n                    description='This API only supports responses encoded as JSON.',\n                    href='http://docs.examples.com/api/json')\n\n            if req.method in ('POST', 'PUT'):\n                if 'application/json' not in req.content_type:\n                    raise falcon.HTTPUnsupportedMediaType(\n                        description='This API only supports requests encoded as JSON.',\n                        href='http://docs.examples.com/api/json')\n\n\n    class JSONTranslator:\n        # NOTE: Normally you would simply use req.get_media() and resp.media for\n        # this particular use case; this example serves only to illustrate\n        # what is possible.\n\n        async def process_request(self, req, resp):\n            # NOTE: Test explicitly for 0, since this property could be None in\n            # the case that the Content-Length header is missing (in which case we\n            # can't know if there is a body without actually attempting to read\n            # it from the request stream.)\n            if req.content_length == 0:\n                # Nothing to do\n                return\n\n            body = await req.stream.read()\n            if not body:\n                raise falcon.HTTPBadRequest(title='Empty request body',\n                                            description='A valid JSON document is required.')\n\n            try:\n                req.context.doc = json.loads(body.decode('utf-8'))\n\n            except (ValueError, UnicodeDecodeError):\n                description = ('Could not decode the request body. The '\n                               'JSON was incorrect or not encoded as '\n                               'UTF-8.')\n\n                raise falcon.HTTPBadRequest(title='Malformed JSON',\n                                            description=description)\n\n        async def process_response(self, req, resp, resource, req_succeeded):\n            if not hasattr(resp.context, 'result'):\n                return\n\n            resp.text = json.dumps(resp.context.result)\n\n\n    def max_body(limit):\n\n        async def hook(req, resp, resource, params):\n            length = req.content_length\n            if length is not None and length > limit:\n                msg = ('The size of the request is too large. The body must not '\n                       'exceed ' + str(limit) + ' bytes in length.')\n\n                raise falcon.HTTPPayloadTooLarge(\n                    title='Request body is too large', description=msg)\n\n        return hook\n\n\n    class ThingsResource:\n\n        def __init__(self, db):\n            self.db = db\n            self.logger = logging.getLogger('thingsapp.' + __name__)\n\n        async def on_get(self, req, resp, user_id):\n            marker = req.get_param('marker') or ''\n            limit = req.get_param_as_int('limit') or 50\n\n            try:\n                result = await self.db.get_things(marker, limit)\n            except Exception as ex:\n                self.logger.error(ex)\n\n                description = ('Aliens have attacked our base! We will '\n                               'be back as soon as we fight them off. '\n                               'We appreciate your patience.')\n\n                raise falcon.HTTPServiceUnavailable(\n                    title='Service Outage',\n                    description=description,\n                    retry_after=30)\n\n            # NOTE: Normally you would use resp.media for this sort of thing;\n            # this example serves only to demonstrate how the context can be\n            # used to pass arbitrary values between middleware components,\n            # hooks, and resources.\n            resp.context.result = result\n\n            resp.set_header('Powered-By', 'Falcon')\n            resp.status = falcon.HTTP_200\n\n        @falcon.before(max_body(64 * 1024))\n        async def on_post(self, req, resp, user_id):\n            try:\n                doc = req.context.doc\n            except AttributeError:\n                raise falcon.HTTPBadRequest(\n                    title='Missing thing',\n                    description='A thing must be submitted in the request body.')\n\n            proper_thing = await self.db.add_thing(doc)\n\n            resp.status = falcon.HTTP_201\n            resp.location = '/%s/things/%s' % (user_id, proper_thing['id'])\n\n\n    # The app instance is an ASGI callable\n    app = falcon.asgi.App(middleware=[\n        # AuthMiddleware(),\n        RequireJSON(),\n        JSONTranslator(),\n    ])\n\n    db = StorageEngine()\n    things = ThingsResource(db)\n    app.add_route('/{user_id}/things', things)\n\n    # If a responder ever raises an instance of StorageError, pass control to\n    # the given handler.\n    app.add_error_handler(StorageError, StorageError.handle)\n\n    # Proxy some things to another service; this example shows how you might\n    # send parts of an API off to a legacy system that hasn't been upgraded\n    # yet, or perhaps is a single cluster that all data centers have to share.\n    sink = SinkAdapter()\n    app.add_sink(sink, r'/search/(?P<engine>ddg|y)\\Z')\n\nYou can run the ASGI version with any ASGI server, such as uvicorn:\n\n.. code:: bash\n\n    $ pip install falcon httpx uvicorn\n    $ uvicorn things_advanced_asgi:app\n\nContributing\n------------\n\nThanks for your interest in the project! We welcome pull requests from\ndevelopers of all skill levels. To get started, simply fork the master branch\non GitHub to your personal account and then clone the fork into your\ndevelopment environment.\n\nIf you would like to contribute but don't already have something in mind,\nwe invite you to take a look at the issues listed under our\n`next milestone <https://github.com/falconry/falcon/milestones>`_.\nIf you see one you'd like to work on, please leave a quick comment so that we don't\nend up with duplicated effort. Thanks in advance!\n\nPlease note that all contributors and maintainers of this project are subject to our `Code of Conduct <https://github.com/falconry/falcon/blob/master/CODEOFCONDUCT.md>`_.\n\nBefore submitting a pull request, please ensure you have added/updated\nthe appropriate tests (and that all existing tests still pass with your\nchanges), and that your coding style follows PEP 8 and doesn't cause\npyflakes to complain.\n\nCommit messages should be formatted using `AngularJS\nconventions <https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines>`__.\n\nComments follow `Google's style guide <https://google.github.io/styleguide/pyguide.html?showone=Comments#Comments>`__,\nwith the additional requirement of prefixing inline comments using your\nGitHub nick and an appropriate prefix:\n\n- TODO(riker): Damage report!\n- NOTE(riker): Well, that's certainly good to know.\n- PERF(riker): Travel time to the nearest starbase?\n- APPSEC(riker): In all trust, there is the possibility for betrayal.\n\nThe core Falcon project maintainers are:\n\n- Kurt Griffiths, Project Lead (**kgriffs** on GH, Gitter, and Twitter)\n- John Vrbanac (**jmvrbanac** on GH, Gitter, and Twitter)\n- Vytautas Liuolia (**vytas7** on GH and Gitter, and **vliuolia** on Twitter)\n- Nick Zaccardi (**nZac** on GH and Gitter)\n- Federico Caselli (**CaselIT** on GH and Gitter)\n\nPlease don't hesitate to reach out if you have any questions, or just need a\nlittle help getting started. You can find us in\n`falconry/dev <https://gitter.im/falconry/dev>`_ on Gitter.\n\nSee also: `CONTRIBUTING.md <https://github.com/falconry/falcon/blob/master/CONTRIBUTING.md>`__\n\nLegal\n-----\n\nCopyright 2013-2023 by Individual and corporate contributors as\nnoted in the individual source files.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may\nnot use any portion of the Falcon framework except in compliance with\nthe License. Contributors agree to license their work under the same\nLicense. You may obtain a copy of the License at\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n.. |Docs| image:: https://readthedocs.org/projects/falcon/badge/?version=stable\n    :target: https://falcon.readthedocs.io/en/stable/?badge=stable\n    :alt: Falcon web framework docs\n.. |Build Status| image:: https://github.com/falconry/falcon/workflows/Run%20tests/badge.svg\n   :target: https://github.com/falconry/falcon/actions?query=workflow%3A%22Run+tests%22\n.. |codecov.io| image:: https://codecov.io/gh/falconry/falcon/branch/master/graphs/badge.svg\n   :target: http://codecov.io/gh/falconry/falcon\n.. |Blue| image:: https://img.shields.io/badge/code%20style-blue-blue.svg\n    :target: https://blue.readthedocs.io/\n    :alt: code style: blue\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "The ultra-reliable, fast ASGI+WSGI framework for building data plane APIs at scale.",
    "version": "3.1.3",
    "project_urls": {
        "Chat": "https://gitter.im/falconry/user",
        "Documentation": "https://falcon.readthedocs.io/en/stable/",
        "Funding": "https://opencollective.com/falcon",
        "Homepage": "https://falconframework.org",
        "Issue Tracker": "https://github.com/falconry/falcon/issues",
        "Release Notes": "https://falcon.readthedocs.io/en/stable/changes/",
        "Source": "https://github.com/falconry/falcon"
    },
    "split_keywords": [
        "asgi",
        "wsgi",
        "web",
        "api",
        "framework",
        "rest",
        "http",
        "cloud"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ff2f236b484367b5514b0c9348b4da01bc772492d6d87b5a9aec9bb0d7cc2291",
                "md5": "03a14c0f27dc1badce5b0ed215b53aa3",
                "sha256": "094d295a767e2aa84f07bec6b23e9ebe2e43cde81d9d583bef037168bd775ad6"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp310-cp310-macosx_11_0_x86_64.whl",
            "has_sig": false,
            "md5_digest": "03a14c0f27dc1badce5b0ed215b53aa3",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.5",
            "size": 2192693,
            "upload_time": "2023-12-05T06:23:59",
            "upload_time_iso_8601": "2023-12-05T06:23:59.760033Z",
            "url": "https://files.pythonhosted.org/packages/ff/2f/236b484367b5514b0c9348b4da01bc772492d6d87b5a9aec9bb0d7cc2291/falcon-3.1.3-cp310-cp310-macosx_11_0_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "13cd91de2ba5daa039814b40cabd3f28fc2446dd972948026ec73f22383e491b",
                "md5": "c653880253bffc74fcd47879c776eaff",
                "sha256": "1c335f1118a6e42f08cf30d56914a0bc0d470aa6db7619fdc4c546b184f38248"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "c653880253bffc74fcd47879c776eaff",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.5",
            "size": 10008923,
            "upload_time": "2023-12-05T06:24:14",
            "upload_time_iso_8601": "2023-12-05T06:24:14.551393Z",
            "url": "https://files.pythonhosted.org/packages/13/cd/91de2ba5daa039814b40cabd3f28fc2446dd972948026ec73f22383e491b/falcon-3.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cf7718443e827db3b071ceafe795b1901b20d114db4cef696e64df7a4c4500b4",
                "md5": "6f9c9793f89d2819e7fff6b02096595e",
                "sha256": "cb6b6a79d096b3a1f2f37f66f46a2cf18deb575db6dee9935057e6036d98d01f"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp310-cp310-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "6f9c9793f89d2819e7fff6b02096595e",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.5",
            "size": 1961225,
            "upload_time": "2023-12-05T06:28:50",
            "upload_time_iso_8601": "2023-12-05T06:28:50.965028Z",
            "url": "https://files.pythonhosted.org/packages/cf/77/18443e827db3b071ceafe795b1901b20d114db4cef696e64df7a4c4500b4/falcon-3.1.3-cp310-cp310-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d9e1d94630cd9b225315513b44e2055d916dfde2b923bdadaf2053625fef96e3",
                "md5": "412122af4e933659553552566595ab49",
                "sha256": "508fdf30617cf1fa5c9d3058c14124dc8e5f7e316e26dca22d974f916493fd0e"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp311-cp311-macosx_10_9_universal2.whl",
            "has_sig": false,
            "md5_digest": "412122af4e933659553552566595ab49",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.5",
            "size": 3992758,
            "upload_time": "2023-12-05T06:25:22",
            "upload_time_iso_8601": "2023-12-05T06:25:22.603477Z",
            "url": "https://files.pythonhosted.org/packages/d9/e1/d94630cd9b225315513b44e2055d916dfde2b923bdadaf2053625fef96e3/falcon-3.1.3-cp311-cp311-macosx_10_9_universal2.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6461239b22dc0a0015a230241a68a2e59b697a7bef051cb56e0f75bbb04ef3f9",
                "md5": "2dea492cfb3f34eb065c5769e4ce748d",
                "sha256": "51bbbfa1ecb1d50bed9f8ae940b0f1049d958e945f1a08891769d40cfabe6fb2"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "2dea492cfb3f34eb065c5769e4ce748d",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.5",
            "size": 11039016,
            "upload_time": "2023-12-05T06:24:21",
            "upload_time_iso_8601": "2023-12-05T06:24:21.773604Z",
            "url": "https://files.pythonhosted.org/packages/64/61/239b22dc0a0015a230241a68a2e59b697a7bef051cb56e0f75bbb04ef3f9/falcon-3.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a9a26c0816ed8ef132a6b72dad118a70ab6b53956c98d47cfed05d47b20d1449",
                "md5": "14360f43b63b06756a8b17ad44bd61a6",
                "sha256": "24aa51ba4145f05649976c33664971ef36f92846208bd9d4d4158ceb51bc753f"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp311-cp311-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "14360f43b63b06756a8b17ad44bd61a6",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.5",
            "size": 1964036,
            "upload_time": "2023-12-05T06:28:23",
            "upload_time_iso_8601": "2023-12-05T06:28:23.378937Z",
            "url": "https://files.pythonhosted.org/packages/a9/a2/6c0816ed8ef132a6b72dad118a70ab6b53956c98d47cfed05d47b20d1449/falcon-3.1.3-cp311-cp311-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "377922b82ba69466c2def59c0ea82e6db64cff75e64b2f912aa6be1764ad2ce6",
                "md5": "337d149a96b9746f19b851698e060358",
                "sha256": "7a1ee54bf19d9c7f998edd8ac21ab8ead1e2f73c24822237eb5485890979a25d"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp312-cp312-macosx_10_9_universal2.whl",
            "has_sig": false,
            "md5_digest": "337d149a96b9746f19b851698e060358",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=3.5",
            "size": 3923464,
            "upload_time": "2023-12-05T06:30:26",
            "upload_time_iso_8601": "2023-12-05T06:30:26.107549Z",
            "url": "https://files.pythonhosted.org/packages/37/79/22b82ba69466c2def59c0ea82e6db64cff75e64b2f912aa6be1764ad2ce6/falcon-3.1.3-cp312-cp312-macosx_10_9_universal2.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8276b778ca0342e5d0ebe427acd8cec84a9761b220dd2657a427d1258afa4034",
                "md5": "d9cf59abd40c94ccbb9e0bc83e3918fc",
                "sha256": "e19a0a3827821bcf754a9b24217e3b8b4750f7eb437c4a8c461135a86ca9b1c5"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "d9cf59abd40c94ccbb9e0bc83e3918fc",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=3.5",
            "size": 11197429,
            "upload_time": "2023-12-05T06:24:20",
            "upload_time_iso_8601": "2023-12-05T06:24:20.395753Z",
            "url": "https://files.pythonhosted.org/packages/82/76/b778ca0342e5d0ebe427acd8cec84a9761b220dd2657a427d1258afa4034/falcon-3.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b9a4dacbf0fd08e23ab5d52354d3b02516001d8ee31e8c8f51dc205e610faf9f",
                "md5": "845260d1e55c0a89d950e218d64bf8fb",
                "sha256": "d52a05be5c2ef364853cdc6d97056dd880a534016db73b95f5a6ebc652577533"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp312-cp312-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "845260d1e55c0a89d950e218d64bf8fb",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=3.5",
            "size": 1927525,
            "upload_time": "2023-12-05T06:29:15",
            "upload_time_iso_8601": "2023-12-05T06:29:15.079498Z",
            "url": "https://files.pythonhosted.org/packages/b9/a4/dacbf0fd08e23ab5d52354d3b02516001d8ee31e8c8f51dc205e610faf9f/falcon-3.1.3-cp312-cp312-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "60624ebb8c56af2a56b5ae5cae44d7033902fa9f92294cae55697cb4e2ac90b8",
                "md5": "e9a19b8fd18b35fb6de4e03a4fd50750",
                "sha256": "d78a6cfe2d135632673def489a19474e2508d83475c7662c4fa63be0ba82dd81"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp36-cp36m-macosx_10_14_x86_64.whl",
            "has_sig": false,
            "md5_digest": "e9a19b8fd18b35fb6de4e03a4fd50750",
            "packagetype": "bdist_wheel",
            "python_version": "cp36",
            "requires_python": ">=3.5",
            "size": 2092714,
            "upload_time": "2023-12-05T06:30:41",
            "upload_time_iso_8601": "2023-12-05T06:30:41.840443Z",
            "url": "https://files.pythonhosted.org/packages/60/62/4ebb8c56af2a56b5ae5cae44d7033902fa9f92294cae55697cb4e2ac90b8/falcon-3.1.3-cp36-cp36m-macosx_10_14_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d60e507a06e3ea83e6dcfc3a38d2ea8923a20bc10d5bfe3e5bb3428d40a741fc",
                "md5": "7575cb3776dd07063f0223194cd0e3f1",
                "sha256": "adc23ced91c4690042a11a0515c5cfe93eeeb7d063940900aee85f8eae7460ec"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp36-cp36m-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "7575cb3776dd07063f0223194cd0e3f1",
            "packagetype": "bdist_wheel",
            "python_version": "cp36",
            "requires_python": ">=3.5",
            "size": 2094092,
            "upload_time": "2023-12-05T06:35:14",
            "upload_time_iso_8601": "2023-12-05T06:35:14.633006Z",
            "url": "https://files.pythonhosted.org/packages/d6/0e/507a06e3ea83e6dcfc3a38d2ea8923a20bc10d5bfe3e5bb3428d40a741fc/falcon-3.1.3-cp36-cp36m-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "558838712c9adb50993d38f36c8bd0bf5c8a6f5677d6fe8b9a1cf81a11472c0f",
                "md5": "936f1580b9effd870f1d303287e3695b",
                "sha256": "d6b7131e85dff13abaacb4ff479c456256f0d57b262b1fb1771180f7535cc902"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp37-cp37m-macosx_11_0_x86_64.whl",
            "has_sig": false,
            "md5_digest": "936f1580b9effd870f1d303287e3695b",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.5",
            "size": 2172734,
            "upload_time": "2023-12-05T06:29:32",
            "upload_time_iso_8601": "2023-12-05T06:29:32.975464Z",
            "url": "https://files.pythonhosted.org/packages/55/88/38712c9adb50993d38f36c8bd0bf5c8a6f5677d6fe8b9a1cf81a11472c0f/falcon-3.1.3-cp37-cp37m-macosx_11_0_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e2db6f90961695b748497343e12adf3536d8370935901416e17a13d2f0c42e3b",
                "md5": "23fd1f440a3069bf5313d11358437120",
                "sha256": "04a92f159d392098a11d14b8ca71d17129d8b1ef37b7a3577f1f8bcb7b3aecba"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "23fd1f440a3069bf5313d11358437120",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.5",
            "size": 9232007,
            "upload_time": "2023-12-05T06:24:43",
            "upload_time_iso_8601": "2023-12-05T06:24:43.954926Z",
            "url": "https://files.pythonhosted.org/packages/e2/db/6f90961695b748497343e12adf3536d8370935901416e17a13d2f0c42e3b/falcon-3.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "90588b066ceaac179473a4b5a30e92f89a162e9bc3913e5918e6a438294595c7",
                "md5": "b654169f31512228b894f2845cb13bd2",
                "sha256": "9c82cb54bbf67861febe80d394c9b7bfa0d2e16cc998b69bfff4e8b003c721a2"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp37-cp37m-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "b654169f31512228b894f2845cb13bd2",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.5",
            "size": 1948295,
            "upload_time": "2023-12-05T06:33:56",
            "upload_time_iso_8601": "2023-12-05T06:33:56.038985Z",
            "url": "https://files.pythonhosted.org/packages/90/58/8b066ceaac179473a4b5a30e92f89a162e9bc3913e5918e6a438294595c7/falcon-3.1.3-cp37-cp37m-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e78f8220a4e3ea69958e685ab0f589765bdd285c7efe4e0609e304d0a4e678df",
                "md5": "4e461f1fbe49586777045c22eeed8c36",
                "sha256": "56e8a4728fb0193e2ccd5301d864fd9743a989cc228e709e5c49ff1025cc1a4f"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp38-cp38-macosx_11_0_x86_64.whl",
            "has_sig": false,
            "md5_digest": "4e461f1fbe49586777045c22eeed8c36",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.5",
            "size": 2201663,
            "upload_time": "2023-12-05T06:30:03",
            "upload_time_iso_8601": "2023-12-05T06:30:03.416808Z",
            "url": "https://files.pythonhosted.org/packages/e7/8f/8220a4e3ea69958e685ab0f589765bdd285c7efe4e0609e304d0a4e678df/falcon-3.1.3-cp38-cp38-macosx_11_0_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "27c690f67c977822cdb8115c8649fbc064c64085be1dfcfc7057cb5a39c5ba85",
                "md5": "92d28c21df820741f341eaff6075b0e1",
                "sha256": "19b2ce8a613a29a9eaf8243ca285ebf80464e8a6489dff60425f850fb5548936"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "92d28c21df820741f341eaff6075b0e1",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.5",
            "size": 10270337,
            "upload_time": "2023-12-05T06:24:08",
            "upload_time_iso_8601": "2023-12-05T06:24:08.956220Z",
            "url": "https://files.pythonhosted.org/packages/27/c6/90f67c977822cdb8115c8649fbc064c64085be1dfcfc7057cb5a39c5ba85/falcon-3.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f4c67cb4170975f1da166dccd9e399d005f28b3226d8f58d25b4e08d427e9dfc",
                "md5": "5a5ce92f323a3840e41bb08c98234644",
                "sha256": "3cda76fb21568aa058ce454fa6272ca5b2582ebb0efcb7ae0090d3bf6d0db5af"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp38-cp38-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "5a5ce92f323a3840e41bb08c98234644",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.5",
            "size": 1977106,
            "upload_time": "2023-12-05T06:33:50",
            "upload_time_iso_8601": "2023-12-05T06:33:50.370386Z",
            "url": "https://files.pythonhosted.org/packages/f4/c6/7cb4170975f1da166dccd9e399d005f28b3226d8f58d25b4e08d427e9dfc/falcon-3.1.3-cp38-cp38-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "06efa5294d78b2a096ecad55b7bcaf66b28228a190146d7d8852b3c590d86d78",
                "md5": "a2ce6935f977c557bef69039ded1005e",
                "sha256": "cbd40435e99255e40ccfa849e4809cd1638fd8eccc08931fc9d355a6840a7332"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp39-cp39-macosx_11_0_x86_64.whl",
            "has_sig": false,
            "md5_digest": "a2ce6935f977c557bef69039ded1005e",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.5",
            "size": 2199393,
            "upload_time": "2023-12-05T06:30:49",
            "upload_time_iso_8601": "2023-12-05T06:30:49.071455Z",
            "url": "https://files.pythonhosted.org/packages/06/ef/a5294d78b2a096ecad55b7bcaf66b28228a190146d7d8852b3c590d86d78/falcon-3.1.3-cp39-cp39-macosx_11_0_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "15cf9bcc0a3cf2278c3262b4fe1c806a725740b24291686d0a957d5c95e8b7e0",
                "md5": "f61cfcdf22240511e869659339e9bde9",
                "sha256": "9e2fe54081f1cedc71462eff8dca074045d14380a4bca163882c6c4353f65af2"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "f61cfcdf22240511e869659339e9bde9",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.5",
            "size": 10035531,
            "upload_time": "2023-12-05T06:24:21",
            "upload_time_iso_8601": "2023-12-05T06:24:21.629416Z",
            "url": "https://files.pythonhosted.org/packages/15/cf/9bcc0a3cf2278c3262b4fe1c806a725740b24291686d0a957d5c95e8b7e0/falcon-3.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a6f3e64873486548b04fae56b1c25b4bfdf7aaa8cfd6e6ecd71dbcfd160891d0",
                "md5": "93dc3dc369a8c2182fdc5f12a3a997d8",
                "sha256": "ad37c46322122f34e228be4fe7ae5fcfedb630eef788a198fbdff5971091d5dc"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3-cp39-cp39-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "93dc3dc369a8c2182fdc5f12a3a997d8",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.5",
            "size": 1965617,
            "upload_time": "2023-12-05T06:33:59",
            "upload_time_iso_8601": "2023-12-05T06:33:59.203517Z",
            "url": "https://files.pythonhosted.org/packages/a6/f3/e64873486548b04fae56b1c25b4bfdf7aaa8cfd6e6ecd71dbcfd160891d0/falcon-3.1.3-cp39-cp39-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3b30a7bc770025b6a7a36d0508e3d735dca239df7c27b862856e54d661f24632",
                "md5": "22a5c32f3d9dd96d498febe8e16ddffe",
                "sha256": "23335dbccd44f29e85ec55f2f35d5a0bc12bd7a509f641ab81f5c64b65626263"
            },
            "downloads": -1,
            "filename": "falcon-3.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "22a5c32f3d9dd96d498febe8e16ddffe",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 577770,
            "upload_time": "2023-12-05T06:19:32",
            "upload_time_iso_8601": "2023-12-05T06:19:32.518459Z",
            "url": "https://files.pythonhosted.org/packages/3b/30/a7bc770025b6a7a36d0508e3d735dca239df7c27b862856e54d661f24632/falcon-3.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-05 06:19:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "falconry",
    "github_project": "falcon",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "falcon"
}
        
Elapsed time: 0.19876s