{"id":14986489,"url":"https://github.com/0xsirsaif/frappe-api","last_synced_at":"2025-04-11T20:32:31.354Z","repository":{"id":254330069,"uuid":"825093329","full_name":"0xsirsaif/frappe-api","owner":"0xsirsaif","description":"FastAPI for Frappe","archived":false,"fork":false,"pushed_at":"2024-10-28T20:59:13.000Z","size":776,"stargazers_count":10,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-28T21:45:28.588Z","etag":null,"topics":["api","fastapi","frappe","openapi","openapi3","pydantic","pydantic-v2","python","swagger-ui"],"latest_commit_sha":null,"homepage":"https://0xsirsaif.github.io/frappe-api/","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/0xsirsaif.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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":"2024-07-06T18:48:18.000Z","updated_at":"2024-10-14T17:46:50.000Z","dependencies_parsed_at":"2024-10-28T21:45:28.193Z","dependency_job_id":null,"html_url":"https://github.com/0xsirsaif/frappe-api","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"e09348395378ca1830cd1e9d16f62ad19fb13269"},"previous_names":["0xsirsaif/frappe-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsirsaif%2Ffrappe-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsirsaif%2Ffrappe-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsirsaif%2Ffrappe-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsirsaif%2Ffrappe-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xsirsaif","download_url":"https://codeload.github.com/0xsirsaif/frappe-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223479565,"owners_count":17151931,"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","fastapi","frappe","openapi","openapi3","pydantic","pydantic-v2","python","swagger-ui"],"created_at":"2024-09-24T14:12:57.076Z","updated_at":"2025-04-11T20:32:31.345Z","avatar_url":"https://github.com/0xsirsaif.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FrappeAPI\n\nBetter APIs for Frappe!\n\n## Why?\n\nThe goal is to build a better API framework for Frappe.\n\n## Roadmap\n\n### Frappe Versions\n\n- [x] Frappe V14 support\n- [ ] Frappe V15 support\n\n### Methods\n\n- [x] Implement `app.get(...)` method.\n- [x] Implement `app.post(...)` method.\n- [x] Implement `app.put(...)` method.\n- [x] Implement `app.patch(...)` method\n- [x] Implement `app.delete(...)` method\n\n### Query Parameter Features\n\n- [x] Automatic query parameter parsing/conversion based on type hints.\n- [x] Required query parameters `needy: str`.\n- [x] Required query parameters with Ellipsis `...`. See [Pydantic Required Fields](https://docs.pydantic.dev/latest/concepts/models/#required-fields) and [FastAPI Required with Ellipsis](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#required-with-ellipsis).\n- [x] Optional query parameters with default values `skip: int = 0`.\n- [x] Optional query parameters without default values `limit: Union[int, None] = None`.\n- [x] Enum support for query parameters [path parameters - predefined values](https://fastapi.tiangolo.com/tutorial/path-params/#predefined-values).\n- [x] Boolean query parameters `is_admin: bool = False`. see [Pydantic's Boolean type](https://docs.pydantic.dev/2.0/usage/types/booleans/).\n- [x] List query parameters (i.e. a query parameter q that can appear multiple times in the URL, e.g. `?q=foo\u0026q=bar`)\n- [x] Aliases for query parameters. `q: str = Query(alias=\"query\")`\n- [x] Query parameters as Pydantic model. `filters: Filter`. See [Query Parameter Models](https://fastapi.tiangolo.com/tutorial/query-param-models/#query-parameter-models)\n- [x] Automatic Documentation generation for query parameters.\n\n### Body Parameter Features\n\n- [x] Body parameter as Pydantic model. `item: Item`\n- [x] Multiple body parameters. `item: Item, user: User`, resulting in `{\"item\": {\"name\": \"foo\"}, \"user\": {\"name\": \"bar\"}}`\n- [x] Singular values in body, defined as `Body()`. `name: str = Body()` so that to not conflict with query parameters.\n- [x] Special `embed` Body parameter. See [Embed a single body parameter](https://fastapi.tiangolo.com/tutorial/body-multiple-params/#embed-a-single-body-parameter)\n- [x] Nested Models for body parameters.\n- [x] Automatic body parameter parsing/conversion based on type hints.\n\n### Header Parameters\n\n- [x] Support header parameters like FastAPI did. See [Header Parameters](https://fastapi.tiangolo.com/tutorial/header-params/)\n- [ ] Header parameters as Pydantic model. See [Header Parameter Models](https://fastapi.tiangolo.com/tutorial/header-param-models/)\n- [ ] Duplicate header parameters.\n- [ ] Ability to forbid extra headers. `model_config={\"extra\": \"forbid\"}`\n\n### Cookie Parameters\n\n- [ ] Support cookie parameters like FastAPI did.\n\n### Form Data\n\n- [x] Define form field as `Form()`. `name: str = Form()`.\n- [x] Multiple form fields. `name: str = Form(), age: int = Form()`\n- [x] Form data as Pydantic model. `data: Data`\n- [ ] Ability to forbid extra form fields. `model_config={\"extra\": \"forbid\"}`\n\n### File Uploads\n\n- [x] Define file upload field as `File()`. `file: Annotated[bytes, File()]`, FrappeAPI will read the file for you and you will receive the contents as bytes with file-like interface. This means that the whole contents will be stored in memory. This will work well for small files.\n- [x] `UploadFile` for large files. `file: UploadFile`. Uses `tempfile.SpooledTemporaryFile` to store the file contents in memory or disk depending on the size. You get a file-like interface with the file contents streamed from the client to the server. `UploadFile` is FastAPI's, it supports async file handling, but FrappeAPI does not yet support async APIs, fortunately, `UploadFile` has `file` attribute to access the raw standard Python file (blocking, not async), useful and needed for non-async code.\n- [ ] Optional file upload field. `file: Annotated[bytes | None, File()] = None`\n- [ ] Optional `UploadFile` field. `file: UploadFile | None = None`\n- [ ] Multiple file upload fields. `files: Annotated[list[bytes], File()]`\n- [ ] Multiple `UploadFile` fields. `files: list[UploadFile]`\n\n### Handling Errors\n\n- [x] HTTPException\n- [x] RequestValidationError\n- [x] ResponseValidationError\n- [x] Register custom exception handlers. See [Add custom headers](https://fastapi.tiangolo.com/tutorial/handling-errors/#add-custom-headers)\n- [x] Override default exception handlers.\n- [ ] Maintain Frappe Transaction Management.\n\n### Response Models\n\n- [x] Method `response_model` parameter to define response model as Pydantic model. `response_model=Model`, `response_model=list[Model]` ...etc\n- [x] Response model as return type with standard type hints or Pydantic model. `-\u003e Model`, `-\u003e list[Model]`...etc\n- [x] Limit and filter the output data to what is defined in the return type.\n- [x] `response_model` parameter takes precedence over return type if both are provided.\n\n### Additional information and validation fields\n\n- [x] String validations, `min_length`, `max_length`, `pattern`.\n- [x] Numeric validations, `gt`, `ge`, `lt`, `le`.\n- [x] Metadata, `title`, `description`, `deprecated`.\n- [x] others, `include_in_schema`.\n\n### Rate Limiting\n\n- [ ] Support for rate limiting.\n\n### Dependencies\n\n- [ ] Support for dependencies.\n\n### Middleware\n\n- [ ] Support for middleware.\n\n### Miscellaneous\n\n- [ ] Debugging capabilities.\n\n## Related Frappe PRs and Issues\n\n- [PR #23135](https://github.com/frappe/frappe/pull/23135): Introducing type hints for API functions.\n- [PR #22300](https://github.com/frappe/frappe/pull/22300): Enhancing `frappe.whitelist()` functionality.\n- [PR #19029](https://github.com/frappe/frappe/pull/19029): Efforts to improve type safety in Frappe.\n- [Issue #14905](https://github.com/frappe/frappe/issues/14905): Discussion on improving API documentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xsirsaif%2Ffrappe-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xsirsaif%2Ffrappe-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xsirsaif%2Ffrappe-api/lists"}