You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Python FastAPI Symbology Server that maintains persistent mappings between human-readable symbols (e.g. `NVDA`) and numeric identifiers via an HTTP API for querying/updating mappings over time.
3
+
A Python FastAPI Symbology Server that maintains persistent mappings between human-readable symbols (e.g. `NVDA`) and numeric identifiers via an HTTP API for querying/updating symbol and identifier mappings over time.
4
4
5
5
## Features
6
6
- HTTP API to register, terminate, and query symbology mappings
7
-
- Enforces:
7
+
- Enforces the following domain constraints:
8
8
- One identifier per symbol per date
9
9
- One symbol per identifier per date
10
10
- Persistent mappings until explicit termination
@@ -13,26 +13,26 @@ A Python FastAPI Symbology Server that maintains persistent mappings between hum
13
13
- Symbol for an identifier on a specified date
14
14
- All mappings overlapping a specific half-open date range `[begin, end)`
15
15
- In-memory `MappingStorage` by default
16
-
- Fully automated test suite with`pytest`
16
+
- Fully automated test suite using`pytest`
17
17
18
18
## Requirements
19
19
- Python ≥ 3.10
20
-
- Dependencies listed in `requirements.txt`
20
+
- Dependencies listed in `requirements.txt` and `pyproject.toml`
21
21
22
22
## Design Notes
23
23
-**Temporal Semantics**: A symbol’s assignment to an identifier is **persistent**. A mapping becomes active
24
24
on its `start_date` and remains active until it is explicitly terminated. All dates are ISO-8601 (`YYYY-MM-DD`) and independent of wall-clock time.
25
25
-**Reassignment Behavior**: If a symbol is reassigned to a new identifier, the previously active mapping is
26
-
then terminated at the new mapping’s start date. This behavior applies to same-day and future-dated reassignments. At any point in time, a symbol and an identifier may be in at most one active mapping.
27
-
-**Conflict Handling**: The following invariants are enforced:
26
+
then terminated at the new mapping’s start date. Each symbol and identifier can only appear in one active mapping at a time.
27
+
-**Conflict Handling**: Violations of the following invariants raise explicit domain-level exceptions (surfaced as HTTP errors):
28
28
- A symbol may have only one active identifier on a given date
29
29
- An identifier may be assigned to only one symbol on a given date
30
-
Violations raise explicit domain-level exceptions which are surfaced as HTTP errors at the API layer.
31
-
-**Storage Model**: The storage layer is implemented as an in-memory collection, which is optimal for clarity and correctness rather than performance or persistence. This helps to keep the focus on symbology semantics and temporal reasoning.
32
-
-**Scope and Limitations**: This symbology server implementation intentionally omits database persistence, concurrency control, and timezone normalization. These concerns are independent from the core problem and
33
-
can be layered on without changing the domain model.
34
-
-**Extensibility**: The domain model is intentionally decoupled from the storage layer, which allows alternative backends (e.g. database-backed, append-only log-based storage) to be introduced without changing any symbology semantics.
35
-
-**Determinism**: All query results are deterministic functions of the input date parameters and stored mappings.
30
+
-**Storage Model**: Uses an **in-memory storage layer** for clarity and correctness. Alternative storage backends (database, append-only log, etc.) can be introduced without changing the domain model.
31
+
-**Scope and Limitations**: This implementation omits:
32
+
- Database persistence
33
+
- Concurrency control
34
+
- Timezone normalization
35
+
-**Determinism**: All query results are deterministic functions of input dates and stored mappings.
0 commit comments