A JSON API web framework for lazy people.

nullism, updated 🕥 2022-04-05 16:32:03

HUG

Docs

pycnic.nullism.com/docs

Example

```python

example.py

from pycnic.core import WSGI, Handler

class Hello(Handler): def get(self, name="World"): return { "message":"Hello, %s!"%(name) }

class app(WSGI): routes = [ ('/', Hello()), ('/([\w]+)', Hello()) ] ```

Installation

Now that Pycnic is available on PyPI, it may be installed with pip.

pip install pycnic

Running

Pycnic may be ran with any WSGI-compliant server, such as Gunicorn.

gunicorn file:app

Releases

Some minor bugfixes. 2016-05-19 23:22:34

This release isn't anything special, but here are the key changes. - The handler's before method is no longer called on 404's. - If debug = True now properly returns indented, readable JSON for all JSON responses.

Version 0.0.8 2016-05-14 22:16:40

Contains a few optimizations and features added by @felixbuenemann.

Notably: 1. request.get_header('name', default=None) 2. Better caching of request object fields, such as data and cookies. 3. Many more supported HTTP statuses.

Also includes the ability to parse QUERY_STRING in requests.

Example: - self.request.args - Dictionary of parameters. - self.request.json_args - A json object passed via QUERY_STRING inside json=.