{"id":22122603,"url":"https://github.com/thorgate/tg-apicore","last_synced_at":"2025-07-25T14:30:58.566Z","repository":{"id":29689231,"uuid":"122488825","full_name":"thorgate/tg-apicore","owner":"thorgate","description":"Opinionated API framework on top of Django REST framework","archived":false,"fork":false,"pushed_at":"2022-12-26T20:35:57.000Z","size":73,"stargazers_count":13,"open_issues_count":4,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-21T11:12:14.514Z","etag":null,"topics":["api","django","django-rest-framework","json-api"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thorgate.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-22T14:22:45.000Z","updated_at":"2024-01-13T23:57:56.000Z","dependencies_parsed_at":"2023-01-14T15:27:47.963Z","dependency_job_id":null,"html_url":"https://github.com/thorgate/tg-apicore","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorgate%2Ftg-apicore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorgate%2Ftg-apicore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorgate%2Ftg-apicore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorgate%2Ftg-apicore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thorgate","download_url":"https://codeload.github.com/thorgate/tg-apicore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227584203,"owners_count":17789666,"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":["api","django","django-rest-framework","json-api"],"created_at":"2024-12-01T15:26:39.191Z","updated_at":"2024-12-01T15:26:39.699Z","avatar_url":"https://github.com/thorgate.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=================\nThorgate API Core\n=================\n\n\n.. image:: https://img.shields.io/pypi/v/tg-apicore.svg\n        :target: https://pypi.python.org/pypi/tg-apicore\n\n.. image:: https://img.shields.io/travis/thorgate/tg-apicore.svg\n        :target: https://travis-ci.org/thorgate/tg-apicore\n\n.. image:: https://readthedocs.org/projects/tg-apicore/badge/?version=latest\n        :target: https://tg-apicore.readthedocs.io/en/latest/?badge=latest\n        :alt: Documentation Status\n\n\nOpinionated API framework on top of Django REST framework\n\n\n* Free software: ISC license\n\nSupports Python 3.5+, Django 1.11+, Django REST framework 3.6+\n\n\nFeatures\n--------\n\n* API documentation automatically generated from your views\n    * General intro can be added\n    * You can add example request/response data\n    * Autogenerated Python `requests`-based examples\n    * Not interactive yet\n* Integrates `JSON API \u003chttp://jsonapi.org/\u003e`_\n    * Cursor pagination with configurable page size\n* Viewset classes for using different serializers and querysets for list/detail/edit endpoints\n* API-specific 404 view\n* Test utilities, e.g. for response validation\n* Versioning (WIP)\n    * Transformer-based approach, inspired by\n      `djangorestframework-version-transforms \u003chttps://github.com/mrhwick/django-rest-framework-version-transforms\u003e`_\n      and `Stripe \u003chttps://stripe.com/blog/api-versioning\u003e`_\n\n\nUsage\n-----\n\n- ``pip install tg-apicore``\n- Add ``tg_apicore`` to ``INSTALLED_APPS``\n- Ensure your ``REST_FRAMEWORK`` setting contains ``ALLOWED_VERSIONS``, e.g:\n\n  .. code:: python\n\n      # In your Django project settings:\n      REST_FRAMEWORK = {\n          'ALLOWED_VERSIONS': ('2018-01-01',),\n      }\n\n- Note that the default paginator requires that your models have ``created`` field\n\n- Create API documentation view by subclassing ``APIDocumentationView`` and making necessary modifications.\n  See ``example/example/views.py`` for example.\n- Add main API urls plus 404 view (as fallback).\n\n\nHere's an example ``urls.py``:\n\n.. code:: python\n\n    from tg_apicore.views import PageNotFoundView\n\n    from myproject.views import MyProjectAPIDocumentationView\n\n    urlpatterns = [\n        # The documentation view\n        url(r'^api-docs/', MyProjectAPIDocumentationView.as_view(), name='api-docs'),\n\n        # myproject.urls_api should contain your API urls patterns\n        url(r'^api/(?P\u003cversion\u003e(\\d{4}-\\d{2}-\\d{2}))/', include('myproject.urls_api')),\n\n        # API-specific 404 for everything under api/ prefix\n        url(r'^api/', include(PageNotFoundView.urlpatterns())),\n    ]\n\nSee ``example`` directory for a more in-depth demo.\n\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthorgate%2Ftg-apicore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthorgate%2Ftg-apicore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthorgate%2Ftg-apicore/lists"}