odatapy 5.0.0__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 (145) hide show
  1. odatapy-5.0.0/.gitignore +24 -0
  2. odatapy-5.0.0/CHANGELOG.md +387 -0
  3. odatapy-5.0.0/LICENSE +202 -0
  4. odatapy-5.0.0/NOTICE +7 -0
  5. odatapy-5.0.0/PKG-INFO +313 -0
  6. odatapy-5.0.0/PYTHON_ODATA_PORT_PLAN.md +214 -0
  7. odatapy-5.0.0/README.md +269 -0
  8. odatapy-5.0.0/conftest.py +10 -0
  9. odatapy-5.0.0/docs/INTEROP.md +768 -0
  10. odatapy-5.0.0/docs/OLINGO_COMPARISON.md +252 -0
  11. odatapy-5.0.0/docs/client.md +923 -0
  12. odatapy-5.0.0/docs/deployment.md +432 -0
  13. odatapy-5.0.0/docs/edm.md +766 -0
  14. odatapy-5.0.0/docs/index.md +106 -0
  15. odatapy-5.0.0/docs/migrating-from-olingo.md +342 -0
  16. odatapy-5.0.0/docs/query-options.md +1039 -0
  17. odatapy-5.0.0/docs/server.md +1288 -0
  18. odatapy-5.0.0/docs/tutorial.md +524 -0
  19. odatapy-5.0.0/examples/catalog_model.py +351 -0
  20. odatapy-5.0.0/examples/client_tour.py +546 -0
  21. odatapy-5.0.0/examples/demo_service.py +153 -0
  22. odatapy-5.0.0/examples/edm_tour.py +511 -0
  23. odatapy-5.0.0/examples/query_options_tour.py +147 -0
  24. odatapy-5.0.0/examples/server_extras.py +422 -0
  25. odatapy-5.0.0/examples/sqlite_service.py +418 -0
  26. odatapy-5.0.0/examples/tutorial_service.py +175 -0
  27. odatapy-5.0.0/pyproject.toml +90 -0
  28. odatapy-5.0.0/src/odatapy/__init__.py +30 -0
  29. odatapy-5.0.0/src/odatapy/client/__init__.py +132 -0
  30. odatapy-5.0.0/src/odatapy/client/auth.py +159 -0
  31. odatapy-5.0.0/src/odatapy/client/batch.py +628 -0
  32. odatapy-5.0.0/src/odatapy/client/client.py +1829 -0
  33. odatapy-5.0.0/src/odatapy/client/filters.py +972 -0
  34. odatapy-5.0.0/src/odatapy/client/responses.py +304 -0
  35. odatapy-5.0.0/src/odatapy/client/serialization.py +1257 -0
  36. odatapy-5.0.0/src/odatapy/client/transport.py +505 -0
  37. odatapy-5.0.0/src/odatapy/client/uri_builder.py +328 -0
  38. odatapy-5.0.0/src/odatapy/data/__init__.py +426 -0
  39. odatapy-5.0.0/src/odatapy/edm/__init__.py +91 -0
  40. odatapy-5.0.0/src/odatapy/edm/annotations.py +742 -0
  41. odatapy-5.0.0/src/odatapy/edm/csdl.py +430 -0
  42. odatapy-5.0.0/src/odatapy/edm/geo.py +385 -0
  43. odatapy-5.0.0/src/odatapy/edm/json_csdl.py +462 -0
  44. odatapy-5.0.0/src/odatapy/edm/json_value.py +377 -0
  45. odatapy-5.0.0/src/odatapy/edm/model.py +1276 -0
  46. odatapy-5.0.0/src/odatapy/edm/names.py +27 -0
  47. odatapy-5.0.0/src/odatapy/edm/primitives.py +1247 -0
  48. odatapy-5.0.0/src/odatapy/edm/xml_io.py +529 -0
  49. odatapy-5.0.0/src/odatapy/errors.py +196 -0
  50. odatapy-5.0.0/src/odatapy/ext/__init__.py +26 -0
  51. odatapy-5.0.0/src/odatapy/ext/sql.py +726 -0
  52. odatapy-5.0.0/src/odatapy/ext/sqlalchemy.py +298 -0
  53. odatapy-5.0.0/src/odatapy/http/__init__.py +23 -0
  54. odatapy-5.0.0/src/odatapy/http/content_type.py +309 -0
  55. odatapy-5.0.0/src/odatapy/http/header.py +41 -0
  56. odatapy-5.0.0/src/odatapy/http/method.py +18 -0
  57. odatapy-5.0.0/src/odatapy/http/prefer.py +292 -0
  58. odatapy-5.0.0/src/odatapy/http/status.py +84 -0
  59. odatapy-5.0.0/src/odatapy/py.typed +0 -0
  60. odatapy-5.0.0/src/odatapy/server/__init__.py +20 -0
  61. odatapy-5.0.0/src/odatapy/server/adapters/__init__.py +11 -0
  62. odatapy-5.0.0/src/odatapy/server/adapters/asgi.py +147 -0
  63. odatapy-5.0.0/src/odatapy/server/adapters/common.py +212 -0
  64. odatapy-5.0.0/src/odatapy/server/adapters/wsgi.py +187 -0
  65. odatapy-5.0.0/src/odatapy/server/apply.py +740 -0
  66. odatapy-5.0.0/src/odatapy/server/batch.py +818 -0
  67. odatapy-5.0.0/src/odatapy/server/default_processor.py +131 -0
  68. odatapy-5.0.0/src/odatapy/server/deserializer/__init__.py +6 -0
  69. odatapy-5.0.0/src/odatapy/server/deserializer/json_deserializer.py +648 -0
  70. odatapy-5.0.0/src/odatapy/server/deserializer/xml_deserializer.py +591 -0
  71. odatapy-5.0.0/src/odatapy/server/dispatcher.py +734 -0
  72. odatapy-5.0.0/src/odatapy/server/eval.py +994 -0
  73. odatapy-5.0.0/src/odatapy/server/handler.py +658 -0
  74. odatapy-5.0.0/src/odatapy/server/inmemory.py +3164 -0
  75. odatapy-5.0.0/src/odatapy/server/negotiator.py +280 -0
  76. odatapy-5.0.0/src/odatapy/server/odata.py +77 -0
  77. odatapy-5.0.0/src/odatapy/server/processor.py +492 -0
  78. odatapy-5.0.0/src/odatapy/server/request.py +220 -0
  79. odatapy-5.0.0/src/odatapy/server/serializer/__init__.py +24 -0
  80. odatapy-5.0.0/src/odatapy/server/serializer/factory.py +45 -0
  81. odatapy-5.0.0/src/odatapy/server/serializer/json_serializer.py +1222 -0
  82. odatapy-5.0.0/src/odatapy/server/serializer/metadata.py +713 -0
  83. odatapy-5.0.0/src/odatapy/server/serializer/xml_serializer.py +859 -0
  84. odatapy-5.0.0/src/odatapy/server/support.py +319 -0
  85. odatapy-5.0.0/src/odatapy/server/uri/__init__.py +106 -0
  86. odatapy-5.0.0/src/odatapy/server/uri/apply_parser.py +552 -0
  87. odatapy-5.0.0/src/odatapy/server/uri/expression.py +440 -0
  88. odatapy-5.0.0/src/odatapy/server/uri/expression_parser.py +1302 -0
  89. odatapy-5.0.0/src/odatapy/server/uri/parser.py +1525 -0
  90. odatapy-5.0.0/src/odatapy/server/uri/query_options.py +351 -0
  91. odatapy-5.0.0/src/odatapy/server/uri/resource.py +317 -0
  92. odatapy-5.0.0/src/odatapy/server/uri/search_parser.py +162 -0
  93. odatapy-5.0.0/src/odatapy/server/uri/validator.py +387 -0
  94. odatapy-5.0.0/tests/__init__.py +0 -0
  95. odatapy-5.0.0/tests/fixtures/edm.xsd +901 -0
  96. odatapy-5.0.0/tests/fixtures/edmx.xsd +116 -0
  97. odatapy-5.0.0/tests/fixtures/northwind_metadata.xml +1 -0
  98. odatapy-5.0.0/tests/fixtures/odata_demo_metadata.xml +1 -0
  99. odatapy-5.0.0/tests/fixtures/trippin_metadata.xml +1 -0
  100. odatapy-5.0.0/tests/sample_edm.py +597 -0
  101. odatapy-5.0.0/tests/test_adapters.py +417 -0
  102. odatapy-5.0.0/tests/test_apply.py +209 -0
  103. odatapy-5.0.0/tests/test_apply_no_store_mutation.py +227 -0
  104. odatapy-5.0.0/tests/test_async_protocol.py +219 -0
  105. odatapy-5.0.0/tests/test_batch.py +177 -0
  106. odatapy-5.0.0/tests/test_batch_parsing.py +628 -0
  107. odatapy-5.0.0/tests/test_client.py +947 -0
  108. odatapy-5.0.0/tests/test_client_async.py +438 -0
  109. odatapy-5.0.0/tests/test_client_auth.py +279 -0
  110. odatapy-5.0.0/tests/test_client_batch.py +385 -0
  111. odatapy-5.0.0/tests/test_client_filters.py +364 -0
  112. odatapy-5.0.0/tests/test_client_uri_builder.py +326 -0
  113. odatapy-5.0.0/tests/test_client_xml.py +136 -0
  114. odatapy-5.0.0/tests/test_concurrency.py +454 -0
  115. odatapy-5.0.0/tests/test_deferred_features.py +280 -0
  116. odatapy-5.0.0/tests/test_delta.py +111 -0
  117. odatapy-5.0.0/tests/test_deserializer_json.py +740 -0
  118. odatapy-5.0.0/tests/test_edm_model.py +454 -0
  119. odatapy-5.0.0/tests/test_eval.py +760 -0
  120. odatapy-5.0.0/tests/test_expand.py +123 -0
  121. odatapy-5.0.0/tests/test_expand_wildcard.py +212 -0
  122. odatapy-5.0.0/tests/test_ext_sql.py +638 -0
  123. odatapy-5.0.0/tests/test_ext_sqlalchemy.py +146 -0
  124. odatapy-5.0.0/tests/test_geo.py +280 -0
  125. odatapy-5.0.0/tests/test_http.py +140 -0
  126. odatapy-5.0.0/tests/test_interop.py +1173 -0
  127. odatapy-5.0.0/tests/test_live_http.py +196 -0
  128. odatapy-5.0.0/tests/test_maxpagesize_clamp.py +136 -0
  129. odatapy-5.0.0/tests/test_media.py +169 -0
  130. odatapy-5.0.0/tests/test_metadata_json.py +345 -0
  131. odatapy-5.0.0/tests/test_metadata_xml.py +313 -0
  132. odatapy-5.0.0/tests/test_navigation.py +595 -0
  133. odatapy-5.0.0/tests/test_parameter_aliases.py +218 -0
  134. odatapy-5.0.0/tests/test_primitives.py +499 -0
  135. odatapy-5.0.0/tests/test_release_fixes.py +367 -0
  136. odatapy-5.0.0/tests/test_review_fixes.py +317 -0
  137. odatapy-5.0.0/tests/test_serializer_json.py +1152 -0
  138. odatapy-5.0.0/tests/test_server_audit_fixes.py +1370 -0
  139. odatapy-5.0.0/tests/test_server_e2e.py +214 -0
  140. odatapy-5.0.0/tests/test_server_headers.py +593 -0
  141. odatapy-5.0.0/tests/test_server_xml.py +1048 -0
  142. odatapy-5.0.0/tests/test_uri_parser.py +1460 -0
  143. odatapy-5.0.0/tests/test_uri_validator.py +583 -0
  144. odatapy-5.0.0/tests/test_wsgi_adapter.py +87 -0
  145. odatapy-5.0.0/tests/uri_edm.py +247 -0
@@ -0,0 +1,24 @@
1
+ # Byte-compiled / cache
2
+ __pycache__/
3
+ *.py[cod]
4
+ .pytest_cache/
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+ .coverage
8
+ htmlcov/
9
+
10
+ # Build / packaging
11
+ build/
12
+ dist/
13
+ *.egg-info/
14
+ .eggs/
15
+
16
+ # Virtual envs
17
+ .venv/
18
+ venv/
19
+ env/
20
+
21
+ # IDE / OS
22
+ .idea/
23
+ .vscode/
24
+ .DS_Store
@@ -0,0 +1,387 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
5
+ [PEP 440](https://peps.python.org/pep-0440/) versions.
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [5.0.0] - 2026-09-09
10
+
11
+ The first stable release. It follows 5.0.0b1 by a day and contains no new
12
+ features: everything below came out of independently auditing the beta, running
13
+ it against the public OData reference services, validating its metadata against
14
+ the OASIS schemas, exercising it on Python 3.10 through 3.14, and driving it from
15
+ several threads at once.
16
+
17
+ Verified for this release: 1,983 tests pass on CPython 3.10, 3.11, 3.12, 3.13
18
+ and 3.14, including ten that run over a real TCP socket; `ruff` and `mypy` are
19
+ both clean; and the whole suite passes against the built sdist with the source
20
+ tree removed.
21
+
22
+ ### Security
23
+ - `Prefer: odata.maxpagesize` could raise the server's configured `page_size`,
24
+ so any client could ask for a million rows and read a whole collection in one
25
+ response, defeating the cap that `page_size` exists to enforce. The preference
26
+ now clamps the page size downwards only, as OData Part 1, 8.2.8.3 permits
27
+ (it asks for *at most* N results), and `Preference-Applied` reports the page
28
+ size actually used rather than the one requested. With no configured
29
+ `page_size` the client's request is still honoured in full.
30
+
31
+ ### Added
32
+ - A documentation set under `docs/`: a tutorial, server and client guides, a
33
+ modelling guide, a query-option reference, a deployment guide and an
34
+ Olingo migration guide, plus interoperability results against the public
35
+ OData reference services. Every sample was executed before publication.
36
+
37
+ ### Fixed — found by interoperability testing
38
+ Verified against the public OData reference services (TripPin, Northwind V4,
39
+ ODataDemo) and against the OASIS CSDL XML and JSON schemas. Details, with
40
+ reproductions and specification citations, are in `docs/INTEROP.md`.
41
+ - A client read through a navigation segment was typed against the wrong entity
42
+ type, because only the first URL segment was resolved. `Customers('ALFKI')/Orders`
43
+ typed against `Customer`, so `Edm.DateTimeOffset`, `Guid`, `Duration`, `Binary`
44
+ and `Single` values stayed strings and `Edm.Double` came back as `Decimal`. The
45
+ whole resource path is now walked, and a payload's own `@odata.type` is honoured
46
+ when it names a derived type.
47
+ - Reading a singleton through the client raised `AttributeError`.
48
+ - `FunctionImport/@IncludeInServiceDocument` defaulted to true, so the service
49
+ document advertised function imports the model intended to hide. CSDL makes the
50
+ default false for a function import while leaving it true for an entity set.
51
+ The attribute is now emitted only when it differs from that default.
52
+ - The `$expand` context URL omitted the select list, emitting
53
+ `#Categories/$entity` where the specification requires
54
+ `#Categories(Products(Name))/$entity`. Nested expands recurse, and a
55
+ `Nav/$ref` expansion is represented as such.
56
+ - The `SRID` facet was not case-normalised, so `SRID="Variable"` produced a
57
+ spurious GeoJSON `crs` member and an invalid re-serialization. Metadata we
58
+ emit now validates against the OASIS XSD even when the source document does
59
+ not.
60
+ - A `204 No Content` answer to a single-entity GET returned an empty `Entity`
61
+ from the client rather than `None`, so a caller could not tell "no entity"
62
+ from "an entity with no properties".
63
+ - `text/plain` responses omitted `charset=utf-8` although the body was UTF-8.
64
+
65
+ ### Fixed
66
+ - A `$apply` pipeline wrote its results back onto the stored entities, so a
67
+ `compute(... as X)` alias, and any navigation materialised by `expand(...)`,
68
+ stayed on the entity for the life of the process and appeared in later,
69
+ unrelated responses. A filtered `expand(...)` also shrank the stored
70
+ collection. Transformations now work on a shallow copy, and `groupby` copies a
71
+ complex or collection grouping value instead of putting the store's own object
72
+ in a response. The `$compute` query option was never affected, because the
73
+ in-memory processor already treated its aliases as transient.
74
+ - `$apply=groupby(...)` returned 500 when the grouping property was a complex
75
+ property or a collection, such as `groupby((ShipTo))` or `groupby((Tags))`.
76
+ The grouping key has to be hashable, and the stringified key was being written
77
+ out as the value, so the payload contradicted the model. The key and the
78
+ emitted value are now kept apart, and the value carries its proper kind, so a
79
+ complex grouping property serializes as an object and a collection as an array.
80
+ - `$filter` parameter aliases were never matched, so `Price gt @min` with
81
+ `@min=100` returned an empty collection with a 200 instead of the matching
82
+ rows. `uri_info.aliases` held raw query-string text, so the evaluator compared
83
+ a `Decimal` against the string `"100"`. Aliases are now parsed once, in the
84
+ URI parser, with the same literal grammar as any `$filter` literal, so
85
+ numbers, quoted strings, dates, times, durations, guids, binaries, booleans,
86
+ `null` and enum members all work, including inside a function call and in
87
+ `$compute` and `$orderby`. A value the grammar cannot parse, such as the JSON
88
+ of a complex or collection alias, is left as the original text, and the raw
89
+ text remains available as `uri_info.raw_aliases`.
90
+ - The same bug made `odatapy.ext.sqlalchemy` bind an alias as a string, so
91
+ `@min=100` produced `Price > '100'`. Both SQL translators now accept typed
92
+ values and raw text.
93
+ - `$expand=*` returned `null` for every single-valued navigation and `[]` for
94
+ every collection-valued one. The wildcard put a bare `"*"` key in the
95
+ serializer's expand map and skipped materialisation entirely. It is now
96
+ resolved into one item per navigation property, so each takes the same path as
97
+ an explicitly named one: materialised, honouring the star's own nested
98
+ options, and subject to `max_expand_depth` and the cycle check, so `*` over a
99
+ self-referencing navigation terminates as `$levels=max` does. An explicitly
100
+ named navigation still wins over the star.
101
+ - The aggregation extension's `expand` transformation produced no navigation at
102
+ all. `$apply=expand(Products,filter(...))` only filtered an inline link, which
103
+ a store keeping its relationships outside the entity never creates, and the
104
+ serializer was never told to emit the navigation. It now materialises through
105
+ the back end's resolver and is reported to the serializer. A `groupby` later in
106
+ the pipeline projects onto its grouping properties, so the navigation is then
107
+ omitted rather than shown as a misleading empty array.
108
+
109
+ ### Changed
110
+ - `UriInfo.aliases` now holds typed Python values rather than raw URI text. The
111
+ raw text moved to the new `UriInfo.raw_aliases`.
112
+ - `InMemoryDataStore` and `InMemoryProcessor` are safe for concurrent use by
113
+ several threads in one process. The store guards every method with a reentrant
114
+ lock, and each processor entry point holds it across the whole
115
+ read-check-write sequence, so two simultaneous writes cannot interleave. The
116
+ store still lives in process memory, so a multi-worker deployment gives each
117
+ worker an independent copy.
118
+ - The `dev` extra now installs `lxml` and `jsonschema`, without which the
119
+ metadata-validation tests skip silently, and continuous integration no longer
120
+ tolerates a type-check failure.
121
+ - A new `sqlalchemy` extra installs the optional SQLAlchemy expression bridge.
122
+
123
+ ## [5.0.0b1] - 2026-09-09
124
+
125
+ A feature-completeness release. The library grew from roughly 10,000 to about
126
+ 31,800 lines of Python, and the test suite from 204 to 1,826 cases, closing the
127
+ gaps listed in `docs/OLINGO_COMPARISON.md`. See that document for what is
128
+ covered, what is deliberately not ported, and what remains.
129
+
130
+ An independent audit was run against the finished code, driving real requests
131
+ rather than trusting the implementation. It found five defects that returned
132
+ wrong answers or crashed, all of which are fixed and listed below.
133
+
134
+ Nothing in the public API was removed, but the beta marker is deliberate: much of
135
+ this surface is new and has only synthetic-service coverage.
136
+
137
+ ### Added — URI and query options
138
+ - Resource paths: key-as-segment (`Products/1`), type-cast segments
139
+ (`Products/NS.Special`), `$crossjoin(A,B)`, `$all`, `$entity?$id=`, lambda
140
+ segments, function composition, and `$ref`/`$count`/`$value` position rules.
141
+ - Key predicates are validated against the model (names, count, literal types)
142
+ and parameter aliases are resolved and typed.
143
+ - `$filter`: the `in` operator with list literals, `any`/`all` lambdas with
144
+ variable binding, `$it`, `$root`, `has`, `hassubset`/`hassubsequence`,
145
+ `cast`/`isof` with real type references, `matchesPattern`, the full date, math,
146
+ string and geo function set, and method arity checking.
147
+ - Expressions are bound to the EDM: unknown properties are rejected with 400,
148
+ operand types are checked, and literals are typed per the ABNF (integers by
149
+ range, `1.5` as `Edm.Decimal`, suffixed forms as Double/Single/Decimal).
150
+ - `$search` is parsed into an expression tree (terms, phrases, `AND`/`OR`/`NOT`,
151
+ grouping) and evaluated, replacing the previous implicit-AND word match.
152
+ - `$apply` is parsed into typed transformations and evaluated: `aggregate` with
153
+ `sum`/`min`/`max`/`average`/`countdistinct`/`$count` and `from`, nested
154
+ `groupby`, `filter`, `compute`, `expand`, `concat`, `search`, `identity`, and
155
+ the `topcount`/`bottomcount`/`topsum`/`bottomsum`/`toppercent`/`bottompercent`
156
+ family.
157
+ - `$compute`, `$deltatoken`, `$index` and `$schemaversion` are supported;
158
+ duplicate system options, malformed `$count`/`$top`/`$skip` values, and query
159
+ options on `$metadata`/`$batch` are rejected.
160
+ - The URI validator implements the full method-by-resource-kind-by-option matrix
161
+ and exposes `allowed_methods()` for the `Allow` header.
162
+ - Resource-not-found now returns 404 rather than 400, via a distinct semantic
163
+ exception.
164
+
165
+ ### Added — evaluation
166
+ - Strict three-valued null logic throughout `$filter`, so null operands
167
+ propagate instead of raising, with equality remaining null-aware so
168
+ `Description eq null` still matches.
169
+ - Date arithmetic, integer division truncation, division by zero as null, and
170
+ numeric coercion across int, Decimal and float.
171
+
172
+ ### Added — EDM, metadata and serialization
173
+ - A vocabulary annotation model covering constant and dynamic expressions
174
+ (`Path`, `Apply`, `If`, `Record`, `Collection`, comparison and logical
175
+ operators, `Cast`, `IsOf`, `UrlRef`, labelled elements), serialized in both
176
+ CSDL formats and parsed back.
177
+ - `$metadata` XML: `edmx:Reference`/`Include`/`IncludeAnnotations`, `Term`,
178
+ `TypeDefinition`, out-of-line `Annotations`, annotations on every element,
179
+ `Scale="variable"`/`"floating"`, SRID, `Unicode`, `DefaultValue`, `Abstract`,
180
+ `OpenType`, `HasStream`, complex `BaseType`, `OnDelete`, `ContainsTarget`,
181
+ `Partner`, container `Extends`, singleton bindings, and version 4.0 or 4.01
182
+ by service version.
183
+ - `$metadata` JSON CSDL is now complete (actions, functions, imports, type
184
+ definitions, `$IsFlags`, key aliases, per-property annotations) and a new
185
+ CSDL-JSON parser lets the client consume it.
186
+ - Both metadata formats round-trip exactly through the parsers.
187
+ - JSON payloads: derived types with `@odata.type` and derived-type context URLs,
188
+ `$select` context suffixes, `Nav@odata.count`/`@odata.nextLink`,
189
+ `$expand=Nav/$ref`, the full `odata.metadata=full` annotation set including
190
+ navigation, association, edit, read and media links and operation
191
+ advertisement, `IEEE754Compatible`, exact Decimal digits without float
192
+ rounding, enum member names including flags, `omit-values`, 4.01 short control
193
+ names, and `innererror`.
194
+ - Delta payloads in both the 4.0 (`$deletedEntity`) and 4.01 (`@removed`) shapes,
195
+ including added and deleted links.
196
+ - Atom/XML is now a first-class format: feeds and entries with the required Atom
197
+ members, self and edit links, related links with `m:inline` expansion, media
198
+ entries, references, delta feeds, the correct APP namespace for service
199
+ documents, and errors with details and inner error.
200
+ - Deserializers (JSON and XML) validate types and facets, honour `@odata.type`
201
+ casts, keep dynamic properties on open types, offer a strict mode, and handle
202
+ action parameters and entity collections.
203
+
204
+ ### Added — server runtime
205
+ - `OData-Version` and `OData-MaxVersion` are validated and negotiated, and the
206
+ negotiated version is stamped on every response including 204, 304 and errors.
207
+ - Status codes now follow the protocol: 406 for negotiation failure, 415 for an
208
+ unsupported request media type, 412 and 428 for preconditions, 501 for
209
+ unimplemented operations, and a generic 500 that never leaks a traceback.
210
+ - All `Prefer` options are honoured with an accurate `Preference-Applied`:
211
+ `return=representation`/`minimal`, `odata.maxpagesize`, `continue-on-error`,
212
+ `respond-async` with `wait`, `include-annotations`, `track-changes`,
213
+ `allow-entityreferences` and `omit-values`.
214
+ - `OData-EntityId` on minimal creates, ETags regenerated on every write, weak
215
+ comparison, `If-Match` lists and `*`, `If-None-Match` producing 304 or 412,
216
+ and ETags on `$metadata` and the service document.
217
+ - `HEAD` and `OPTIONS` are supported, the latter returning an `Allow` header.
218
+ - A debug facility behind an authorization hook renders request, response, URI,
219
+ server, exception and timing detail as JSON or HTML.
220
+ - Extension hooks for custom content types, custom ETags, service-metadata
221
+ ETags and batch transactions.
222
+ - The processor surface now matches Olingo's: primitive and complex collection
223
+ processors with counts, reference collections, media delete, and operation
224
+ dispatch by return type.
225
+ - `$batch` was rewritten as a byte-level parser: binary parts survive intact,
226
+ boundaries and part headers are validated, changesets are atomic with
227
+ rollback, `$<id>` references are resolved in the request line and inside
228
+ `@odata.bind` by parsing the JSON body rather than replacing bytes, and the
229
+ OData 4.01 JSON batch format is supported with `atomicityGroup` and
230
+ `dependsOn`.
231
+ - Adapters honour `SCRIPT_NAME` and ASGI `root_path`, read bodies with no
232
+ `Content-Length`, optionally trust `X-Forwarded-*`, percent-decode paths
233
+ without breaking segment structure, and stream iterator bodies.
234
+ - The in-memory reference processor gained a real relation table, so navigation
235
+ paths work for reads and writes; duplicate keys return 409 and missing keys
236
+ 400; paging is stable; nested `$expand` options are applied per item; change
237
+ tracking serves delta payloads; and `respond-async` runs on a thread pool with
238
+ polling and cancellation.
239
+
240
+ ### Added — client
241
+ - An `AsyncODataClient` sharing all request building and payload parsing with the
242
+ synchronous client, so both return identical values.
243
+ - A complete retrieve surface including `iter_entities` paging through
244
+ `@odata.nextLink`, typed service documents, `$value`, media streaming, delta
245
+ reads and reference reads.
246
+ - Reference and media write operations, property deletes, raw `$value` writes,
247
+ and deep insert.
248
+ - A `$batch` builder supporting changesets, content-ID cross references and both
249
+ the multipart and JSON formats.
250
+ - Authentication classes for basic, bearer and OAuth2 client credentials, a
251
+ retry policy honouring `Retry-After`, redirects, timeouts and request hooks.
252
+ - `$metadata` revalidation with `If-None-Match`, and JSON CSDL support.
253
+ - The SQL extension escapes LIKE wildcards, supports lambdas as `EXISTS`
254
+ subqueries, binds parameter aliases, and emits `ORDER BY` and `LIMIT`/`OFFSET`
255
+ with three bind styles. An optional SQLAlchemy bridge is available as the
256
+ `sqlalchemy` extra.
257
+
258
+ ### Fixed — found by the audit
259
+ - Navigation traversal in `$filter` and `$orderby` silently matched nothing.
260
+ `$filter=Friends/any(f: f/Name eq 'Bob')`, `Manager/Name eq 'Bob'` and
261
+ `$orderby=Manager/Name` all returned wrong results with a 200, because the
262
+ evaluator only saw inline links and never consulted the relation table.
263
+ - `$expand` with `$levels=max` on a self-referencing navigation recursed until
264
+ the stack ran out, returning 500. Depth is now capped and cycles detected.
265
+ - A type-cast path segment on a collection did not filter, so
266
+ `People/NS.Employee` returned every person, and a cast to a type the entity
267
+ does not have returned the entity instead of 404.
268
+ - The client's JSON reader converted `Edm.Decimal` through `float`, so a
269
+ twenty-digit value came back rounded and `10.50` lost its scale. JSON and XML
270
+ reads now agree exactly.
271
+ - `IEEE754Compatible=true` was echoed in `Content-Type` but ignored, so
272
+ `Edm.Int64` and `Edm.Decimal` were still written as bare JSON numbers.
273
+ - Geospatial properties could never be written through JSON: the deserializer
274
+ rejected the GeoJSON object as "not a scalar".
275
+ - `$compute` was parsed and then discarded, so `$select`, `$filter` and
276
+ `$orderby` rejected its aliases as unknown properties.
277
+ - Composable function results could not be composed: `Fn()/$count`, `Fn()(key)`
278
+ and `Fn()/Property` all failed.
279
+ - `$apply=from(...)` was unimplemented, and an unknown path in `from`,
280
+ `aggregate ... from` or `groupby` was accepted and silently evaluated to an
281
+ empty set instead of returning 400.
282
+ - An aggregate over an empty or all-null set returned `0` instead of null.
283
+ - A response could carry a higher `OData-Version` than the client declared.
284
+ - `Prefer: continue-on-error` was ignored under its 4.01 name.
285
+ - A PATCH or PUT that changed a key was accepted and silently ignored.
286
+ - `$skiptoken` was an offset, so deleting a row between pages skipped a row.
287
+ Paging is now key-based and stable.
288
+ - `CustomETagSupport` and `DebugSupport` crashed `handler.register()`.
289
+ - Strict deserialization was unreachable, so unknown properties on closed types
290
+ were always ignored.
291
+ - JSON batch `dependsOn` referencing an unknown request id returned 200.
292
+ - `SRID` facets were never validated on write.
293
+ - The XML deserializer accepted a scalar where a collection was declared, and
294
+ silently discarded a collection given as a bare text node.
295
+ - `geo.intersects` excluded points lying exactly on a polygon boundary.
296
+ - A delta window that created and then deleted an entity reported it as added.
297
+
298
+ ### Fixed — other
299
+ - The in-memory processor called the XML serializer for single properties with an
300
+ argument it did not accept, so any XML property request returned 500.
301
+ - GeoJSON output no longer emits a `crs` member for a default SRID.
302
+ - The XML serializer was missing the collection, reference and delta methods the
303
+ in-memory processor calls, so those endpoints crashed for XML requests.
304
+ - Posting a media entity to a path that resolves without an entity set, such as a
305
+ singleton or navigation target, crashed with 500 instead of returning 400.
306
+ - `$all` and the internal all-entities walk crashed on a schema declaring no
307
+ entity container.
308
+
309
+ ### Changed
310
+ - The whole package now type-checks cleanly under mypy. Three annotations that
311
+ were simply wrong were corrected, all on internals:
312
+ `TypeLiteral.edm_type` accepts a raw primitive type,
313
+ `ODataHandler.select_processor` is no longer bounded to `Processor` because the
314
+ support mixins are not processors, and `EdmPrimitiveType.uri_prefix`/`uri_suffix`
315
+ are no longer `ClassVar` because geospatial types bind them per instance.
316
+
317
+ ## [5.0.0a2] - 2026-09-08
318
+
319
+ Follow-up to the 5.0.0a1 hardening after a second review pass.
320
+
321
+ ### Fixed
322
+ - Request-body validation: wrong JSON types, non-nullable nulls, out-of-range
323
+ integers and Decimal precision/scale violations in entity, complex and
324
+ property bodies now return 400 with the offending property named, instead of
325
+ 500 or silent coercion.
326
+ - `PUT .../Property/$value` honours the EDM property's Decimal/Duration
327
+ facets (a `Price` with `Scale="2"` accepts `3.14`), and `Edm.Binary`
328
+ `$value` bodies are stored as raw octets.
329
+ - Key properties can no longer be modified through property `PUT`/`PATCH` or
330
+ `$value`.
331
+ - Property updates with a non-JSON request body return 415 instead of 500.
332
+ - Malformed key literals (`Products('abc')` on an `Edm.Int32` key) return 400
333
+ instead of 500.
334
+ - Non-finite `Edm.Decimal` and untyped float values are serialized as
335
+ `"INF"`, `"-INF"`, `"NaN"` like `Edm.Double`; `"INF"`/`"NaN"` strings are
336
+ accepted on input for `Edm.Double`/`Edm.Single`.
337
+ - `Edm.Duration` values with fractional seconds no longer fail to serialize
338
+ or deserialize when no EDM facets are available (dynamic values, client
339
+ reads); a declared property without `Precision` still means precision 0,
340
+ as the CSDL specification requires.
341
+ - `Edm.Binary` is emitted with the base64url alphabet required by the OData
342
+ ABNF (server and client).
343
+ - `$filter`, `$orderby`, `$search` and `/$count` now apply to the result of
344
+ `$apply` instead of being skipped when `$apply` is present.
345
+ - Client raises `ODataServerError` (a subclass of `ODataClientError`) for
346
+ 5xx responses; it is exported from `odatapy.client`.
347
+
348
+ ## [5.0.0a1] - 2026-09-08
349
+
350
+ First public alpha. The version number tracks the Apache Olingo release the
351
+ library is modelled on (5.0.0); it does **not** claim feature parity. See
352
+ `docs/OLINGO_COMPARISON.md` for the coverage matrix and known gaps.
353
+
354
+ ### Added
355
+ - EDM type system: all OData primitive types with literal grammars and facets,
356
+ CSDL provider model, runtime EDM, `$metadata` XML and JSON CSDL output and
357
+ XML parsing, geospatial types (WKT and GeoJSON).
358
+ - Transport-neutral server pipeline with ASGI and WSGI adapters, consolidated
359
+ processor protocols, and a reusable in-memory reference processor.
360
+ - URI and query-option parsing: resource paths, `$filter` expression tree with
361
+ visitor, `$select`, `$expand` (nested options, `$levels`), `$orderby`, `$top`,
362
+ `$skip`, `$count`, `$search`, `$format`, `$apply` (filter/aggregate/groupby).
363
+ - JSON payload serialization (metadata levels none/minimal/full) and Atom/XML
364
+ payloads, delta responses, media entities, `$ref`, singletons, bound and
365
+ unbound operations, deep insert, `$batch` with changesets, ETag preconditions,
366
+ server-driven paging, and the `Prefer: respond-async` protocol.
367
+ - Client: fluent `URIBuilder`, `$filter` builder, CRUD and operation calls,
368
+ `$metadata` to EDM with caching, JSON and XML response reading, httpx
369
+ transports, and an in-process transport for tests.
370
+ - `odatapy.ext.sql`: `$filter` tree to parameterised SQL `WHERE` clause.
371
+
372
+ ### Fixed (pre-release hardening)
373
+ - `X-HTTP-Method` / `X-HTTP-Method-Override` tunnelling is honoured only on
374
+ POST requests, and an unknown tunnelled verb no longer silently becomes GET.
375
+ - `Edm.Double` / `Edm.Single` infinities and NaN are serialized as the JSON
376
+ strings `"INF"`, `"-INF"`, `"NaN"` instead of invalid JSON tokens.
377
+ - `@odata.count` honours `$filter` and `$search` instead of counting the whole
378
+ entity set.
379
+ - `$orderby` places nulls first for ascending and last for descending order, as
380
+ the specification requires.
381
+ - Client `URIBuilder` replaces a system query option that is set twice instead
382
+ of emitting it twice, and percent-encodes path segments and key literals.
383
+ - Client `get_property_value` handles raw `$value` responses; `invoke_action`
384
+ serializes `Decimal`, `datetime`, `UUID` and `bytes` parameters; `bytes`
385
+ property values are written as base64; `update_entity(method="REPLACE")`
386
+ maps to PUT; `ODataClientError` no longer raises while parsing a non-object
387
+ error body.
odatapy-5.0.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
odatapy-5.0.0/NOTICE ADDED
@@ -0,0 +1,7 @@
1
+ odatapy
2
+ Copyright 2026 Beroe Inc.
3
+
4
+ This product is a Python port of Apache Olingo OData 4 (https://olingo.apache.org/),
5
+ Copyright The Apache Software Foundation, licensed under the Apache License 2.0.
6
+ Protocol behaviour, type-system semantics and API naming follow Apache Olingo;
7
+ no Apache Olingo source code is redistributed in this package.