{"id":13502274,"url":"https://github.com/toastdriven/restless","last_synced_at":"2025-05-15T08:03:05.259Z","repository":{"id":13173219,"uuid":"15856370","full_name":"toastdriven/restless","owner":"toastdriven","description":"A lightweight REST miniframework for Python.","archived":false,"fork":false,"pushed_at":"2024-08-15T13:40:52.000Z","size":262,"stargazers_count":830,"open_issues_count":32,"forks_count":106,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-05-09T19:53:19.353Z","etag":null,"topics":["django","flask","hacktoberfest","hacktoberfest2021","python","restful-api"],"latest_commit_sha":null,"homepage":"http://restless.readthedocs.org/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toastdriven.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"docs/contributing.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security.rst","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-01-13T02:54:50.000Z","updated_at":"2025-04-15T14:48:22.000Z","dependencies_parsed_at":"2024-03-09T04:32:34.419Z","dependency_job_id":"cbb63820-3bda-4541-aa6f-8f79c05ccb21","html_url":"https://github.com/toastdriven/restless","commit_stats":{"total_commits":184,"total_committers":34,"mean_commits":5.411764705882353,"dds":0.6032608695652174,"last_synced_commit":"ce18b02886cce6d182d60661cb5c2eeeac215cf6"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toastdriven%2Frestless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toastdriven%2Frestless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toastdriven%2Frestless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toastdriven%2Frestless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toastdriven","download_url":"https://codeload.github.com/toastdriven/restless/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254301420,"owners_count":22047901,"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","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":["django","flask","hacktoberfest","hacktoberfest2021","python","restful-api"],"created_at":"2024-07-31T22:02:08.274Z","updated_at":"2025-05-15T08:03:05.173Z","avatar_url":"https://github.com/toastdriven.png","language":"Python","readme":"========\nrestless\n========\n\n.. image:: https://travis-ci.org/toastdriven/restless.svg?branch=master\n    :target: https://travis-ci.org/toastdriven/restless\n\n.. image:: https://coveralls.io/repos/github/toastdriven/restless/badge.svg?branch=master\n   :target: https://coveralls.io/github/toastdriven/restless?branch=master\n\n\nA lightweight REST miniframework for Python.\n\nDocumentation is at https://restless.readthedocs.io/.\n\nWorks great with Django_, Flask_, Pyramid_, Tornado_ \u0026 Itty_, but should be useful for\nmany other Python web frameworks. Based on the lessons learned from Tastypie_\n\u0026 other REST libraries.\n\n.. _Django: https://www.djangoproject.com/\n.. _Flask: http://flask.pocoo.org/\n.. _Pyramid: https://pylonsproject.org/\n.. _Itty: https://pypi.org/project/itty/\n.. _Tastypie: http://tastypieapi.org/\n.. _Tornado: https://www.tornadoweb.org/\n.. _tox: https://tox.readthedocs.io/\n\n\nFeatures\n========\n\n* Small, fast codebase\n* JSON output by default, but overridable\n* RESTful\n* Python 3.6+\n* Django 2.2+\n* Flexible\n\n\nAnti-Features\n=============\n\n(Things that will never be added...)\n\n* Automatic ORM integration\n* Authorization (per-object or not)\n* Extensive filtering options\n* XML output (though you can implement your own)\n* Metaclasses\n* Mixins\n* HATEOAS\n\n\nWhy?\n====\n\nQuite simply, I care about creating flexible \u0026 RESTFul APIs. In building\nTastypie, I tried to create something extremely complete \u0026 comprehensive.\nThe result was writing a lot of hook methods (for easy extensibility) \u0026 a lot\nof (perceived) bloat, as I tried to accommodate for everything people might\nwant/need in a flexible/overridable manner.\n\nBut in reality, all I really ever personally want are the RESTful verbs, JSON\nserialization \u0026 the ability of override behavior.\n\nThis one is written for me, but maybe it's useful to you.\n\n\nManifesto\n=========\n\nRather than try to build something that automatically does the typically\ncorrect thing within each of the views, it's up to you to implement the bodies\nof various HTTP methods.\n\nExample code:\n\n.. code:: python\n\n    # posts/api.py\n    from django.contrib.auth.models import User\n\n    from restless.dj import DjangoResource\n    from restless.preparers import FieldsPreparer\n\n    from posts.models import Post\n\n\n    class PostResource(DjangoResource):\n        # Controls what data is included in the serialized output.\n        preparer = FieldsPreparer(fields={\n            'id': 'id',\n            'title': 'title',\n            'author': 'user.username',\n            'body': 'content',\n            'posted_on': 'posted_on',\n        })\n\n        # GET /\n        def list(self):\n            return Post.objects.all()\n\n        # GET /pk/\n        def detail(self, pk):\n            return Post.objects.get(id=pk)\n\n        # POST /\n        def create(self):\n            return Post.objects.create(\n                title=self.data['title'],\n                user=User.objects.get(username=self.data['author']),\n                content=self.data['body']\n            )\n\n        # PUT /pk/\n        def update(self, pk):\n            try:\n                post = Post.objects.get(id=pk)\n            except Post.DoesNotExist:\n                post = Post()\n\n            post.title = self.data['title']\n            post.user = User.objects.get(username=self.data['author'])\n            post.content = self.data['body']\n            post.save()\n            return post\n\n        # DELETE /pk/\n        def delete(self, pk):\n            Post.objects.get(id=pk).delete()\n\nHooking it up:\n\n.. code:: python\n\n    # api/urls.py\n    from django.conf.urls.default import url, include\n\n    from posts.api import PostResource\n\n    urlpatterns = [\n        # The usual suspects, then...\n\n        url(r'^api/posts/', include(PostResource.urls())),\n    ]\n\n\nLicence\n=======\n\nBSD\n\n\nRunning the Tests\n=================\n\nThe test suite uses tox_ for simultaneous support of multiple versions of both\nPython and Django. The current versions of Python supported are:\n\n* CPython 3.6\n* CPython 3.7\n* CPython 3.8\n* CPython 3.9\n* PyPy\n\nYou just need to install the Python interpreters above and the `tox` package\n(available via `pip`), then run the `tox` command.\n","funding_links":[],"categories":["`API Frameworks`","RESTful API","Python","API Frameworks","Awesome Python"],"sub_categories":["Python","RESTful API"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoastdriven%2Frestless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoastdriven%2Frestless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoastdriven%2Frestless/lists"}