How to install falcon
- Download and install ActivePython
- Open Command Prompt
- Type
pypm install falcon
Lastest release
Overview
Come hang out with us in #falconframework on freenode.
Falcon is a high-performance Python framework for building cloud APIs. It encourages the REST architectural style, and tries to do as little as possible while remaining highly effective.
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
Design Goals
Fast. Cloud APIs need to turn around requests quickly, and make efficient use of hardware. This is particularly important when serving many concurrent requests. Falcon processes requests several times faster than other popular web frameworks.
Light. Only the essentials are included, with six being the only dependency outside the standard library. We work to keep the code lean, making Falcon easier to test, optimize, and deploy.
Flexible. Falcon can be deployed in a variety of ways, depending on your needs. The framework speaks WSGI, and works great with Python 2.6 and 2.7, PyPy, and Python 3.3. There's no tight coupling with any async framework, leaving you free to mix-and-match what you need.
Features
- Intuitive routing via URI templates and resource classes
- Easy access to headers and bodies through request and response classes
- Idiomatic HTTP error responses via a handy exception base class
- DRY request processing using global, resource, and method hooks
- Snappy unit testing through WSGI helpers and mocks
- 20% speed boost when Cython is available
- Python 2.6, Python 2.7, PyPy and Python 3.3 support
- Speed, speed, and more speed!
Install
Test
To test across all supported Python versions:
Usage
Read the source, Luke!
Docstrings can be found throughout the Falcon code base for your learning pleasure. You can also ask questions in #falconframework on freenode. We are planning on having real docs eventually; if you need them right away, consider sending a pull request. ;)
Here is a simple example showing how to create a Falcon-based API.
You can run the above example using any WSGI server, such as uWSGI or Gunicorn. For example:
Then, in another terminal:
More Cowbell
Here is a more involved example that demonstrates reading headers and query parameters, handling errors, and working with request and response bodies.
Contributing
Kurt Griffiths (kgriffs) is the creator and current maintainer of the Falcon framework. Pull requests are always welcome.
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 (one-liners are OK for now but body and footer may be required as the project matures).
Comments follow Google's style guide.
Legal
Copyright 2013 by Rackspace Hosting, Inc.
Falcon image courtesy of John O'Neill.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the 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.