# FCTE connected sample: Nairobi

Website release 5.74. Source profile snapshot 2026-07-02. Sample build 2026-09-07.

## Five-minute quick start

Extract this folder. Install Python 3 if it is not already available, open a terminal here and run:

    python quickstart.py

On Windows, `py quickstart.py` is an alternative. No third-party Python packages, account or network connection are required. This creates `connected.sqlite`, `resident-coverage.csv`, `timeline.csv`, and `checks.json` in this folder. `queries.sql` contains the exact joins and checks; SQLite is included in Python. To show another included resident:

    python quickstart.py --citizen 832765

## Data

32 supplied profiles: 3414569, 832765, 2889569, 58, 61, 80, 89, 207, 298, 333, 427, 509, 578, 875, 880, 897, 1082, 1100, 1268, 1358, 1746, 4508, 6230, 14999, 17116, 17292, 17532, 1396259, 1397167, 1400750, 2095458, 2139135. Seven CSV tables, schema, queries, a JSON bundle and unchanged original profiles. See sample.json for field names, source paths, JSON pointers, measured denominators and relationship basis. Every row traces to an original JSON object. These flattened tables are a teaching export, not a copy of a production database schema.

- 32 existing profiles demonstrate five domain areas. The cohort is not a representative sample of Nairobi.
- Education, employment and health records inherit their resident association from the supplied nested profile. This export does not establish independent cross-table database integrity.
- Household formation is an entity event. Current household membership is snapshot context; no resident joining date is supplied.
- Only supplied enrollment, contract and visit dates are shown. Gaps do not imply no activity or a complete life history.
- record_key and event_key are generated row locators, not original database primary keys. Native citizen, household, patient and visit IDs are preserved.
- This sample tests structure and navigation. It does not establish clinical correctness, population realism, causal effects or model performance.

## Reproduce and inspect

The script verifies the packaged files against manifest.json, loads the CSVs with foreign-key enforcement, checks unique IDs and date bounds, runs the provided SQL joins, and writes the timeline in date order. A digest detects a changed package file; it is not an independent signature or certification. checks.json records local sample checks, not fresh checks against the city database. Source hashes and original website paths are recorded in sample.json.

## Use and licence

This free FCTE demonstration extract is for evaluation under the existing FCTE data licence included as LICENCE.txt. Commercial city/domain scope and delivery follow the agreed licence. The quick-start scripts are supplied as part of this evaluation example. No new licence rights are implied.

## Worked task: inspect a resident record coverage report

Question: how many enrollment, employment and visit records are supplied for each included resident?

Run `python quickstart.py`. Query 1 in `queries.sql` counts each related table separately so a many-table join does not multiply the rows. Open the generated `resident-coverage.csv`. It must match `expected/resident-coverage.csv` exactly. Across all 32 residents, the counts are 161 enrollments, 32 contracts and 288 visits. These are supplied-record counts, not outcome measures or complete life histories. `expected/totals.json` records those totals and 556 derived dated events.

Query 2 follows one resident through the supplied dates. Run `python quickstart.py --citizen 832765` to change the resident, then compare `timeline.csv` with the browser timeline. Query 3 reports person events outside birth/snapshot bounds. The loader stops on a changed package file, unresolved declared foreign key, unexpected count, date exception or differing expected coverage. Nothing is sent to a server.

## Cohort selection and version history

This v2 package includes all 32 of the 113 supplied Nairobi profiles with non-empty household, education, employment contracts and health visits. This criterion explains the 32/32 coverage result; it does not estimate availability in the city. Associations inherited from profiles remain labelled. The earlier three-resident v1 ZIP remains a separate historical package. Source snapshots are unchanged.
