[Python-modules-commits] [api-hour] 01/04: import api-hour_0.8.1.orig.tar.gz

Piotr Ożarowski piotr at moszumanska.debian.org
Sat Jul 30 15:07:22 UTC 2016


This is an automated email from the git hooks/post-receive script.

piotr pushed a commit to branch master
in repository api-hour.

commit 2ddadd0d738c30effdc0fb7389682104c52973d1
Author: Piotr Ożarowski <piotr at debian.org>
Date:   Sat Jul 30 16:54:13 2016 +0200

    import api-hour_0.8.1.orig.tar.gz
---
 HISTORY.rst                            | 116 +++++++++++++++
 LICENSE                                |  13 ++
 MANIFEST.in                            |   6 +
 PKG-INFO                               | 248 +++++++++++++++++++++++++++++++++
 README.rst                             | 104 ++++++++++++++
 api_hour.egg-info/PKG-INFO             | 248 +++++++++++++++++++++++++++++++++
 api_hour.egg-info/SOURCES.txt          |  24 ++++
 api_hour.egg-info/dependency_links.txt |   1 +
 api_hour.egg-info/entry_points.txt     |   4 +
 api_hour.egg-info/requires.txt         |   3 +
 api_hour.egg-info/top_level.txt        |   2 +
 api_hour/__init__.py                   |  38 +++++
 api_hour/application.py                |  85 +++++++++++
 api_hour/config.py                     |  73 ++++++++++
 api_hour/container.py                  |  55 ++++++++
 api_hour/plugins/__init__.py           |   1 +
 api_hour/plugins/aiohttp/__init__.py   |  29 ++++
 api_hour/utils.py                      |   4 +
 api_hour/worker.py                     | 160 +++++++++++++++++++++
 setup.cfg                              |  11 ++
 setup.py                               |  74 ++++++++++
 test/__init__.py                       |   0
 test/plugins/__init__.py               |   0
 test/plugins/aiohttp/__init__.py       |   0
 test/plugins/aiohttp/test_serialize.py |  22 +++
 25 files changed, 1321 insertions(+)

diff --git a/HISTORY.rst b/HISTORY.rst
new file mode 100644
index 0000000..c2d2d7c
--- /dev/null
+++ b/HISTORY.rst
@@ -0,0 +1,116 @@
+CHANGES
+=======
+
+0.8.1 (2016-07-08)
+------------------
+
+* Drop support of Python 3.3 and 3.4
+
+0.7.1 (2016-07-08)
+------------------
+
+* Merge bugfix from https://github.com/KeepSafe/aiohttp/pull/879
+
+0.7.0 (2015-05-04)
+------------------
+
+* Add HTML serializer plugin
+* Add AsyncIO high level stream server support (Used by FastAGI implementation of Panoramisk)
+* Now, you can use make_handler method to connect directly your handlers with your sockets for more flexibility
+
+0.6.2 (2015-02-24)
+------------------
+
+* You can customize event loop used with make_event_loop() class method in Container
+
+0.6.1 (2015-02-10)
+------------------
+
+* Release a new version because PyPI is bugged: 0.6.0 is broken on PyPI
+
+0.6.0 (2015-01-13)
+------------------
+
+* API-Hour config file is now optional, use -ac to auto-configure your app
+* Add Python 3.3 compatibility to use easily Python 3 directly from distributions package
+* Add Debian/Ubuntu package
+* ujson is now optional for aiohttp.web
+* More documentation with tutorials: all-in-one and Starter Kit
+* If api_hour CLI has no logging file, enable logging on console by default
+
+0.5.0 (2015-01-07)
+------------------
+
+* Project reboot
+* Change API-Hour main goal: API-Hour can now multiprocess all AsyncIO lib server, not only HTTP
+* API-Hour is now based on Gunicorn
+* Remove aiorest fork, recommend to use aiohttp.web for HTTP daemons in cookiecutter
+
+0.3.3 (2014-12-19)
+------------------
+
+* Static files can be served automatically
+* body and json_body and transport accessible in Request
+* loop accessible in Application
+* Asset Serializer accepts encoding
+* cookiecutter available at https://github.com/Eyepea/cookiecutter-API-Hour
+* Use of ujson
+* Bugfixes
+
+0.3.2 (2014-10-31)
+------------------
+
+* Refactoring and clean-up
+* Publish benchmark server for API-Hour
+* English version of PyCON-FR presentation about API-Hour
+* Fix response.write_eof() to follow aiohttp changes (Thanks aiorest for the patch)
+
+0.3.1 (2014-10-28)
+------------------
+
+* Rename multi_process to arbiter
+* Improve Python packaging
+
+0.3.0 (2014-10-26)
+------------------
+
+* First version of API-Hour, performance oriented version of aiorest
+* cookiecutter template
+* Serialization support
+* replace json by ujson
+* basic multiprocessing
+
+0.2.4 (2014-09-12)
+------------------
+
+* Make loop keywork-only parameter in create_session_factory() function
+
+0.2.3 (2014-08-28)
+------------------
+
+* Redis session switched from asyncio_redis to aioredis
+
+0.2.2 (2014-08-15)
+------------------
+
+* Added Pyramid-like matchdict to request
+  (see https://github.com/aio-libs/aiorest/pull/18)
+
+* Return "400 Bad Request" for incorrect JSON body in POST/PUT methods
+
+* README fixed
+
+* Custom response status code
+  (see https://github.com/aio-libs/aiorest/pull/23)
+
+
+0.1.1 (2014-07-09)
+------------------
+
+* Switched to aiohttp v0.9.0
+
+
+0.1.0 (2014-07-07)
+------------------
+
+* Basic REST API
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..41a9656
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,13 @@
+Copyright [2015] [Eyepea Dev Team]
+
+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.
\ No newline at end of file
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..6675ee8
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,6 @@
+include LICENSE
+include README.rst
+include HISTORY.rst
+graft api_hour
+global-exclude *.pyc *.swp
+
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..ea00f73
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,248 @@
+Metadata-Version: 1.1
+Name: api_hour
+Version: 0.8.1
+Summary: Write efficient network daemons (HTTP, SSH...) with ease.
+Home-page: http://www.api-hour.io
+Author: Eyepea Dev Team
+Author-email: gmludo at gmail.com
+License: Apache 2
+Download-URL: https://pypi.python.org/pypi/api_hour
+Description: API Hour
+        ========
+        
+        API-Hour is a lightweight daemon framework, that lets you write powerful applications.
+        
+        It was created to answer the need for a simple, robust, and super-fast server-side environment to build very efficient Daemons with ease.
+        
+        By default, API-Hour Starter Kit (Cookiecutter) creates for you a HTTP daemon to develop WebServices.
+        
+        With API-Hour, you can quickly convert any AsyncIO server library to multi-processing daemon, ready for production.
+        
+        .. image:: https://raw.githubusercontent.com/Eyepea/API-Hour/master/docs/API-Hour_small.png
+        
+        Quick'n'dirty HTTP benchmarks on a kitchen table
+        ------------------------------------------------
+        
+        .. image:: https://raw.githubusercontent.com/Eyepea/API-Hour/master/propaganda/en/stats.png
+        
+        Scale: Number of queries during 30 seconds with 400 simultaneous connexions.
+        
+        Benchmark made on a Dell Precision M6800 between API-Hour and Gunicorn with 16 workers.
+        
+        For details, read information in `benchmarks <https://github.com/Eyepea/API-Hour/tree/master/benchmarks>`_.
+        
+        Where is the magic to have theses performances ?
+        ''''''''''''''''''''''''''''''''''''''''''''''''
+        
+        Architecture matters a lot more that tools.
+        
+        We use asynchronous and multiprocess patterns, combined together, to handle as much as possible HTTP requests.
+        
+        Ideally, the limitation should be your network card, not your CPU nor memory.
+        
+        Moreover, we've tried to reduce as much as possible layers between your code and async sockets.
+        
+        For each layer, we use the best in term of performance and simplicity:
+        
+        #. `AsyncIO <https://docs.python.org/3/library/asyncio.html>`_: an easy asynchronous framework, directly integrated in Python 3.4+
+        #. `aiohttp.web <http://aiohttp.readthedocs.org/en/latest/web.html>`_: HTTP protocol implementation for AsyncIO + Web framework
+        #. `ujson <https://github.com/esnme/ultrajson#ultrajson>`_: fastest JSON serialization
+        
+        Examples
+        --------
+        
+        #. `API-Hour Starter Kit (Cookiecutter) <https://github.com/Eyepea/cookiecutter-API-Hour>`_
+        #. `API-Hour implementation of TechEmpower Web Framework Benchmarks <https://github.com/Eyepea/FrameworkBenchmarks/tree/API-Hour/frameworks/Python/API-Hour>`_
+        #. `HTTP+SSH Daemon <https://github.com/Eyepea/API-Hour/tree/master/examples/http_and_ssh>`_
+        #. `Quick'n'dirty benchmarks on a kitchen table <https://github.com/Eyepea/API-Hour/tree/master/benchmarks/api_hour/benchmarks>`_
+        
+        How-to start an API-Hour project ?
+        ----------------------------------
+        
+        You can follow `one of our tutorials <http://pythonhosted.org/api_hour/tutorials/index.html>`_
+        
+        Support
+        -------
+        
+        * `Documentation <http://pythonhosted.org/api_hour/>`_.
+        * `Mailing-list <https://groups.google.com/d/forum/api-hour>`_
+        
+        Requirements
+        ------------
+        
+        - Python 3.3+
+        
+        Install
+        -------
+        
+        Follow `official documentation <http://pythonhosted.org/api_hour/installation.html>`_.
+        
+        License
+        -------
+        
+        ``API-Hour`` is offered under the Apache 2 license.
+        
+        Architecture
+        ------------
+        
+        ``API-Hour`` is a glue between your code and Gunicorn to launch your code in several process.
+        
+        Origin
+        ------
+        
+        API-Hour was a fork of aiorest, now only based on Gunicorn for multiprocessing.
+        
+        Thanks
+        ------
+        
+        Thanks to Gunicorn, aiorest, aiohttp and AsyncIO community, they made 99,9999% of the job for API-Hour.
+        
+        Special thanks to **Andrew Svetlov**, the creator of aiorest.
+        
+        Goals of API-Hour
+        -----------------
+        
+        #. **Fast**: API-Hour is designed from bottom-up to be extremely fast, and capable of handling a huge load. It uses Python 3 and its new powerful AsyncIO package.
+        #. **Scalable**: API-Hour is built to be elastic, and easily scalable.
+        #. **Lightweight**:
+            #. **small codebase**: Doing less means being faster: the codebase for processing an request is kept as small as possible. Beyond this base foot-print, you can of course activate, preload and initialize more plugins or packages , but that choice is yours.
+            #. **flexible setup**: Some people have no problems with using many dependencies, while others want to have none (other than Python). Some people are ok to loose a bit on performance, for the ease (and speed) of coding, while others wouldn't sacrifice a millisecond  for ready-made functionality. These choices are yours, so there are no mandatory extra layer, plugin or middleware.
+        #. **Easy**: API-Hour is meant to be very easy to grasp: No steep learning curve, no mountain of docs to read: Download our turn-key "Hello-world" applications, and immediately start coding your own application from there.
+        #. **Packages-friendly and friendly-packages**: We try to let you use external packages without the need to re-write them, adapt them,  " wrap " them or embed them in the framework. On the other hand, API-Hour " plugins " are written as much as possible to be usable as stand-alone packages outside the framework, to benefit to more people.
+        #. **Asynchronous... or not**: If you don't need the extra complexity of building asynchronous code, you don't have to (you'll still enjoy tremendous performance). You can just handle your requests in a traditional synchronous way. On the other hand, if your project does IO or processing that could benefit from parallelizing tasks, the whole power of Async. IO, futures, coroutines and tasks is at your fingertips. All provided plugins (in particular, Database plugins) are Async-ready.
+        
+        CHANGES
+        =======
+        
+        0.8.1 (2016-07-08)
+        ------------------
+        
+        * Drop support of Python 3.3 and 3.4
+        
+        0.7.1 (2016-07-08)
+        ------------------
+        
+        * Merge bugfix from https://github.com/KeepSafe/aiohttp/pull/879
+        
+        0.7.0 (2015-05-04)
+        ------------------
+        
+        * Add HTML serializer plugin
+        * Add AsyncIO high level stream server support (Used by FastAGI implementation of Panoramisk)
+        * Now, you can use make_handler method to connect directly your handlers with your sockets for more flexibility
+        
+        0.6.2 (2015-02-24)
+        ------------------
+        
+        * You can customize event loop used with make_event_loop() class method in Container
+        
+        0.6.1 (2015-02-10)
+        ------------------
+        
+        * Release a new version because PyPI is bugged: 0.6.0 is broken on PyPI
+        
+        0.6.0 (2015-01-13)
+        ------------------
+        
+        * API-Hour config file is now optional, use -ac to auto-configure your app
+        * Add Python 3.3 compatibility to use easily Python 3 directly from distributions package
+        * Add Debian/Ubuntu package
+        * ujson is now optional for aiohttp.web
+        * More documentation with tutorials: all-in-one and Starter Kit
+        * If api_hour CLI has no logging file, enable logging on console by default
+        
+        0.5.0 (2015-01-07)
+        ------------------
+        
+        * Project reboot
+        * Change API-Hour main goal: API-Hour can now multiprocess all AsyncIO lib server, not only HTTP
+        * API-Hour is now based on Gunicorn
+        * Remove aiorest fork, recommend to use aiohttp.web for HTTP daemons in cookiecutter
+        
+        0.3.3 (2014-12-19)
+        ------------------
+        
+        * Static files can be served automatically
+        * body and json_body and transport accessible in Request
+        * loop accessible in Application
+        * Asset Serializer accepts encoding
+        * cookiecutter available at https://github.com/Eyepea/cookiecutter-API-Hour
+        * Use of ujson
+        * Bugfixes
+        
+        0.3.2 (2014-10-31)
+        ------------------
+        
+        * Refactoring and clean-up
+        * Publish benchmark server for API-Hour
+        * English version of PyCON-FR presentation about API-Hour
+        * Fix response.write_eof() to follow aiohttp changes (Thanks aiorest for the patch)
+        
+        0.3.1 (2014-10-28)
+        ------------------
+        
+        * Rename multi_process to arbiter
+        * Improve Python packaging
+        
+        0.3.0 (2014-10-26)
+        ------------------
+        
+        * First version of API-Hour, performance oriented version of aiorest
+        * cookiecutter template
+        * Serialization support
+        * replace json by ujson
+        * basic multiprocessing
+        
+        0.2.4 (2014-09-12)
+        ------------------
+        
+        * Make loop keywork-only parameter in create_session_factory() function
+        
+        0.2.3 (2014-08-28)
+        ------------------
+        
+        * Redis session switched from asyncio_redis to aioredis
+        
+        0.2.2 (2014-08-15)
+        ------------------
+        
+        * Added Pyramid-like matchdict to request
+          (see https://github.com/aio-libs/aiorest/pull/18)
+        
+        * Return "400 Bad Request" for incorrect JSON body in POST/PUT methods
+        
+        * README fixed
+        
+        * Custom response status code
+          (see https://github.com/aio-libs/aiorest/pull/23)
+        
+        
+        0.1.1 (2014-07-09)
+        ------------------
+        
+        * Switched to aiohttp v0.9.0
+        
+        
+        0.1.0 (2014-07-07)
+        ------------------
+        
+        * Basic REST API
+Keywords: asyncio,performance,efficient,web,service,rest,json,daemon,application
+Platform: OS Independent
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Environment :: No Input/Output (Daemon)
+Classifier: Environment :: Web Environment
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: Apache Software License
+Classifier: Natural Language :: English
+Classifier: Operating System :: OS Independent
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3 :: Only
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Topic :: Internet :: WWW/HTTP
+Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
+Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
+Classifier: Topic :: System :: Networking
+Provides: api_hour
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..0f5cbe1
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,104 @@
+API Hour
+========
+
+API-Hour is a lightweight daemon framework, that lets you write powerful applications.
+
+It was created to answer the need for a simple, robust, and super-fast server-side environment to build very efficient Daemons with ease.
+
+By default, API-Hour Starter Kit (Cookiecutter) creates for you a HTTP daemon to develop WebServices.
+
+With API-Hour, you can quickly convert any AsyncIO server library to multi-processing daemon, ready for production.
+
+.. image:: https://raw.githubusercontent.com/Eyepea/API-Hour/master/docs/API-Hour_small.png
+
+Quick'n'dirty HTTP benchmarks on a kitchen table
+------------------------------------------------
+
+.. image:: https://raw.githubusercontent.com/Eyepea/API-Hour/master/propaganda/en/stats.png
+
+Scale: Number of queries during 30 seconds with 400 simultaneous connexions.
+
+Benchmark made on a Dell Precision M6800 between API-Hour and Gunicorn with 16 workers.
+
+For details, read information in `benchmarks <https://github.com/Eyepea/API-Hour/tree/master/benchmarks>`_.
+
+Where is the magic to have theses performances ?
+''''''''''''''''''''''''''''''''''''''''''''''''
+
+Architecture matters a lot more that tools.
+
+We use asynchronous and multiprocess patterns, combined together, to handle as much as possible HTTP requests.
+
+Ideally, the limitation should be your network card, not your CPU nor memory.
+
+Moreover, we've tried to reduce as much as possible layers between your code and async sockets.
+
+For each layer, we use the best in term of performance and simplicity:
+
+#. `AsyncIO <https://docs.python.org/3/library/asyncio.html>`_: an easy asynchronous framework, directly integrated in Python 3.4+
+#. `aiohttp.web <http://aiohttp.readthedocs.org/en/latest/web.html>`_: HTTP protocol implementation for AsyncIO + Web framework
+#. `ujson <https://github.com/esnme/ultrajson#ultrajson>`_: fastest JSON serialization
+
+Examples
+--------
+
+#. `API-Hour Starter Kit (Cookiecutter) <https://github.com/Eyepea/cookiecutter-API-Hour>`_
+#. `API-Hour implementation of TechEmpower Web Framework Benchmarks <https://github.com/Eyepea/FrameworkBenchmarks/tree/API-Hour/frameworks/Python/API-Hour>`_
+#. `HTTP+SSH Daemon <https://github.com/Eyepea/API-Hour/tree/master/examples/http_and_ssh>`_
+#. `Quick'n'dirty benchmarks on a kitchen table <https://github.com/Eyepea/API-Hour/tree/master/benchmarks/api_hour/benchmarks>`_
+
+How-to start an API-Hour project ?
+----------------------------------
+
+You can follow `one of our tutorials <http://pythonhosted.org/api_hour/tutorials/index.html>`_
+
+Support
+-------
+
+* `Documentation <http://pythonhosted.org/api_hour/>`_.
+* `Mailing-list <https://groups.google.com/d/forum/api-hour>`_
+
+Requirements
+------------
+
+- Python 3.3+
+
+Install
+-------
+
+Follow `official documentation <http://pythonhosted.org/api_hour/installation.html>`_.
+
+License
+-------
+
+``API-Hour`` is offered under the Apache 2 license.
+
+Architecture
+------------
+
+``API-Hour`` is a glue between your code and Gunicorn to launch your code in several process.
+
+Origin
+------
+
+API-Hour was a fork of aiorest, now only based on Gunicorn for multiprocessing.
+
+Thanks
+------
+
+Thanks to Gunicorn, aiorest, aiohttp and AsyncIO community, they made 99,9999% of the job for API-Hour.
+
+Special thanks to **Andrew Svetlov**, the creator of aiorest.
+
+Goals of API-Hour
+-----------------
+
+#. **Fast**: API-Hour is designed from bottom-up to be extremely fast, and capable of handling a huge load. It uses Python 3 and its new powerful AsyncIO package.
+#. **Scalable**: API-Hour is built to be elastic, and easily scalable.
+#. **Lightweight**:
+    #. **small codebase**: Doing less means being faster: the codebase for processing an request is kept as small as possible. Beyond this base foot-print, you can of course activate, preload and initialize more plugins or packages , but that choice is yours.
+    #. **flexible setup**: Some people have no problems with using many dependencies, while others want to have none (other than Python). Some people are ok to loose a bit on performance, for the ease (and speed) of coding, while others wouldn't sacrifice a millisecond  for ready-made functionality. These choices are yours, so there are no mandatory extra layer, plugin or middleware.
+#. **Easy**: API-Hour is meant to be very easy to grasp: No steep learning curve, no mountain of docs to read: Download our turn-key "Hello-world" applications, and immediately start coding your own application from there.
+#. **Packages-friendly and friendly-packages**: We try to let you use external packages without the need to re-write them, adapt them,  " wrap " them or embed them in the framework. On the other hand, API-Hour " plugins " are written as much as possible to be usable as stand-alone packages outside the framework, to benefit to more people.
+#. **Asynchronous... or not**: If you don't need the extra complexity of building asynchronous code, you don't have to (you'll still enjoy tremendous performance). You can just handle your requests in a traditional synchronous way. On the other hand, if your project does IO or processing that could benefit from parallelizing tasks, the whole power of Async. IO, futures, coroutines and tasks is at your fingertips. All provided plugins (in particular, Database plugins) are Async-ready.
+
diff --git a/api_hour.egg-info/PKG-INFO b/api_hour.egg-info/PKG-INFO
new file mode 100644
index 0000000..527f1c4
--- /dev/null
+++ b/api_hour.egg-info/PKG-INFO
@@ -0,0 +1,248 @@
+Metadata-Version: 1.1
+Name: api-hour
+Version: 0.8.1
+Summary: Write efficient network daemons (HTTP, SSH...) with ease.
+Home-page: http://www.api-hour.io
+Author: Eyepea Dev Team
+Author-email: gmludo at gmail.com
+License: Apache 2
+Download-URL: https://pypi.python.org/pypi/api_hour
+Description: API Hour
+        ========
+        
+        API-Hour is a lightweight daemon framework, that lets you write powerful applications.
+        
+        It was created to answer the need for a simple, robust, and super-fast server-side environment to build very efficient Daemons with ease.
+        
+        By default, API-Hour Starter Kit (Cookiecutter) creates for you a HTTP daemon to develop WebServices.
+        
+        With API-Hour, you can quickly convert any AsyncIO server library to multi-processing daemon, ready for production.
+        
+        .. image:: https://raw.githubusercontent.com/Eyepea/API-Hour/master/docs/API-Hour_small.png
+        
+        Quick'n'dirty HTTP benchmarks on a kitchen table
+        ------------------------------------------------
+        
+        .. image:: https://raw.githubusercontent.com/Eyepea/API-Hour/master/propaganda/en/stats.png
+        
+        Scale: Number of queries during 30 seconds with 400 simultaneous connexions.
+        
+        Benchmark made on a Dell Precision M6800 between API-Hour and Gunicorn with 16 workers.
+        
+        For details, read information in `benchmarks <https://github.com/Eyepea/API-Hour/tree/master/benchmarks>`_.
+        
+        Where is the magic to have theses performances ?
+        ''''''''''''''''''''''''''''''''''''''''''''''''
+        
+        Architecture matters a lot more that tools.
+        
+        We use asynchronous and multiprocess patterns, combined together, to handle as much as possible HTTP requests.
+        
+        Ideally, the limitation should be your network card, not your CPU nor memory.
+        
+        Moreover, we've tried to reduce as much as possible layers between your code and async sockets.
+        
+        For each layer, we use the best in term of performance and simplicity:
+        
+        #. `AsyncIO <https://docs.python.org/3/library/asyncio.html>`_: an easy asynchronous framework, directly integrated in Python 3.4+
+        #. `aiohttp.web <http://aiohttp.readthedocs.org/en/latest/web.html>`_: HTTP protocol implementation for AsyncIO + Web framework
+        #. `ujson <https://github.com/esnme/ultrajson#ultrajson>`_: fastest JSON serialization
+        
+        Examples
+        --------
+        
+        #. `API-Hour Starter Kit (Cookiecutter) <https://github.com/Eyepea/cookiecutter-API-Hour>`_
+        #. `API-Hour implementation of TechEmpower Web Framework Benchmarks <https://github.com/Eyepea/FrameworkBenchmarks/tree/API-Hour/frameworks/Python/API-Hour>`_
+        #. `HTTP+SSH Daemon <https://github.com/Eyepea/API-Hour/tree/master/examples/http_and_ssh>`_
+        #. `Quick'n'dirty benchmarks on a kitchen table <https://github.com/Eyepea/API-Hour/tree/master/benchmarks/api_hour/benchmarks>`_
+        
+        How-to start an API-Hour project ?
+        ----------------------------------
+        
+        You can follow `one of our tutorials <http://pythonhosted.org/api_hour/tutorials/index.html>`_
+        
+        Support
+        -------
+        
+        * `Documentation <http://pythonhosted.org/api_hour/>`_.
+        * `Mailing-list <https://groups.google.com/d/forum/api-hour>`_
+        
+        Requirements
+        ------------
+        
+        - Python 3.3+
+        
+        Install
+        -------
+        
+        Follow `official documentation <http://pythonhosted.org/api_hour/installation.html>`_.
+        
+        License
+        -------
+        
+        ``API-Hour`` is offered under the Apache 2 license.
+        
+        Architecture
+        ------------
+        
+        ``API-Hour`` is a glue between your code and Gunicorn to launch your code in several process.
+        
+        Origin
+        ------
+        
+        API-Hour was a fork of aiorest, now only based on Gunicorn for multiprocessing.
+        
+        Thanks
+        ------
+        
+        Thanks to Gunicorn, aiorest, aiohttp and AsyncIO community, they made 99,9999% of the job for API-Hour.
+        
+        Special thanks to **Andrew Svetlov**, the creator of aiorest.
+        
+        Goals of API-Hour
+        -----------------
+        
+        #. **Fast**: API-Hour is designed from bottom-up to be extremely fast, and capable of handling a huge load. It uses Python 3 and its new powerful AsyncIO package.
+        #. **Scalable**: API-Hour is built to be elastic, and easily scalable.
+        #. **Lightweight**:
+            #. **small codebase**: Doing less means being faster: the codebase for processing an request is kept as small as possible. Beyond this base foot-print, you can of course activate, preload and initialize more plugins or packages , but that choice is yours.
+            #. **flexible setup**: Some people have no problems with using many dependencies, while others want to have none (other than Python). Some people are ok to loose a bit on performance, for the ease (and speed) of coding, while others wouldn't sacrifice a millisecond  for ready-made functionality. These choices are yours, so there are no mandatory extra layer, plugin or middleware.
+        #. **Easy**: API-Hour is meant to be very easy to grasp: No steep learning curve, no mountain of docs to read: Download our turn-key "Hello-world" applications, and immediately start coding your own application from there.
+        #. **Packages-friendly and friendly-packages**: We try to let you use external packages without the need to re-write them, adapt them,  " wrap " them or embed them in the framework. On the other hand, API-Hour " plugins " are written as much as possible to be usable as stand-alone packages outside the framework, to benefit to more people.
+        #. **Asynchronous... or not**: If you don't need the extra complexity of building asynchronous code, you don't have to (you'll still enjoy tremendous performance). You can just handle your requests in a traditional synchronous way. On the other hand, if your project does IO or processing that could benefit from parallelizing tasks, the whole power of Async. IO, futures, coroutines and tasks is at your fingertips. All provided plugins (in particular, Database plugins) are Async-ready.
+        
+        CHANGES
+        =======
+        
+        0.8.1 (2016-07-08)
+        ------------------
+        
+        * Drop support of Python 3.3 and 3.4
+        
+        0.7.1 (2016-07-08)
+        ------------------
+        
+        * Merge bugfix from https://github.com/KeepSafe/aiohttp/pull/879
+        
+        0.7.0 (2015-05-04)
+        ------------------
+        
+        * Add HTML serializer plugin
+        * Add AsyncIO high level stream server support (Used by FastAGI implementation of Panoramisk)
+        * Now, you can use make_handler method to connect directly your handlers with your sockets for more flexibility
+        
+        0.6.2 (2015-02-24)
+        ------------------
+        
+        * You can customize event loop used with make_event_loop() class method in Container
+        
+        0.6.1 (2015-02-10)
+        ------------------
+        
+        * Release a new version because PyPI is bugged: 0.6.0 is broken on PyPI
+        
+        0.6.0 (2015-01-13)
+        ------------------
+        
+        * API-Hour config file is now optional, use -ac to auto-configure your app
+        * Add Python 3.3 compatibility to use easily Python 3 directly from distributions package
+        * Add Debian/Ubuntu package
+        * ujson is now optional for aiohttp.web
+        * More documentation with tutorials: all-in-one and Starter Kit
+        * If api_hour CLI has no logging file, enable logging on console by default
+        
+        0.5.0 (2015-01-07)
+        ------------------
+        
+        * Project reboot
+        * Change API-Hour main goal: API-Hour can now multiprocess all AsyncIO lib server, not only HTTP
+        * API-Hour is now based on Gunicorn
+        * Remove aiorest fork, recommend to use aiohttp.web for HTTP daemons in cookiecutter
+        
+        0.3.3 (2014-12-19)
+        ------------------
+        
+        * Static files can be served automatically
+        * body and json_body and transport accessible in Request
+        * loop accessible in Application
+        * Asset Serializer accepts encoding
+        * cookiecutter available at https://github.com/Eyepea/cookiecutter-API-Hour
+        * Use of ujson
+        * Bugfixes
+        
+        0.3.2 (2014-10-31)
+        ------------------
+        
+        * Refactoring and clean-up
+        * Publish benchmark server for API-Hour
+        * English version of PyCON-FR presentation about API-Hour
+        * Fix response.write_eof() to follow aiohttp changes (Thanks aiorest for the patch)
+        
+        0.3.1 (2014-10-28)
+        ------------------
+        
+        * Rename multi_process to arbiter
+        * Improve Python packaging
+        
+        0.3.0 (2014-10-26)
+        ------------------
+        
+        * First version of API-Hour, performance oriented version of aiorest
+        * cookiecutter template
+        * Serialization support
+        * replace json by ujson
+        * basic multiprocessing
+        
+        0.2.4 (2014-09-12)
+        ------------------
+        
+        * Make loop keywork-only parameter in create_session_factory() function
+        
+        0.2.3 (2014-08-28)
+        ------------------
+        
+        * Redis session switched from asyncio_redis to aioredis
+        
+        0.2.2 (2014-08-15)
+        ------------------
+        
+        * Added Pyramid-like matchdict to request
+          (see https://github.com/aio-libs/aiorest/pull/18)
+        
+        * Return "400 Bad Request" for incorrect JSON body in POST/PUT methods
+        
+        * README fixed
+        
+        * Custom response status code
+          (see https://github.com/aio-libs/aiorest/pull/23)
+        
+        
+        0.1.1 (2014-07-09)
+        ------------------
+        
+        * Switched to aiohttp v0.9.0
+        
+        
+        0.1.0 (2014-07-07)
+        ------------------
+        
+        * Basic REST API
+Keywords: asyncio,performance,efficient,web,service,rest,json,daemon,application
+Platform: OS Independent
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Environment :: No Input/Output (Daemon)
+Classifier: Environment :: Web Environment
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: Apache Software License
+Classifier: Natural Language :: English
+Classifier: Operating System :: OS Independent
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3 :: Only
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Topic :: Internet :: WWW/HTTP
+Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
+Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
+Classifier: Topic :: System :: Networking
+Provides: api_hour
diff --git a/api_hour.egg-info/SOURCES.txt b/api_hour.egg-info/SOURCES.txt
new file mode 100644
index 0000000..9a9ccfc
--- /dev/null
+++ b/api_hour.egg-info/SOURCES.txt
@@ -0,0 +1,24 @@
+HISTORY.rst
+LICENSE
+MANIFEST.in
+README.rst
+setup.cfg
+setup.py
+api_hour/__init__.py
+api_hour/application.py
+api_hour/config.py
+api_hour/container.py
+api_hour/utils.py
+api_hour/worker.py
+api_hour.egg-info/PKG-INFO
+api_hour.egg-info/SOURCES.txt
+api_hour.egg-info/dependency_links.txt
+api_hour.egg-info/entry_points.txt
+api_hour.egg-info/requires.txt
+api_hour.egg-info/top_level.txt
+api_hour/plugins/__init__.py
+api_hour/plugins/aiohttp/__init__.py
+test/__init__.py
+test/plugins/__init__.py
+test/plugins/aiohttp/__init__.py
+test/plugins/aiohttp/test_serialize.py
\ No newline at end of file
diff --git a/api_hour.egg-info/dependency_links.txt b/api_hour.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/api_hour.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/api_hour.egg-info/entry_points.txt b/api_hour.egg-info/entry_points.txt
new file mode 100644
index 0000000..1070ea4
--- /dev/null
+++ b/api_hour.egg-info/entry_points.txt
@@ -0,0 +1,4 @@
+
+      [console_scripts]
+      api_hour=api_hour.application:run
+      
\ No newline at end of file
diff --git a/api_hour.egg-info/requires.txt b/api_hour.egg-info/requires.txt
new file mode 100644
index 0000000..4012801
--- /dev/null
+++ b/api_hour.egg-info/requires.txt
@@ -0,0 +1,3 @@
+gunicorn
+PyYAML
+setproctitle
diff --git a/api_hour.egg-info/top_level.txt b/api_hour.egg-info/top_level.txt
new file mode 100644
index 0000000..814a34e
--- /dev/null
+++ b/api_hour.egg-info/top_level.txt
@@ -0,0 +1,2 @@
+api_hour
+test
diff --git a/api_hour/__init__.py b/api_hour/__init__.py
new file mode 100644
index 0000000..8d75736
--- /dev/null
+++ b/api_hour/__init__.py
@@ -0,0 +1,38 @@
+import re
+import sys
+import collections
+
+__author__ = 'Ludovic Gasc (GMLudo)'
+__email__ = 'git at gmludo.eu'
+__version__ = '0.8.1'
+version = __version__ + ' , Python ' + sys.version
+
+
+VersionInfo = collections.namedtuple('VersionInfo',
+                                     'major minor micro releaselevel serial')
+
+
+def _parse_version(ver):
+    RE = (r'^(?P<major>\d+)\.(?P<minor>\d+)\.'
+          '(?P<micro>\d+)((?P<releaselevel>[a-z]+)(?P<serial>\d+)?)?$')
+    match = re.match(RE, ver)
+    try:
+        major = int(match.group('major'))
+        minor = int(match.group('minor'))
+        micro = int(match.group('micro'))
+        levels = {'c': 'candidate',
+                  'a': 'alpha',
+                  'b': 'beta',
+                  None: 'final'}
+        releaselevel = levels[match.group('releaselevel')]
+        serial = int(match.group('serial')) if match.group('serial') else 0
+        return VersionInfo(major, minor, micro, releaselevel, serial)
+    except Exception:
+        raise ImportError("Invalid package version {}".format(ver))
+
+
+version_info = _parse_version(__version__)
+
+from .application import Application
+from .container import Container
+from .worker import Worker
\ No newline at end of file
diff --git a/api_hour/application.py b/api_hour/application.py
new file mode 100644
index 0000000..19d5845
--- /dev/null
+++ b/api_hour/application.py
@@ -0,0 +1,85 @@
+# This file is part of API-Hour, forked from gunicorn/app/wsgiapp.py released under the MIT license.
+import logging
+import os
+import sys
+
+from gunicorn.app.base import Application as GunicornApp
+from gunicorn import util
+from gunicorn.config import Config
+
+from .config import get_config
+
+
+class Application(GunicornApp):
+    def init(self, parser, opts, args):
+        if len(args) < 1:
+            parser.error("No application module specified.")
+
+        self.cfg.set("default_proc_name", args[0])
+        self.app_uri = args[0]
+
+        logging.captureWarnings(True)
+        if opts.auto_config:
+            # Default config_dir
+            config_dir = os.path.join(self.cfg.chdir,
+                                      'etc',
+                                      self.app_uri.split(":", 1)[0])
+            if os.path.exists(config_dir):
+                self.cfg.set('config_dir', config_dir)  # Define dev etc folder as default config directory
+
+            # generate config_dir directly: egg or chicken problem
+            if opts.config_dir:
+                self.cfg.set('config_dir', opts.config_dir)
+
+            if not opts.config:
+                opts.config = os.path.join(self.cfg.config_dir, 'api_hour/gunicorn_conf.py')
+
+            if not self.cfg.logconfig:
+                self.cfg.set('logconfig', os.path.join(self.cfg.config_dir, 'api_hour/logging.ini'))
+        else:
+            # To avoid with Gunicorn 19 that the console it's empty when you test
+            if not opts.errorlog:
+                opts.errorlog = '-'
+            if not opts.accesslog:
+                opts.accesslog = '-'
+
+    def load_default_config(self):
+        # init configuration
+        self.cfg = Config(self.usage, prog=self.prog)
+        self.cfg.set('worker_class', 'api_hour.Worker')  # Define api_hour.Worker as default
+
+    def load_config(self):
+        # parse console args
+        super().load_config()
+        if self.cfg.config_dir:
+            self.config = get_config({'config_dir': self.cfg.config_dir})
+        else:
+            self.config = None
+        # import ipdb; ipdb.set_trace()
+
+    def chdir(self):
+        # chdir to the configured path before loading,
+        # default is the current dir
+        os.chdir(self.cfg.chdir)
+
+        # add the path to sys.path
+        sys.path.insert(0, self.cfg.chdir)
+
+    def load(self):
+        self.chdir()
+
+        # load the app
+        return util.import_app(self.app_uri)
+
+
+def run():
+    """\
+    The ``api_hour`` command line runner for launching API-Hour with container.
+    """
... 501 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/api-hour.git



More information about the Python-modules-commits mailing list