resource-engine-fastapi 0.1.0__tar.gz → 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/.gitignore +1 -0
  2. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/CHANGELOG.md +7 -0
  3. resource_engine_fastapi-0.1.1/PKG-INFO +109 -0
  4. resource_engine_fastapi-0.1.1/README.md +82 -0
  5. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/pyproject.toml +2 -2
  6. resource_engine_fastapi-0.1.0/PKG-INFO +0 -32
  7. resource_engine_fastapi-0.1.0/README.md +0 -5
  8. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/LICENSE +0 -0
  9. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/__init__.py +0 -0
  10. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/access.py +0 -0
  11. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/asyncapi.py +0 -0
  12. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/auth.py +0 -0
  13. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/authz.py +0 -0
  14. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/caching.py +0 -0
  15. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/docs.py +0 -0
  16. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/documents.py +0 -0
  17. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/email_events.py +0 -0
  18. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/errors.py +0 -0
  19. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/events.py +0 -0
  20. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/__init__.py +0 -0
  21. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/assets/auth.js +0 -0
  22. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/assets/console.js +0 -0
  23. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/assets/events.js +0 -0
  24. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/assets/explorer.css +0 -0
  25. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/assets/explorer.js +0 -0
  26. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/assets/jobs.js +0 -0
  27. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/assets/messages.js +0 -0
  28. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/assets/publish.js +0 -0
  29. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/data.py +0 -0
  30. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/events.py +0 -0
  31. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/jobs.py +0 -0
  32. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/labels.py +0 -0
  33. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/locale/ca/LC_MESSAGES/explorer.mo +0 -0
  34. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/locale/ca/LC_MESSAGES/explorer.po +0 -0
  35. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/locale/es/LC_MESSAGES/explorer.mo +0 -0
  36. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/locale/es/LC_MESSAGES/explorer.po +0 -0
  37. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/messages.py +0 -0
  38. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/explorer/publish.py +0 -0
  39. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/exports.py +0 -0
  40. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/i18n.py +0 -0
  41. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/py.typed +0 -0
  42. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/router.py +0 -0
  43. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/src/resource_engine_fastapi/versioning.py +0 -0
  44. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/tests/test_api_versions.py +0 -0
  45. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/tests/test_asyncapi_route.py +0 -0
  46. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/tests/test_authz_routes.py +0 -0
  47. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/tests/test_bearer_auth.py +0 -0
  48. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/tests/test_docs_mount.py +0 -0
  49. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/tests/test_document_routes.py +0 -0
  50. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/tests/test_email_events.py +0 -0
  51. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/tests/test_event_receiver.py +0 -0
  52. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/tests/test_explorer.py +0 -0
  53. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/tests/test_export_route.py +0 -0
  54. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/tests/test_locale.py +0 -0
  55. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/tests/test_polymorphic_api.py +0 -0
  56. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/tests/test_rate_limits.py +0 -0
  57. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/tests/test_tenant_routes.py +0 -0
  58. {resource_engine_fastapi-0.1.0 → resource_engine_fastapi-0.1.1}/tests/test_version_routes.py +0 -0
@@ -16,3 +16,4 @@ reviews/
16
16
  .coverage.*
17
17
  htmlcov/
18
18
  python-coverage-comment-action.txt
19
+ _build/
@@ -6,6 +6,13 @@ Notable changes to this package, newest first. Versions follow
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## 0.1.1 (2026-12-05)
10
+
11
+ Documentation only: no change to the code's behaviour.
12
+
13
+ - The README describes the adapter and the routes it serves, and links to the [documentation site](https://eloisans.github.io/python-resource-engine/)
14
+ - The Documentation link points to the documentation site
15
+
9
16
  ## 0.1.0 (2026-12-05)
10
17
 
11
18
  First release.
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.5
2
+ Name: resource-engine-fastapi
3
+ Version: 0.1.1
4
+ Summary: FastAPI HTTP adapter for Resource Engine.
5
+ Project-URL: Homepage, https://github.com/EloiSans/python-resource-engine
6
+ Project-URL: Documentation, https://eloisans.github.io/python-resource-engine/
7
+ Project-URL: Source, https://github.com/EloiSans/python-resource-engine/tree/main/packages/resource-engine-fastapi
8
+ Project-URL: Issues, https://github.com/EloiSans/python-resource-engine/issues
9
+ Project-URL: Changelog, https://github.com/EloiSans/python-resource-engine/blob/main/packages/resource-engine-fastapi/CHANGELOG.md
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Framework :: AsyncIO
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
21
+ Classifier: Typing :: Typed
22
+ Requires-Python: >=3.12
23
+ Requires-Dist: fastapi>=0.110
24
+ Requires-Dist: python-multipart>=0.0.9
25
+ Requires-Dist: resource-engine<0.2,>=0.1.0
26
+ Description-Content-Type: text/markdown
27
+
28
+ # resource-engine-fastapi
29
+
30
+ [![PyPI](https://img.shields.io/pypi/v/resource-engine-fastapi)](https://pypi.org/project/resource-engine-fastapi/)
31
+ [![Python](https://img.shields.io/pypi/pyversions/resource-engine-fastapi)](https://pypi.org/project/resource-engine-fastapi/)
32
+ [![Docs](https://img.shields.io/badge/docs-site-blue)](https://eloisans.github.io/python-resource-engine/)
33
+
34
+ The HTTP interface of [Resource Engine](https://pypi.org/project/resource-engine/),
35
+ a framework for business backends you declare instead of writing CRUD,
36
+ permissions, transactions and state transitions for every entity.
37
+
38
+ One call turns every registered resource into FastAPI routes, documented in
39
+ OpenAPI with the resource's own schemas. The routes only adapt HTTP to the
40
+ engine's manager, so a request goes through the same validation, permissions,
41
+ hooks and transaction as a GraphQL mutation, an MCP tool call or your own code.
42
+
43
+ For each resource, depending on what it declares:
44
+
45
+ - list (filters with operators, sorting, search, pages, `?expand=` of related
46
+ records), read, create, update and delete;
47
+ - the state machine's transitions, and which ones a record allows now;
48
+ - actions, the record's history, related records, documents and exports;
49
+ - ETags and `304` answers, optimistic concurrency, `Idempotency-Key`,
50
+ versioned APIs with `Deprecation` headers;
51
+ - errors as JSON with a stable `RE-*` code, a message and a hint, in the
52
+ caller's language.
53
+
54
+ Around them, the package serves what a business API needs:
55
+
56
+ - **Sign-in:** `bearer_actor` reads a bearer token (or an API key) through
57
+ the identity adapter you choose, and gives the manager the caller.
58
+ - **The explorer** (`mount_explorer`): try the running app from the browser,
59
+ like `/docs`, with the visitor's own permissions; watch events live, run
60
+ jobs and try publishing events. Off unless you mount it.
61
+ - **Documents for other teams:** the AsyncAPI document of the app's events
62
+ (`mount_asyncapi`) and the generated documentation site (`mount_docs`).
63
+ - **Inbound events and webhooks** (`build_event_receiver`,
64
+ `mount_email_events`), access logs with request ids, and locale negotiation.
65
+
66
+ ## Install
67
+
68
+ ```bash
69
+ pip install resource-engine-fastapi uvicorn
70
+ ```
71
+
72
+ ## Use
73
+
74
+ ```python
75
+ from fastapi import FastAPI
76
+ from resource_engine_fastapi import mount_resources
77
+
78
+ from tasks.resources import manager, registry # your ResourceRegistry and ResourceManager
79
+
80
+ app = FastAPI(title="Tasks")
81
+ mount_resources(app, registry, manager)
82
+ ```
83
+
84
+ ```bash
85
+ uvicorn app:app --reload # then open http://localhost:8000/docs
86
+ ```
87
+
88
+ ```bash
89
+ curl -s -X POST localhost:8000/tasks -H 'Content-Type: application/json' -d '{"title": "Try it"}'
90
+ curl -s 'localhost:8000/tasks?status=todo'
91
+ curl -s -X POST localhost:8000/tasks/1/transitions/finish
92
+ ```
93
+
94
+ The [quickstart](https://eloisans.github.io/python-resource-engine/quickstart.html)
95
+ builds this app from a single file, with the resource declared and records in
96
+ memory.
97
+
98
+ ## Documentation
99
+
100
+ - [Documentation site](https://eloisans.github.io/python-resource-engine/),
101
+ with the [API reference](https://eloisans.github.io/python-resource-engine/api/index.html).
102
+ - [Front-end guide](https://eloisans.github.io/python-resource-engine/frontend.html):
103
+ the HTTP conventions a front end builds on.
104
+ - [Identity](https://eloisans.github.io/python-resource-engine/identity.html),
105
+ [permissions](https://eloisans.github.io/python-resource-engine/permissions.html)
106
+ and the [explorer](https://eloisans.github.io/python-resource-engine/explorer.html).
107
+ - [Changelog](https://github.com/EloiSans/python-resource-engine/blob/main/packages/resource-engine-fastapi/CHANGELOG.md).
108
+
109
+ Requires Python 3.12 or later. Licensed under Apache 2.0.
@@ -0,0 +1,82 @@
1
+ # resource-engine-fastapi
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/resource-engine-fastapi)](https://pypi.org/project/resource-engine-fastapi/)
4
+ [![Python](https://img.shields.io/pypi/pyversions/resource-engine-fastapi)](https://pypi.org/project/resource-engine-fastapi/)
5
+ [![Docs](https://img.shields.io/badge/docs-site-blue)](https://eloisans.github.io/python-resource-engine/)
6
+
7
+ The HTTP interface of [Resource Engine](https://pypi.org/project/resource-engine/),
8
+ a framework for business backends you declare instead of writing CRUD,
9
+ permissions, transactions and state transitions for every entity.
10
+
11
+ One call turns every registered resource into FastAPI routes, documented in
12
+ OpenAPI with the resource's own schemas. The routes only adapt HTTP to the
13
+ engine's manager, so a request goes through the same validation, permissions,
14
+ hooks and transaction as a GraphQL mutation, an MCP tool call or your own code.
15
+
16
+ For each resource, depending on what it declares:
17
+
18
+ - list (filters with operators, sorting, search, pages, `?expand=` of related
19
+ records), read, create, update and delete;
20
+ - the state machine's transitions, and which ones a record allows now;
21
+ - actions, the record's history, related records, documents and exports;
22
+ - ETags and `304` answers, optimistic concurrency, `Idempotency-Key`,
23
+ versioned APIs with `Deprecation` headers;
24
+ - errors as JSON with a stable `RE-*` code, a message and a hint, in the
25
+ caller's language.
26
+
27
+ Around them, the package serves what a business API needs:
28
+
29
+ - **Sign-in:** `bearer_actor` reads a bearer token (or an API key) through
30
+ the identity adapter you choose, and gives the manager the caller.
31
+ - **The explorer** (`mount_explorer`): try the running app from the browser,
32
+ like `/docs`, with the visitor's own permissions; watch events live, run
33
+ jobs and try publishing events. Off unless you mount it.
34
+ - **Documents for other teams:** the AsyncAPI document of the app's events
35
+ (`mount_asyncapi`) and the generated documentation site (`mount_docs`).
36
+ - **Inbound events and webhooks** (`build_event_receiver`,
37
+ `mount_email_events`), access logs with request ids, and locale negotiation.
38
+
39
+ ## Install
40
+
41
+ ```bash
42
+ pip install resource-engine-fastapi uvicorn
43
+ ```
44
+
45
+ ## Use
46
+
47
+ ```python
48
+ from fastapi import FastAPI
49
+ from resource_engine_fastapi import mount_resources
50
+
51
+ from tasks.resources import manager, registry # your ResourceRegistry and ResourceManager
52
+
53
+ app = FastAPI(title="Tasks")
54
+ mount_resources(app, registry, manager)
55
+ ```
56
+
57
+ ```bash
58
+ uvicorn app:app --reload # then open http://localhost:8000/docs
59
+ ```
60
+
61
+ ```bash
62
+ curl -s -X POST localhost:8000/tasks -H 'Content-Type: application/json' -d '{"title": "Try it"}'
63
+ curl -s 'localhost:8000/tasks?status=todo'
64
+ curl -s -X POST localhost:8000/tasks/1/transitions/finish
65
+ ```
66
+
67
+ The [quickstart](https://eloisans.github.io/python-resource-engine/quickstart.html)
68
+ builds this app from a single file, with the resource declared and records in
69
+ memory.
70
+
71
+ ## Documentation
72
+
73
+ - [Documentation site](https://eloisans.github.io/python-resource-engine/),
74
+ with the [API reference](https://eloisans.github.io/python-resource-engine/api/index.html).
75
+ - [Front-end guide](https://eloisans.github.io/python-resource-engine/frontend.html):
76
+ the HTTP conventions a front end builds on.
77
+ - [Identity](https://eloisans.github.io/python-resource-engine/identity.html),
78
+ [permissions](https://eloisans.github.io/python-resource-engine/permissions.html)
79
+ and the [explorer](https://eloisans.github.io/python-resource-engine/explorer.html).
80
+ - [Changelog](https://github.com/EloiSans/python-resource-engine/blob/main/packages/resource-engine-fastapi/CHANGELOG.md).
81
+
82
+ Requires Python 3.12 or later. Licensed under Apache 2.0.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "resource-engine-fastapi"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  description = "FastAPI HTTP adapter for Resource Engine."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -22,7 +22,7 @@ dependencies = ["resource-engine>=0.1.0,<0.2", "fastapi>=0.110", "python-multipa
22
22
 
23
23
  [project.urls]
24
24
  Homepage = "https://github.com/EloiSans/python-resource-engine"
25
- Documentation = "https://github.com/EloiSans/python-resource-engine/tree/main/docs"
25
+ Documentation = "https://eloisans.github.io/python-resource-engine/"
26
26
  Source = "https://github.com/EloiSans/python-resource-engine/tree/main/packages/resource-engine-fastapi"
27
27
  Issues = "https://github.com/EloiSans/python-resource-engine/issues"
28
28
  Changelog = "https://github.com/EloiSans/python-resource-engine/blob/main/packages/resource-engine-fastapi/CHANGELOG.md"
@@ -1,32 +0,0 @@
1
- Metadata-Version: 2.5
2
- Name: resource-engine-fastapi
3
- Version: 0.1.0
4
- Summary: FastAPI HTTP adapter for Resource Engine.
5
- Project-URL: Homepage, https://github.com/EloiSans/python-resource-engine
6
- Project-URL: Documentation, https://github.com/EloiSans/python-resource-engine/tree/main/docs
7
- Project-URL: Source, https://github.com/EloiSans/python-resource-engine/tree/main/packages/resource-engine-fastapi
8
- Project-URL: Issues, https://github.com/EloiSans/python-resource-engine/issues
9
- Project-URL: Changelog, https://github.com/EloiSans/python-resource-engine/blob/main/packages/resource-engine-fastapi/CHANGELOG.md
10
- License-Expression: Apache-2.0
11
- License-File: LICENSE
12
- Classifier: Development Status :: 3 - Alpha
13
- Classifier: Framework :: AsyncIO
14
- Classifier: Intended Audience :: Developers
15
- Classifier: Operating System :: OS Independent
16
- Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.12
18
- Classifier: Programming Language :: Python :: 3.13
19
- Classifier: Programming Language :: Python :: 3.14
20
- Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
21
- Classifier: Typing :: Typed
22
- Requires-Python: >=3.12
23
- Requires-Dist: fastapi>=0.110
24
- Requires-Dist: python-multipart>=0.0.9
25
- Requires-Dist: resource-engine<0.2,>=0.1.0
26
- Description-Content-Type: text/markdown
27
-
28
- # resource-engine-fastapi
29
-
30
- FastAPI adapter for Resource Engine: generates routes from registered resources and maps engine errors to HTTP; `build_event_receiver` is a push endpoint for inbound events.
31
-
32
- Part of [Resource Engine](../../README.md).
@@ -1,5 +0,0 @@
1
- # resource-engine-fastapi
2
-
3
- FastAPI adapter for Resource Engine: generates routes from registered resources and maps engine errors to HTTP; `build_event_receiver` is a push endpoint for inbound events.
4
-
5
- Part of [Resource Engine](../../README.md).