fd-open-data-protocol 0.5.3__tar.gz → 0.5.4__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.
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/PKG-INFO +1 -1
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/__init__.py +1 -1
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/line_ops/wellknown.py +20 -7
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol.egg-info/PKG-INFO +1 -1
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/tests/test_line_ops.py +31 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/LICENSE +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/README.md +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/conformance_adapter.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/constants.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/line_ops/__init__.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/line_ops/assemble.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/line_ops/auth_gate.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/line_ops/client.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/line_ops/config.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/loader.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/openalex_provider.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/provider.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/registry.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/registry_cli.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/registry_store.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/schema.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/surface_report.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/surface_selfcheck.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/vocabulary/alignment/foundation.yaml +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/vocabulary/concepts.yaml +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/vocabulary/crosswalks/datacommons-worldbank.yaml +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/vocabulary/entity_types.yaml +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/vocabulary/event_types.yaml +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/vocabulary/qualifiers.yaml +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/vocabulary/relation_types.yaml +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/vocabulary/units.yaml +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/vocabulary.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol.egg-info/SOURCES.txt +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol.egg-info/dependency_links.txt +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol.egg-info/entry_points.txt +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol.egg-info/requires.txt +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol.egg-info/top_level.txt +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/pyproject.toml +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/setup.cfg +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/tests/test_drift_inventory.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/tests/test_loader.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/tests/test_openalex_provider.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/tests/test_registry_pipeline.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/tests/test_registry_schema.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/tests/test_schema_vocabulary.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/tests/test_surface_report.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/tests/test_surface_selfcheck.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/tests/test_vocabulary.py +0 -0
- {fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/tests/test_vocabulary_additive.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fd-open-data-protocol
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.4
|
|
4
4
|
Summary: The open-data datasource protocol: a manifest contract a datasource exposes to be ingested by fd-open-data-mcp (or any consumer).
|
|
5
5
|
Author: FindDataOfficial
|
|
6
6
|
License: MIT
|
|
@@ -84,14 +84,9 @@ def register(mcp, anchor: Path | str | None = None) -> None:
|
|
|
84
84
|
``wellknown.py`` adapter) so the manifest candidate chain resolves
|
|
85
85
|
against that repo, not against this shared package.
|
|
86
86
|
"""
|
|
87
|
-
|
|
88
|
-
raise RuntimeError(
|
|
89
|
-
"fastmcp 缺 custom_route:无法挂 " + WELL_KNOWN_PATH + "(升级依赖,别静默跳过)"
|
|
90
|
-
)
|
|
91
|
-
@mcp.custom_route(WELL_KNOWN_PATH, methods=["GET"])
|
|
92
|
-
async def line_manifest(_request): # noqa: ANN001 - ASGI boundary
|
|
93
|
-
from starlette.responses import Response # only the HTTP branch needs it
|
|
87
|
+
from starlette.responses import Response # only the HTTP branch needs it
|
|
94
88
|
|
|
89
|
+
def _response() -> "Response":
|
|
95
90
|
status, body, extra = manifest_response(anchor)
|
|
96
91
|
headers = {k.decode(): v.decode() for k, v in extra}
|
|
97
92
|
return Response(
|
|
@@ -100,3 +95,21 @@ def register(mcp, anchor: Path | str | None = None) -> None:
|
|
|
100
95
|
media_type="application/json; charset=utf-8",
|
|
101
96
|
headers=headers,
|
|
102
97
|
)
|
|
98
|
+
|
|
99
|
+
if hasattr(mcp, "custom_route"):
|
|
100
|
+
@mcp.custom_route(WELL_KNOWN_PATH, methods=["GET"])
|
|
101
|
+
async def line_manifest(_request): # noqa: ANN001 - ASGI boundary
|
|
102
|
+
return _response()
|
|
103
|
+
|
|
104
|
+
return
|
|
105
|
+
|
|
106
|
+
if hasattr(mcp, "get"):
|
|
107
|
+
@mcp.get(WELL_KNOWN_PATH, include_in_schema=False)
|
|
108
|
+
async def line_manifest_route():
|
|
109
|
+
return _response()
|
|
110
|
+
|
|
111
|
+
return
|
|
112
|
+
|
|
113
|
+
raise RuntimeError(
|
|
114
|
+
"应用既没有 custom_route 也没有 get:无法挂 " + WELL_KNOWN_PATH + "(别静默跳过)"
|
|
115
|
+
)
|
{fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fd-open-data-protocol
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.4
|
|
4
4
|
Summary: The open-data datasource protocol: a manifest contract a datasource exposes to be ingested by fd-open-data-mcp (or any consumer).
|
|
5
5
|
Author: FindDataOfficial
|
|
6
6
|
License: MIT
|
|
@@ -207,3 +207,34 @@ def test_register_mounts_the_endpoint_and_serves_the_manifest(tmp_path):
|
|
|
207
207
|
ok = asyncio.run(handler(None))
|
|
208
208
|
assert ok.status_code == 200
|
|
209
209
|
assert ok.headers.get("cache-control") == wellknown.MANIFEST_CACHE_CONTROL
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
def test_register_supports_a_fastapi_style_app(tmp_path):
|
|
213
|
+
"""paper-trading 是 FastAPI 单进程:register 必须走 app.get,而不是 custom_route。"""
|
|
214
|
+
import asyncio
|
|
215
|
+
|
|
216
|
+
import pytest
|
|
217
|
+
|
|
218
|
+
pytest.importorskip("starlette.responses")
|
|
219
|
+
from fd_open_data_protocol.line_ops import wellknown
|
|
220
|
+
|
|
221
|
+
class FakeApp:
|
|
222
|
+
def __init__(self):
|
|
223
|
+
self.routes = {}
|
|
224
|
+
|
|
225
|
+
def get(self, path, include_in_schema=True):
|
|
226
|
+
def deco(fn):
|
|
227
|
+
self.routes[path] = fn
|
|
228
|
+
return fn
|
|
229
|
+
|
|
230
|
+
return deco
|
|
231
|
+
|
|
232
|
+
repo = tmp_path / "repo"
|
|
233
|
+
(repo / "pkg").mkdir(parents=True)
|
|
234
|
+
anchor = repo / "pkg" / "server.py"
|
|
235
|
+
anchor.write_text("")
|
|
236
|
+
(repo / "line-manifest.json").write_text('{"line": "paper-trading"}')
|
|
237
|
+
app = FakeApp()
|
|
238
|
+
wellknown.register(app, anchor=anchor)
|
|
239
|
+
response = asyncio.run(app.routes[wellknown.WELL_KNOWN_PATH]())
|
|
240
|
+
assert response.status_code == 200
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/constants.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/line_ops/client.py
RENAMED
|
File without changes
|
{fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/line_ops/config.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/provider.py
RENAMED
|
File without changes
|
{fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/registry.py
RENAMED
|
File without changes
|
{fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/registry_cli.py
RENAMED
|
File without changes
|
{fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/registry_store.py
RENAMED
|
File without changes
|
|
File without changes
|
{fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/surface_report.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/fd_open_data_protocol/vocabulary.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fd_open_data_protocol-0.5.3 → fd_open_data_protocol-0.5.4}/tests/test_vocabulary_additive.py
RENAMED
|
File without changes
|