{"id":13398268,"url":"https://github.com/falconry/falcon","last_synced_at":"2025-12-18T01:15:56.350Z","repository":{"id":5825029,"uuid":"7040500","full_name":"falconry/falcon","owner":"falconry","description":"The no-magic web API and microservices framework for Python developers, with a focus on reliability and performance at scale.","archived":false,"fork":false,"pushed_at":"2025-09-06T15:43:19.000Z","size":8298,"stargazers_count":9711,"open_issues_count":157,"forks_count":958,"subscribers_count":256,"default_branch":"master","last_synced_at":"2025-09-06T17:38:27.289Z","etag":null,"topics":["api","api-rest","asgi","http","microservices","python","rest","web","wsgi"],"latest_commit_sha":null,"homepage":"https://falcon.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/falconry.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"open_collective":"falcon"}},"created_at":"2012-12-06T18:17:51.000Z","updated_at":"2025-09-06T15:43:23.000Z","dependencies_parsed_at":"2023-02-10T17:45:48.984Z","dependency_job_id":"ec874848-5767-4a9e-a1ec-c8eeb181c130","html_url":"https://github.com/falconry/falcon","commit_stats":{"total_commits":1617,"total_committers":208,"mean_commits":7.774038461538462,"dds":0.6703772418058133,"last_synced_commit":"9b27c71e40ffafa76a160b33905281084430ef98"},"previous_names":[],"tags_count":93,"template":false,"template_full_name":null,"purl":"pkg:github/falconry/falcon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falconry%2Ffalcon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falconry%2Ffalcon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falconry%2Ffalcon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falconry%2Ffalcon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/falconry","download_url":"https://codeload.github.com/falconry/falcon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/falconry%2Ffalcon/sbom","scorecard":{"id":179873,"data":{"date":"2025-08-11","repo":{"name":"github.com/falconry/falcon","commit":"51e7f3213129a580b6bf4bf41a237dc8d5def481"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.4,"checks":[{"name":"Maintained","score":10,"reason":"30 commit(s) and 5 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Code-Review","score":8,"reason":"Found 26/30 approved changesets -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/cibuildwheel.yaml:64","Warn: no topLevel permission defined: .github/workflows/cibuildwheel.yaml:1","Warn: no topLevel permission defined: .github/workflows/test-dist.yaml:1","Warn: no topLevel permission defined: .github/workflows/test-mailman.yaml:1","Warn: no topLevel permission defined: .github/workflows/test-other.yaml:1","Warn: no topLevel permission defined: .github/workflows/test-wheels.yaml:1","Warn: no topLevel permission defined: .github/workflows/tests.yaml:1","Warn: no topLevel permission defined: .github/workflows/tox-sdist.yaml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 4.1.0 not signed: https://api.github.com/repos/falconry/falcon/releases/238033691","Warn: release artifact 4.1.0rc1 not signed: https://api.github.com/repos/falconry/falcon/releases/237083659","Warn: release artifact 4.1.0b1 not signed: https://api.github.com/repos/falconry/falcon/releases/236714561","Warn: release artifact 4.1.0a3 not signed: https://api.github.com/repos/falconry/falcon/releases/234364281","Warn: release artifact 4.1.0a2 not signed: https://api.github.com/repos/falconry/falcon/releases/233850293","Warn: release artifact 4.1.0 does not have provenance: https://api.github.com/repos/falconry/falcon/releases/238033691","Warn: release artifact 4.1.0rc1 does not have provenance: https://api.github.com/repos/falconry/falcon/releases/237083659","Warn: release artifact 4.1.0b1 does not have provenance: https://api.github.com/repos/falconry/falcon/releases/236714561","Warn: release artifact 4.1.0a3 does not have provenance: https://api.github.com/repos/falconry/falcon/releases/234364281","Warn: release artifact 4.1.0a2 does not have provenance: https://api.github.com/repos/falconry/falcon/releases/233850293"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Info: Possibly incomplete results: error parsing shell code: invalid parameter name: .github/workflows/cibuildwheel.yaml:218","Info: Possibly incomplete results: error parsing shell code: invalid parameter name: .github/workflows/cibuildwheel.yaml:38","Info: Possibly incomplete results: error parsing shell code: invalid parameter name: .github/workflows/cibuildwheel.yaml:85","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:167: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:172: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:178: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:188: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:201: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:206: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:211: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:237: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:247: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:253: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:73: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:78: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:89: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:110: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:120: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/cibuildwheel.yaml:126: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/cibuildwheel.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-dist.yaml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/test-dist.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-dist.yaml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/test-dist.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-mailman.yaml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/test-mailman.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-mailman.yaml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/test-mailman.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-other.yaml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/test-other.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-other.yaml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/test-other.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-wheels.yaml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/test-wheels.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-wheels.yaml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/test-wheels.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-wheels.yaml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/test-wheels.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yaml:92: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/tests.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yaml:99: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/tests.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yaml:122: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/tests.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tox-sdist.yaml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/tox-sdist.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tox-sdist.yaml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/falconry/falcon/tox-sdist.yaml/master?enable=pin","Warn: containerImage not pinned by hash: docker/bench_py3.Dockerfile:1: pin your Docker image by updating python:3.8-slim to python:3.8-slim@sha256:1d52838af602b4b5a831beb13a0e4d073280665ea7be7f69ce2382f29c5a613f","Warn: containerImage not pinned by hash: docker/bench_py3_cython.Dockerfile:1: pin your Docker image by updating python:3.8 to python:3.8@sha256:d411270700143fa2683cc8264d9fa5d3279fd3b6afff62ae81ea2f9d070e390c","Warn: containerImage not pinned by hash: docker/bench_pypy3.Dockerfile:1: pin your Docker image by updating pypy:3-slim to pypy:3-slim@sha256:f176fc63c512f639759cea9d91c54494e62db818088dc5f8637bd0c12e1a3eb8","Warn: pipCommand not pinned by hash: docker/bench_py3.Dockerfile:4","Warn: pipCommand not pinned by hash: docker/bench_py3.Dockerfile:5","Warn: pipCommand not pinned by hash: docker/bench_py3_cython.Dockerfile:4","Warn: pipCommand not pinned by hash: docker/bench_py3_cython.Dockerfile:9","Warn: pipCommand not pinned by hash: docker/bench_py3_cython.Dockerfile:10","Warn: pipCommand not pinned by hash: docker/bench_pypy3.Dockerfile:4","Warn: pipCommand not pinned by hash: docker/bench_pypy3.Dockerfile:5","Warn: pipCommand not pinned by hash: .github/workflows/cibuildwheel.yaml:33","Warn: pipCommand not pinned by hash: .github/workflows/cibuildwheel.yaml:34","Warn: pipCommand not pinned by hash: .github/workflows/test-dist.yaml:34","Warn: pipCommand not pinned by hash: .github/workflows/test-dist.yaml:35","Warn: pipCommand not pinned by hash: .github/workflows/test-other.yaml:41","Warn: pipCommand not pinned by hash: .github/workflows/test-other.yaml:42","Warn: pipCommand not pinned by hash: .github/workflows/tests.yaml:105","Warn: pipCommand not pinned by hash: .github/workflows/tests.yaml:106","Warn: pipCommand not pinned by hash: .github/workflows/tox-sdist.yaml:35","Warn: pipCommand not pinned by hash: .github/workflows/tox-sdist.yaml:36","Info:   0 out of  23 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  11 third-party GitHubAction dependencies pinned","Info:   0 out of   3 containerImage dependencies pinned","Info:   0 out of  17 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/cibuildwheel.yaml:221"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T18:36:35.176Z","repository_id":5825029,"created_at":"2025-08-16T18:36:35.176Z","updated_at":"2025-08-16T18:36:35.176Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274360193,"owners_count":25270932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-rest","asgi","http","microservices","python","rest","web","wsgi"],"created_at":"2024-07-30T19:00:21.462Z","updated_at":"2025-12-18T01:15:56.248Z","avatar_url":"https://github.com/falconry.png","language":"Python","readme":".. image:: https://raw.githubusercontent.com/falconry/falcon/master/logo/banner.jpg\n   :align: center\n   :alt: Falcon logo\n   :target: https://falconframework.org/\n   :width: 100 %\n\n|Build status| |Docs| |codecov.io| |PyPI package| |Python versions|\n\nThe Falcon Web Framework\n========================\n\n`Falcon \u003chttps://falconframework.org\u003e`__ 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 \u003chttps://www.python.org/dev/peps/pep-3333/\u003e`_\nor `ASGI \u003chttps://asgi.readthedocs.io/en/latest/\u003e`_ server, and run like a\nchamp under CPython 3.9+ and PyPy 3.9+.\n\nQuick Links\n-----------\n\n* `Read the docs \u003chttps://falcon.readthedocs.io/en/stable\u003e`_\n  (`FAQ \u003chttps://falcon.readthedocs.io/en/stable/user/faq.html\u003e`_ -\n  `getting help \u003chttps://falcon.readthedocs.io/en/stable/community/help.html\u003e`_ -\n  `reference \u003chttps://falcon.readthedocs.io/en/stable/api/index.html\u003e`_)\n* `Falcon add-ons and complementary packages \u003chttps://github.com/falconry/falcon/wiki\u003e`_\n* `Falcon articles, talks and podcasts \u003chttps://github.com/falconry/falcon/wiki/Articles,-Talks-and-Podcasts\u003e`_\n* `falconry/user for Falcon users \u003chttps://gitter.im/falconry/user\u003e`_ @ Gitter\n* `falconry/dev for Falcon contributors \u003chttps://gitter.im/falconry/dev\u003e`_ @ 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.9+ and PyPy 3.9+ support\n\n.. Patron list starts here. For Python package, we substitute this section with:\n   Support Falcon Development\n   --------------------------\n\nA Big Thank You to Our Patrons!\n-------------------------------\n\n|Backer:GovCert| |Backer:Sentry|\n\nHas Falcon helped you make an awesome app? Show your support today with a\none-time donation or by becoming a patron.\nSupporters get cool gear, an opportunity to promote their brand to Python\ndevelopers, and prioritized support.\n\n* `Learn how to support Falcon development \u003chttps://falconframework.org/#sectionSupportFalconDevelopment\u003e`_\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éry*\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 \u003chttp://semver.org/\u003e`_) 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 \u003chttps://pypy.org\u003e`_. 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\u003chttps://github.com/falconry/falcon/wiki\u003e`_.\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? \u003chttps://github.com/falconry/falcon/wiki/Who's-using-Falcon%3F\u003e`_\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 \u003chttps://github.com/falconry/falcon/wiki\u003e`_ 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\u003chttps://gitter.im/falconry/user\u003e`_. We also have a\n`falconry/dev \u003chttps://gitter.im/falconry/dev\u003e`_ room for discussing\nthe design and development of the framework itself.\n\nPer our\n`Code of Conduct \u003chttps://github.com/falconry/falcon/blob/master/CODEOFCONDUCT.md\u003e`_,\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 \u003chttp://pypy.org/\u003e`__ is the fastest way to run your Falcon app.\nPyPy3.9+ is supported as of PyPy v7.3.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 \u003chttps://www.python.org/downloads/\u003e`__ 3.9+.\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 automatically compiles itself\nwith `Cython \u003chttps://cython.org/\u003e`__ under any\n`PEP 517 \u003chttps://peps.python.org/pep-0517/\u003e`__\\-compliant installer.\n\nFor your convenience, wheels containing pre-compiled binaries are available\nfrom PyPI for the majority of common platforms. Even if a binary build for your\nplatform of choice is not available, ``pip`` will pick a pure-Python wheel.\nYou can also cythonize Falcon for your environment; see our\n`Installation docs \u003chttps://falcon.readthedocs.io/en/stable/user/install.html\u003e`__\nfor more information on this and other advanced options.\n\nDependencies\n^^^^^^^^^^^^\n\nFalcon does not require the installation of any other packages.\n\nWSGI Server\n-----------\n\nFalcon speaks `WSGI \u003chttps://www.python.org/dev/peps/pep-3333/\u003e`_ (or\n`ASGI \u003chttps://asgi.readthedocs.io/en/latest/\u003e`_; 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 \u003chttps://github.com/falconry/falcon\u003e`_, 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    $ FALCON_DISABLE_CYTHON=Y 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 \u0026\u0026 tox\n\nSee also the `tox.ini \u003chttps://github.com/falconry/falcon/blob/master/tox.ini\u003e`_\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 \u0026\u0026 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 \u003chttps://pypi.org/project/requests/\u003e`_ 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 \u003e 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.HTTPContentTooLarge(\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\u003cengine\u003eddg|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 \u003chttps://pypi.org/project/httpx/\u003e`_ package in lieu of\n`requests \u003chttps://pypi.org/project/requests/\u003e`_.\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 \u003e 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.HTTPContentTooLarge(\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\u003cengine\u003eddg|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 \u003chttps://github.com/falconry/falcon/milestones\u003e`_.\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\n`Code of Conduct \u003chttps://github.com/falconry/falcon/blob/master/CODEOFCONDUCT.md\u003e`_.\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 \u003chttps://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines\u003e`__.\n\nComments follow `Google's style guide \u003chttps://google.github.io/styleguide/pyguide.html?showone=Comments#Comments\u003e`__,\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 \u003chttps://gitter.im/falconry/dev\u003e`_ on Gitter.\n\nSee also: `CONTRIBUTING.md \u003chttps://github.com/falconry/falcon/blob/master/CONTRIBUTING.md\u003e`__\n\nLegal\n-----\n\nCopyright 2013-2025 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.. |Build status| image:: https://github.com/falconry/falcon/actions/workflows/tests.yaml/badge.svg\n    :target: https://github.com/falconry/falcon/actions/workflows/tests.yaml\n.. |Docs| image:: https://readthedocs.org/projects/falcon/badge/?version=stable\n    :alt: Falcon web framework docs\n    :target: https://falcon.readthedocs.io/en/stable/?badge=stable\n.. |codecov.io| image:: https://codecov.io/gh/falconry/falcon/branch/master/graphs/badge.svg\n    :target: https://codecov.io/gh/falconry/falcon\n.. |PyPI package| image:: https://badge.fury.io/py/falcon.svg\n    :target: https://pypi.org/project/falcon/\n.. |Python versions| image:: https://img.shields.io/pypi/pyversions/falcon.svg\n    :target: https://pypi.org/project/falcon/\n.. |Backer:GovCert| image:: https://falconframework.org/assets/govcert.png\n    :alt: CERT Gouvernemental Luxembourg\n    :height: 60px\n    :target: https://www.govcert.lu/\n.. |Backer:Sentry| image:: https://falconframework.org/assets/sentry-dark.svg\n    :alt: Sentry\n    :height: 60px\n    :target: https://sentry.io\n","funding_links":["https://opencollective.com/falcon"],"categories":["`API Frameworks`","Python","RESTful API","Servers","HarmonyOS","Web Frameworks","RESTful API [🔝](#readme)","📚 فهرست","API Frameworks","Uncategorized","Micro-frameworks"],"sub_categories":["Python","Framework Agnostic","Windows Manager","وب و توسعه وب","Uncategorized","Sync"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalconry%2Ffalcon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffalconry%2Ffalcon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalconry%2Ffalcon/lists"}