ausecon-mcp-server 0.5.0__py3-none-any.whl
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.
- ausecon_mcp/__init__.py +1 -0
- ausecon_mcp/cache.py +29 -0
- ausecon_mcp/catalogue/__init__.py +1 -0
- ausecon_mcp/catalogue/abs.py +889 -0
- ausecon_mcp/catalogue/rba.py +947 -0
- ausecon_mcp/catalogue/resolver.py +333 -0
- ausecon_mcp/catalogue/search.py +134 -0
- ausecon_mcp/errors.py +17 -0
- ausecon_mcp/models.py +61 -0
- ausecon_mcp/parsers/__init__.py +1 -0
- ausecon_mcp/parsers/abs_csv.py +100 -0
- ausecon_mcp/parsers/abs_structure.py +72 -0
- ausecon_mcp/parsers/rba_csv.py +131 -0
- ausecon_mcp/providers/__init__.py +1 -0
- ausecon_mcp/providers/_retry.py +43 -0
- ausecon_mcp/providers/abs.py +105 -0
- ausecon_mcp/providers/rba.py +113 -0
- ausecon_mcp/server.py +245 -0
- ausecon_mcp/validation.py +150 -0
- ausecon_mcp_server-0.5.0.dist-info/METADATA +412 -0
- ausecon_mcp_server-0.5.0.dist-info/RECORD +24 -0
- ausecon_mcp_server-0.5.0.dist-info/WHEEL +4 -0
- ausecon_mcp_server-0.5.0.dist-info/entry_points.txt +2 -0
- ausecon_mcp_server-0.5.0.dist-info/licenses/LICENSE +21 -0
ausecon_mcp/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""ausecon-mcp-server package."""
|
ausecon_mcp/cache.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from time import monotonic
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@dataclass
|
|
9
|
+
class _CacheEntry:
|
|
10
|
+
expires_at: float
|
|
11
|
+
value: Any
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class TTLCache:
|
|
15
|
+
def __init__(self) -> None:
|
|
16
|
+
self._entries: dict[str, _CacheEntry] = {}
|
|
17
|
+
|
|
18
|
+
def get(self, key: str) -> Any | None:
|
|
19
|
+
entry = self._entries.get(key)
|
|
20
|
+
if entry is None:
|
|
21
|
+
return None
|
|
22
|
+
if entry.expires_at < monotonic():
|
|
23
|
+
self._entries.pop(key, None)
|
|
24
|
+
return None
|
|
25
|
+
return entry.value
|
|
26
|
+
|
|
27
|
+
def set(self, key: str, value: Any, ttl_seconds: int) -> Any:
|
|
28
|
+
self._entries[key] = _CacheEntry(expires_at=monotonic() + ttl_seconds, value=value)
|
|
29
|
+
return value
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Curated catalogue metadata for ABS and RBA datasets."""
|