{"id":16053581,"url":"https://github.com/Bishwas-py/djapy","last_synced_at":"2025-10-22T08:30:29.767Z","repository":{"id":192989867,"uuid":"687879005","full_name":"Bishwas-py/djapy","owner":"Bishwas-py","description":"No bullshit, Django Rest API Framework","archived":false,"fork":false,"pushed_at":"2025-01-30T05:59:28.000Z","size":1394,"stargazers_count":79,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-03T15:51:49.249Z","etag":null,"topics":["django","django-api","django-rest-framework"],"latest_commit_sha":null,"homepage":"https://djapy.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bishwas-py.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-06T07:40:10.000Z","updated_at":"2025-02-03T13:07:52.000Z","dependencies_parsed_at":"2025-02-03T15:43:23.161Z","dependency_job_id":"a0d7943b-d160-4d05-9742-6080664b61e4","html_url":"https://github.com/Bishwas-py/djapy","commit_stats":null,"previous_names":["bishwas-py/djapy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bishwas-py%2Fdjapy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bishwas-py%2Fdjapy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bishwas-py%2Fdjapy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bishwas-py%2Fdjapy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bishwas-py","download_url":"https://codeload.github.com/Bishwas-py/djapy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237653878,"owners_count":19345125,"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","django-api","django-rest-framework"],"created_at":"2024-10-09T02:00:37.826Z","updated_at":"2025-10-22T08:30:29.761Z","avatar_url":"https://github.com/Bishwas-py.png","language":"Python","funding_links":[],"categories":["REST frameworks"],"sub_categories":["More"],"readme":"\u003e No Boilerplate, just rapid Django API ⚡️\n\nWrite powerful Django APIs with minimal code. Djapy combines Django's robustness with modern API development practices,\ngiving you a clean, intuitive way to build REST APIs.\n\n[![PyPI version](https://badge.fury.io/py/djapy.svg)](https://badge.fury.io/py/djapy)\n[![Python Versions](https://img.shields.io/pypi/pyversions/djapy.svg)](https://pypi.org/project/djapy)\n[![Django Versions](https://img.shields.io/badge/django-3.2%20%7C%204.0%20%7C%204.1%20%7C%204.2-blue)](https://github.com/Bishwas-py/djapy)\n[![Downloads](https://static.pepy.tech/badge/djapy)](https://pepy.tech/project/djapy)\n\n```python\n@djapify\ndef get_user(request, username: str) -\u003e UserSchema:\n   return User.objects.get(username=username)\n```\n\nThat's it. No serializers, no viewsets, no boilerplate - just pure Python.\n\n## ✨ Why Djapy?\n\nWrite Django REST APIs that are simple by default, powerful when needed. Djapy works seamlessly with Django's ecosystem\nwhile adding modern API features.\n\n```python\n# Works perfectly with Django decorators\n@cache_page(BASIC_CACHE_1_HOUR)\n@djapify\ndef get_posts(request, search: Optional[str] = None) -\u003e List[PostSchema]:\n   posts = Post.objects.all()\n   if search:\n      posts = posts.filter(title__icontains=search)\n   return posts\n\n\n# Need async? Just use async_djapify\n@async_djapify\n@paginate\nasync def get_comments(request, post_id: int) -\u003e List[CommentSchema]:\n   return await Comment.objects.filter(post_id=post_id).aall()\n```\n\n## 🚀 Key Features\n\n- **Zero Boilerplate**: Build APIs with pure Python\n- **Django Native**: Works seamlessly with Django's decorators and features\n- **Type Safety**: Full Python type hints with Pydantic\n- **Async When You Need It**: Optional async support for high-performance endpoints\n- **Smart Authentication**: Simple session auth, customizable when needed\n- **OpenAPI Support**: Automatic Swagger documentation\n- **IDE Friendly**: Full intellisense support\n\n## 🎯 Quick Start\n\n1. **Install Djapy**\n\n```bash\npip install djapy\n```\n\n2. **Create Your First API**\n\n```python\nfrom djapy import djapify, Schema\n\n\nclass PostSchema(Schema):\n   title: str\n   body: str\n   author: str\n\n\n@djapify\ndef create_post(request, data: PostSchema) -\u003e {201: PostSchema}:\n   post = Post.objects.create(**data.dict())\n   return 201, post\n\n\n# Want caching? Use Django's cache_page\n@cache_page(3600)\n@djapify\ndef get_post(request, post_id: int) -\u003e PostSchema:\n   return Post.objects.get(id=post_id)\n```\n\n## 🔥 Core Features\n\n### 1. Simple by Default, Powerful When Needed\n\n```python\n# Simple endpoint\n@djapify\ndef get_tag(request, tag_slug: str) -\u003e TagSchema:\n   return Tags.objects.get(slug=tag_slug)\n\n\n# Need more power? Add async and pagination\n@async_djapify\n@paginate\nasync def get_tag_posts(request, tag_slug: str) -\u003e List[PostSchema]:\n   tag = await Tags.objects.aget(slug=tag_slug)\n   return await tag.posts.aall()\n```\n\n### 2. Works with Django's Ecosystem\n\n```python\nfrom django.views.decorators.cache import cache_page\nfrom django.views.decorators.csrf import csrf_exempt\n\n\n@cache_page(3600)\n@csrf_exempt\n@djapify(method=\"POST\")\ndef create_user(request, data: UserSchema) -\u003e {201: UserSchema}:\n   user = User.objects.create(**data.dict())\n   return 201, user\n```\n\n### 3. Simple Authentication\n\n```python\n@djapify(auth=SessionAuth)\ndef get_profile(request) -\u003e ProfileSchema:\n   return request.user.profile\n\n\n# Need custom auth messages?\n@djapify(auth=SessionAuth, msg={\n   \"message\": \"Please log in first\",\n   \"redirect\": \"/login\"\n})\ndef protected_view(request) -\u003e ProtectedSchema:\n   return {\"data\": \"secret\"}\n```\n\n### 4. Type-Safe Responses\n\n```python\n@djapify\ndef get_post(request, post_id: int) -\u003e {\n   200: PostSchema,\n   404: MessageSchema\n}:\n   try:\n      return Post.objects.get(id=post_id)\n   except Post.DoesNotExist:\n      return 404, {\n         \"message\": \"Post not found\",\n         \"type\": \"error\"\n      }\n```\n\n## 🔄 Migration from DRF\n\n| DRF Concept | Djapy Equivalent                      |\n|-------------|---------------------------------------|\n| ViewSets    | Simple function views with `@djapify` |\n| Serializers | Pydantic Schema models                |\n| Permissions | Built-in auth system                  |\n| Filters     | Native Python parameters              |\n| Pagination  | `@paginate` decorator                 |\n\n## 📚 Documentation\n\nVisit [djapy-docs.pages.dev/](https://djapy-docs.pages.dev/) for comprehensive documentation.\n\n## 🤝 Community \u0026 Support\n\n- 📖 [Documentation](https://djapy.io)\n- 💬 [Community](https://webmatrices.com/tags/django)\n- 🐛 [Issue Tracker](https://github.com/Bishwas-py/djapy/issues)\n- 📦 [PyPI](https://pypi.org/project/djapy)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBishwas-py%2Fdjapy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBishwas-py%2Fdjapy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBishwas-py%2Fdjapy/lists"}