/usr/lib/python2.7/dist-packages/restless-2.0.1.egg-info/PKG-INFO is in python-restless 2.0.1-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | Metadata-Version: 1.1
Name: restless
Version: 2.0.1
Summary: A lightweight REST miniframework for Python.
Home-page: http://github.com/toastdriven/restless/
Author: Daniel Lindsley
Author-email: daniel@toastdriven.com
License: UNKNOWN
Description: ========
restless
========
.. image:: https://travis-ci.org/toastdriven/restless.png?branch=master
:target: https://travis-ci.org/toastdriven/restless
.. image:: https://coveralls.io/repos/toastdriven/restless/badge.png
:target: https://coveralls.io/r/toastdriven/restless
A lightweight REST miniframework for Python.
Documentation is at http://restless.readthedocs.org/.
Works great with Django_, Flask_, Pyramid_, Tornado_ & Itty_, but should be useful for
many other Python web frameworks. Based on the lessons learned from Tastypie_
& other REST libraries.
.. _Django: http://djangoproject.com/
.. _Flask: http://flask.pocoo.org/
.. _Pyramid: http://www.pylonsproject.org/
.. _Itty: https://pypi.python.org/pypi/itty
.. _Tastypie: http://tastypieapi.org/
.. _Tornado: http://www.tornadoweb.org/
Features
========
* Small, fast codebase
* JSON output by default, but overridable
* RESTful
* Python 3.3+ (with shims to make broke-ass Python 2.6+ work)
* Flexible
Anti-Features
=============
(Things that will never be added...)
* Automatic ORM integration
* Authorization (per-object or not)
* Extensive filtering options
* XML output (though you can implement your own)
* Metaclasses
* Mixins
* HATEOAS
Why?
====
Quite simply, I care about creating flexible & RESTFul APIs. In building
Tastypie, I tried to create something extremely complete & comprehensive.
The result was writing a lot of hook methods (for easy extensibility) & a lot
of (perceived) bloat, as I tried to accommodate for everything people might
want/need in a flexible/overridable manner.
But in reality, all I really ever personally want are the RESTful verbs, JSON
serialization & the ability of override behavior.
This one is written for me, but maybe it's useful to you.
Manifesto
=========
Rather than try to build something that automatically does the typically
correct thing within each of the views, it's up to you to implement the bodies
of various HTTP methods.
Example code:
.. code:: python
# posts/api.py
from django.contrib.auth.models import User
from restless.dj import DjangoResource
from restless.preparers import FieldsPreparer
from posts.models import Post
class PostResource(DjangoResource):
# Controls what data is included in the serialized output.
preparer = FieldsPreparer(fields={
'id': 'id',
'title': 'title',
'author': 'user.username',
'body': 'content',
'posted_on': 'posted_on',
})
# GET /
def list(self):
return Post.objects.all()
# GET /pk/
def detail(self, pk):
return Post.objects.get(id=pk)
# POST /
def create(self):
return Post.objects.create(
title=self.data['title'],
user=User.objects.get(username=self.data['author']),
content=self.data['body']
)
# PUT /pk/
def update(self, pk):
try:
post = Post.objects.get(id=pk)
except Post.DoesNotExist:
post = Post()
post.title = self.data['title']
post.user = User.objects.get(username=self.data['author'])
post.content = self.data['body']
post.save()
return post
# DELETE /pk/
def delete(self, pk):
Post.objects.get(id=pk).delete()
Hooking it up:
.. code:: python
# api/urls.py
from django.conf.urls.default import url, patterns, include
from posts.api import PostResource
urlpatterns = patterns('',
# The usual suspects, then...
url(r'^api/posts/', include(PostResource.urls())),
)
Licence
=======
BSD
Running the Tests
=================
Getting the tests running looks like:
.. code:: sh
$ virtualenv -p python3 env3
$ . env3/bin/activate
$ pip install -r test3_requirements.txt
$ export PYTHONPATH=`pwd`
$ py.test -s -v --cov=restless --cov-report=html tests
For Python 2:
.. code:: sh
$ virtualenv env2
$ . env2/bin/activate
$ pip install -r test2_requirements.txt
$ export PYTHONPATH=`pwd`
$ py.test -s -v --cov=restless --cov-report=html tests
Coverage is at about 94%, so please don't make it worse. :D
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Flask
Classifier: Framework :: Pyramid
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Utilities
Requires: six(>=1.4.0)
|