Contributing to Base Data

Our base data is becoming a valuable asset that accelerates our shared work. This page documents how you can contribute your project’s data so that it works seamlessly with the rest of the devstack, and how curators turn contributions into published, versioned datasets at https://data.teemlabs.org.

Once your data is in base data:

  1. Files are downloaded automatically by get_path(), so anyone who clones your code can run it.
  2. All rasters are Pyramidal Cloud-Optimized GeoTIFFs (POGs), which gives, among many other things:
    1. downloading a subset of a single raster;
    2. precise and very fast zonal statistics;
    3. very accurate area-per-cell calculations, without the imprecision of projected data.

Why data needs its own route

To make a project fully replicable, its code must be in an open git repo. Git is not good at managing data, though, so someone who clones your code will find it fails, because the repo doesn’t (and shouldn’t, for anything over about 5 MB) include the data. The devstack solves this by downloading base data automatically through p.get_path() whenever it is needed. For your project to “just work”, its data must get into base data, in the right place and the right format. This page describes that route.

There are two roles:

  • Contributors (any lab member) put data in the submissions inbox, base_data_submissions/, and point their code at it.
  • Curators (who hold the R2 write credentials) review submissions, promote them into base_data/ with an ingestion script and a manifest, and publish them to the canonical store. Only publishing writes to data.teemlabs.org.

Contributors never write into base_data/, on Drive or locally. Everything in base_data/ is either published or about to be, together with the code that made it.

For contributors: submitting data

1. Put your data in base_data_submissions/<project>/

The inbox is the base_data_submissions folder on the NatCapTEEMs shared drive, beside (never inside) base_data:

NatCapTEEMs/Files/
    base_data/                  published data: read only, for everyone
    base_data_submissions/      the inbox: one folder per project
        air_quality/
            README.md
            emissions_factors.csv
            pm25_concentration_2020.tif
            raw/                optional: what you downloaded, exactly as provided

Make one folder named for your project (lowercase, underscores), and put everything your code reads in it. Keep a local copy at ~/Files/base_data_submissions/<project>/, laid out the same way: that is where your code finds the files while you work.

The older base_data/submissions/ folder on the drive is retired. If you have data there, move it into base_data_submissions/<project>/.

2. Write a README.md

The README is what the curator turns into your data’s catalogue entry, so for every file it should say:

What Example
What the file is and how to interpret it “Annual mean PM2.5 concentration for 2020.”
Units µg/m³, ha, tonnes, class codes (with the legend)
Variable class (rasters only) extensive (amounts that add up: hectares, tonnes, people), intensive (rates and proportions: yields, shares), categorical (class labels: land cover) or covariate (other continuous values: elevation, temperature)
Source and citation The dataset, its version, its DOI or download URL
Licence CC-BY-4.0, or the licence’s name and URL
Code that produced it The repo, script and commit

If you downloaded something and changed it, put the download exactly as provided in raw/ and say in the README how you got from it to your files. The variable class matters: it decides how the POG’s coarser resolutions are computed (summed, averaged or by mode), and the curator can’t guess it.

3. Point your code at the submission

Change your repo so that all data (absolutely all) are referenced through a reference path into your submission folder, starting with base_data_submissions. For instance, for the file emissions_factors.csv in the air_quality project:

p.emissions_factors_ref_path = os.path.join('base_data_submissions', 'air_quality', 'emissions_factors.csv')

A reference path (ref path) is what get_path finds and, for published data, downloads; the canonical definition, including the order of directories get_path searches, is in Conventions.

Note

Until get_path searches the inbox itself (planned, but not built yet), add your ~/Files folder to its search when you resolve a submission:

p.emissions_factors_path = p.get_path(p.emissions_factors_ref_path,
                                      prepend_possible_dirs=[os.path.join(os.path.expanduser('~'), 'Files')])

This finds ~/Files/base_data_submissions/air_quality/emissions_factors.csv. Remove the argument once get_path resolves base_data_submissions/… refs on its own.

4. Tell the curator

Once 1–3 are done, email Justin. The curator then tests your repo by cloning it, changing only the base data location, and checking that everything runs.

What happens next

The curator promotes your submission:

  1. Cleans the data to follow the Conventions: files are named for what they are, with no revision words such as _v2 or _final, and every raster becomes a POG at its resolution (pm25_concentration_2020.tif, say: no rung suffix, since a single POG carries its rung in its metadata and its coarser rungs as overviews).
  2. Moves it into base_data/ in the collection it belongs to, with an ingestion script and a manifest (see the curators’ section below).
  3. Publishes it, so it appears on data.teemlabs.org with your README’s metadata, and anyone’s get_path can download it.

Because cleaning usually changes the name, promotion changes the ref path: change your code from the base_data_submissions/… ref path to the new one (for example os.path.join('air_quality', 'pm25_concentration_2020.tif')) and drop the prepend_possible_dirs argument. It then works for you and for everybody else. (A redirect, so that old submission ref paths keep working after promotion, is planned but not built.)

The curator is happy to do the cleaning, but following the conventions early in your project, rather than at the end, saves everyone time.

For curators: promoting and publishing

The store

The canonical store is the Cloudflare R2 bucket teems-public-data, served at https://data.teemlabs.org. Your local ~/Files/base_data is the reference copy from which it is published. The design, with every decision and the reasons for it, is the base data store proposal.

In R2 What it is
<ref path> (e.g. lulc/esa/lulc_esa_2022.tif) The current version of each dataset, at its plain ref path.
static/<ref path without extension>/v<release>.<ext> Versions that were replaced, under the release that published them (e.g. static/lulc/esa/lulc_esa_2022/v2026_10_20_1.tif).
_release/<release>.json, _release/latest.json Each release (YYYY.MM.DD.N), listing every dataset’s version and content hash, and which release is the latest.
_catalogue/<ref path>/<release>.json One entry per dataset version: files, hashes, POG description, licence, source, code and provenance.
index.html, <folder>/index.html The browsable pages (see below).

Publishing needs R2 credentials in ~/.config/hazelbean/machine.env (HB_R2_ACCOUNT_ID, HB_R2_ACCESS_KEY_ID, HB_R2_SECRET_ACCESS_KEY), never committed. Reading needs nothing.

Dataset folders

Each dataset folder in base_data/ carries its own lineage beside its data:

base_data/lulc/esa/
    lulc_esa_base_data_ingestion.py    raw input -> the files below, then writes the manifest
    lulc_esa_base_data_manifest.csv    one row per dataset in this folder, with its metadata
    lulc_esa_base_data_legend.csv      the classes of a categorical raster (new datasets, since 2026-11-19)
    readme.md                          generated from the three files above (new datasets, since 2026-11-19)
    lulc_esa_1992.tif ... lulc_esa_2022.tif
    raw/                               the raw input, exactly as downloaded (never uploaded)

The rules are in Conventions, under “Base data dataset folders and raw/”. In short: the ingestion script is the only code allowed in base_data/ and is kept thin; raw/ holds the input exactly as provided at its download link and is never uploaded; the script records where each raw file came from; and a step whose history is unknown is a function that says so rather than being left out.

There are three kinds of ingestion script:

  1. A raw-data ingest that lives entirely in base_data/, such as lulc/esa: it converts raw/ to POGs, skipping what is already converted, then lists the files.
  2. A thin call to code in another repo, such as pyramids, which writes any missing area raster with hb.write_ha_per_cell_pog, then lists them.
  3. A bespoke script that moves the outputs of a finished project into base_data/ and lists them. A promoted submission is usually this kind.

An ingestion script with more than one step can be a ProjectFlow run file in the devstack’s single-file form (a build_task_tree, a run_project(p) and a __main__ guard); base_data/lulc/esa/seals7/lulc_esa_seals7_base_data_ingestion.py is the example. Because it is a base data script it departs from the run-file conventions in two ways: its tasks write straight to the ref paths under base_data/ rather than into their own task folders, so the project folder holds only logs; and its scenarios CSV, <name>_base_data_scenarios.csv, sits flat beside the script like the manifest, not in an input_template/ folder, because a dataset folder is a flat, self-describing record and the CSV is part of the lineage rather than run configuration to be shadowed by input/ overrides.

Writing an ingestion script

Copy an existing one (base_data/lulc/esa/lulc_esa_base_data_ingestion.py is the fullest example). Its docstring is the lineage, read top to bottom, and it is also published as the About section of the folder’s page on data.teemlabs.org, so write it for a reader. Most scripts end with one call:

DRY_RUN = True   # first: lists what would happen to every file, and any problem, and writes nothing

METADATA = dict(
    license="CC-BY-4.0",            # or the licence's name and URL
    units="µg/m³",
    data_source="...",              # dataset, version, DOI or URL
    description="...",              # what it is and how to interpret it
    code="base_data/air_quality/air_quality_base_data_ingestion.py",
)
OVERRIDES = {"*_2020_*.tif": {"description": "..."}}   # per-file changes, by pattern; later patterns win

hb.add_directory_to_base_data(SOURCE_DIR, "air_quality", manifest_path, variable_class="intensive",
                              overrides=OVERRIDES, include=["*.tif"], include_subdirectories=False,
                              dry_run=DRY_RUN, **METADATA)

hb.add_directory_to_base_data places or keeps the files under their ref paths, converts rasters that aren’t POGs yet (in place, deleting each original once its POG is written; make_pogs=False leaves that to publishing), and adds a row per new dataset to the folder’s manifest, <name>_base_data_manifest.csv. It skips code, manifests, GDAL sidecars, raw/ and temporary files, runs file by file in parallel, never writes to R2, and ends with the publishing dry run. A manifest has one row per dataset:

Column Meaning
ref_path The dataset’s full ref path.
kind, tier Dataset kind and bucket tier. Only pog and public can be published so far.
variable_class For rasters: extensive, intensive, categorical or covariate.
license, units, data_source, description Required; copied into the catalogue entry and shown on the folder’s page.
code The script that produced the files.
color_ramp For a continuous raster: proportion #rrggbb, divergent #rrggbb #rrggbb, amount #rrggbb <median> <high> or measure <ramp> <low> <high> (see Colour ramps). Empty for other files, and absent from manifests written before 2026-11-19.
legend For a categorical raster: the file name of its legend, beside the manifest. Empty otherwise. Manifests written before 2026-11-19 lack the column and read as if it were empty.

Leave DRY_RUN = True, read the report, then set it to False and run the script again. DRY_RUN can also be a date, "2026-10-20": a real run on that day, and a dry run again from the next day on, so a script never stays armed (hb.resolve_dry_run).

Legends for categorical rasters, and the readme

A categorical raster is only usable with its classes, so from 2026-11-19 every categorical raster added to the store comes with a legend, <name>_base_data_legend.csv beside the manifest, one row for every value the raster can hold:

Column Meaning
id The cell value, a whole number from 0.
label A short lowercase label, as Conventions defines one.
name The class’s name for people, short enough for a map legend.
description What the class is: the source’s definition, written out, not the name again.
color The class’s colour, #rrggbb.

Every cell is filled, and the file is UTF-8 with a byte order mark like the manifests. Build it from the source: the article, the product user guide or the style file the provider ships give the names, the definitions and usually the colours. Say in the ingestion script’s docstring which document they came from, and when the source has no colours, that the colours are ours. One legend serves every raster that shares it.

Give it to the listing call, for every categorical file or by pattern:

hb.add_directory_to_base_data(SCRIPT_DIR, "lulc/esa", manifest_path, variable_class="categorical",
                              legend="lulc_esa_base_data_legend.csv", dry_run=DRY_RUN, **METADATA)
# or: overrides={"*_class_*.tif": {"variable_class": "categorical", "legend": "..._base_data_legend.csv"}}

It checks the legend (hb.read_base_data_legend), records it in the manifest’s legend column, and writes the colours into the header of every raster it converts, so QGIS and other viewers show the classes in their colours unasked. A script that builds its POGs itself passes the colours at that point, hb.make_path_pog(..., color_table=hb.get_legend_color_table(legend_path)): a colour table can only be written while a POG is built, because editing a finished POG’s header breaks its cloud-optimized layout. For the same reason rasters already in the store are not given legends retroactively; they get one when they are next rebuilt. For a dataset that was listed before it had a legend, hb.set_base_data_legend(manifest_path, "<name>_base_data_legend.csv") names the legend on the categorical rows already in the manifest and rewrites the readme, without touching a raster (include=[...] limits it to some files); the page, the sidecar and the readme then show the classes, and the readme says that the rasters’ headers carry no colours yet. This was done on 2026-11-19 for the nine folders with categorical rasters at the time (lulc/esa, lulc/esa/seals7, lulc/glc_fcs30d, forests/global_forest_management, forests/gmw, forests/tmf, water/hydrosheds, osm/rwa, osm/saint_paul_mn). A categorical raster listed without a legend is a warning in the report, not a refusal: a raster of zone ids such as ee_r264_ids.tif has none, since its values are keys into a correspondence.

The legend then appears in three places without further work: on the folder’s page (a Legend section after Metadata, with a swatch for each class and the QGIS colour map to copy), in each file’s yml sidecar (the classes in the band description), and in the folder’s readme.md.

The readme is generated by hb.write_base_data_readme, which hb.add_directory_to_base_data calls at the end of every real run. It holds what the folder’s page shows, as a file that sits with the data: the first paragraph of the ingestion script’s docstring, the metadata the files share and a table of the files, each legend as a table (value, label, name, colour as hex and RGB, description) and as a QGIS colour map, and the docstring as the processing steps. It ends with the note on how it was generated, so what the folder holds comes first. To use the colour map, save the block as a .txt file and load it in QGIS under Layer Properties, Symbology, Paletted/Unique values, Load Color Map from File. Never edit the readme: change the docstring, the metadata or the legend and rerun the script. Readmes and legends are tracked in the base_data repository with the scripts and manifests; they are not datasets, so they are not listed or uploaded.

Each readme also has a page, readme.html beside it: the readme in the look of data.teemlabs.org, as one file that opens from disk with no server and no connection (the styles and the logo are inside it). hb.write_base_data_readme_html(site_dir) renders a readme through the site’s own folder page template (docs/base_data/_folder_page.qmd and _styles.css; needs Quarto). Whatever writes a readme writes its page too, so a real run of an ingestion script leaves both; the templates are looked for in ~/Files/earth_economy_devstack/docs/base_data, and where they or Quarto are missing the page is skipped with a message. publish_base_data.py also renders every folder’s page at the end of every real run. It differs from the folder’s page on the site in two ways: it exists for folders that are not published, and it has none of what only a release knows (versions, sizes, download links). To refresh every page without publishing, call the function yourself. The pages are derived from the readmes, so they are ignored by the base_data repository and never listed or uploaded.

Colour ramps for continuous rasters

A continuous raster has no classes to list, and a float GeoTIFF cannot carry colours in its header, so how it should be drawn is declared in the manifest’s color_ramp column. Two questions settle which of the four kinds a raster takes:

  1. Does a cell of exactly 0 mean there is nothing there? Then zero is drawn transparent and every other cell opaque: nothing-here shows the map underneath, and very-little-here is still visible.
  2. Do the values have a middle they run away from in two directions? Then the ramp has two colours and is centred on that middle.
color_ramp Zero means For How it is drawn
proportion #rrggbb nothing there A share of the cell, 0 to 1 (cropland share, tree cover, degree of modification). Transparent at 0; a faint, opaque tint of the colour just above 0; the colour itself, strong, at 1.0. Always 0 to 1, whatever the raster’s own range.
divergent #rrggbb #rrggbb no change A change: a difference between years or scenarios, a gain or loss, an anomaly. The first colour at the largest decrease, fading to its tint just below 0; transparent at 0; the second colour’s tint just above 0, rising to that colour at the largest increase. Symmetric about zero.
amount #rrggbb nothing there Any other quantity from 0 upward: hectares, tonnes, counts, a density, a yield, a percent of observations. Transparent at 0; faint just above 0; the colour halfway to strong at the median of the non-zero cells; strong at their 98th percentile and above.
measure viridis a value like any other A measurement: elevation, temperature, distance, a score. Opaque throughout. A many-hued ramp (viridis, magma or cividis) spread evenly from the 2nd percentile of the cells to the 98th.

The variable class does not decide this. An intensive raster can be a proportion, an amount (a density) or a divergence; a covariate whose zero means “never” (JRC surface water occurrence, the percent of observations in which a cell was water) is an amount. Ask the two questions of the data.

Colours. A proportion’s or an amount’s colour should fit the subject and be strong at the top: a dark green for forest, a blue for water. A divergent pair should read as opposites and be separable by the colour-blind: #b2182b #2166ac (red, blue) is the default for loss and gain, #8c510a #01665e (brown, blue-green) suits vegetation; never red against green. A measure names one of three ramps that are perceptually even and survive greyscale: viridis by default, magma where a dark low end suits, cividis for the most colour-blind-safe.

A divergent ramp is symmetric. Its range is minus to plus the larger of the raster’s |minimum| and |maximum|, from the POG’s exact statistics: a raster running from -2 to 8 is drawn on -8 to 8. Equal changes in either direction then get equally strong colours; a ramp stretched from -2 to 8 would paint a small loss as strongly as a large gain.

An amount is anchored on percentiles, because quantities are skewed. Maize area per 0.05 degree cell has a median of 32 ha, a 98th percentile of 797 and a maximum of 2,919: drawn straight from 0 to the maximum, half of the cells with maize would sit in the faintest hundredth of the ramp. Anchoring the middle of the ramp on the median and its top on the 98th percentile puts half of those cells in each half of the ramp, and lets the top 2 percent saturate. Zeros are left out of both numbers, or a mostly empty raster would have a median of 0. A measure uses the 2nd and 98th percentiles for the same reason at both ends.

The numbers are taken from the raster for you. Give amount #08306b or measure viridis and hb.add_directory_to_base_data completes it when it lists the raster (hb.complete_color_ramp), so the manifest holds, say, amount #08306b 32.3 797. They come from full-resolution cells, sampled where the raster has data, and are rounded to three digits. Write the two numbers by hand when several rasters must share one scale (the years of a series), since that is what makes their colours comparable.

OVERRIDES = {"*_proportion.tif": {"color_ramp": "proportion #006d2c"},
             "*_change_*.tif": {"color_ramp": "divergent #b2182b #2166ac"},
             "*_tonnes.tif": {"color_ramp": "amount #54278f"},              # median and 98th percentile filled in per file
             "*_density_????.tif": {"color_ramp": "amount #54278f 12 340"}, # one scale for every year
             "elevation.tif": {"color_ramp": "measure viridis"}}

An extensive raster’s ramp holds at its own cell size only. Its overviews are sums over larger and larger cells, so its values grow as a viewer zooms out and reads from them (the maize 98th percentile is 797 ha at 0.05 degrees and 14,840 at 0.25): zoomed out, the whole map goes to the strong colour. No ramp fixes that. Where a quantity should read correctly at every zoom, publish it as a proportion or a density as well, whose overviews are means, and put the ramp on that.

For rasters listed before they had a ramp, hb.set_base_data_color_ramp(manifest_path, "amount #08306b", include=[...]) names it on the continuous rows already in the manifest, taking each raster’s numbers as it goes, and rewrites the readme; no raster is written. This was done on 2026-11-19 for every continuous raster then listed (417 rows in ten folders); each ingestion script’s docstring says which ramp its rasters have and that the colours are ours.

The folder’s page shows each ramp as a bar with a sentence, the yml sidecar carries the sentence, and the readme gives the sentence and the QGIS colour map, which loads under Layer Properties, Symbology, Singleband pseudocolor, Load Color Map from File. A new continuous raster listed without a ramp is a warning in the report. Two cases are not covered and are left without one: values that wrap around (an aspect, a day of the year), which need a cyclic ramp, and values with a middle that is not zero (a ratio centred on 1), which are better stored as the difference from that middle and given a divergent ramp.

Promoting a submission

Promotion is done by hand until hb.promote_base_data_submission exists:

  1. Run the contributor’s code against their submission and check it works.
  2. Choose the folder in base_data/ it belongs in, and canonical names for its files.
  3. Write an ingestion script there (usually the third kind) that copies the files from base_data_submissions/<project>/ and calls hb.add_directory_to_base_data with the README’s metadata. Put the submission’s raw/, if any, in the new folder’s raw/.
  4. Run it with DRY_RUN = True, then for real.
  5. Publish (below), then tell the contributor their new ref paths. Clear their submission folder once their code uses them.

Publishing

Publishing is the only thing that writes to R2. Run earth_economy_devstack/publish_base_data.py:

DRY_RUN = True
NOTE = "Adding the air_quality PM2.5 maps"   # required to publish: like a commit message
hb.publish_base_data_from_manifests(base_data_dir=BASE_DATA_DIR, note=NOTE, dry_run=DRY_RUN, site_dir=SITE_DIR)

It finds every *_base_data_manifest.csv under base_data/, combines them (a ref path listed twice is an error), and reports each row:

Status Meaning
new, changed Not yet published, or the local bytes differ from the published version: these are published.
unchanged Already published, byte for byte.
needs_pog Listed, but not a POG yet: a real run converts it first, using its row’s variable_class.
unfinished Published, but an earlier run stopped before moving it into place: a real run finishes it.
missing_locally Listed, but not in your base_data/.
unsupported A kind publishing can’t handle yet: a shapefile.
tier_changed Published on one tier and listed on another. Nothing is done: retire it with retire_base_data.py, then publish it on the new tier.
unpublished Its tier is unpublished: listed, and hosted nowhere. The report counts these and does not name them one by one.
not_in_manifest Published, but no manifest lists it. To withdraw it, name it in retire_base_data.py (hb.retire_base_data): a new release without it, then its files are deleted.

Every new and changed dataset first passes the gate (hb.is_path_pog(full_check=True), required metadata, naming rules, dependencies), or nothing is published. When the dry run shows no problems, set DRY_RUN = False and run it again. The new and changed rows are published together as one release: staged, the versions they replace archived under static/ (pass archive_previous=False to save the storage instead), then committed atomically. If another curator’s release commits first, nothing from yours is kept and it asks you to rerun. Rerunning is always safe.

Three limits to know:

  • Editing only a row’s metadata, with the bytes unchanged, doesn’t publish a new catalogue entry: the row stays unchanged, so the catalogue keeps the old metadata (the folder’s page shows the new text, since it reads the manifest).
  • Only single-file datasets can be published so far: POG rasters (.tif), GeoPackage vectors (.gpkg) and tables (.csv, .xlsx). A shapefile is several files, so it stays unsupported for now.
  • The Drive mirror and the release notes aren’t written yet; record notable releases in the Base Data release notes by hand.

The pages at data.teemlabs.org

Every real run of publish_base_data.py ends by rebuilding the browsable pages and uploading them (it needs Quarto), then writing each published file’s metadata sidecar: a geometamaker yml at the file’s URL plus .yml, built by linneabean.metadata.publish_base_data_sidecars from the manifest row, the catalogue entry and the file’s header, and uploaded only when its text changed. It is the same format the Natural Capital Alliance’s data hub ingests, so a TEEMs file can be listed there as it is. The sidecars are not datasets: hb.add_directory_to_base_data skips .yml files, they are outside the catalogue and the release, and a page links to them only from the description. The landing page describes the collections and the store and lists every published folder as a tree. The pages name three levels: a collection (a top-level folder such as lulc) holds datasets (lulc/esa), and a dataset holds derived products (lulc/esa/seals7). Every folder holding published files gets a page in this order: Metadata (the fields its files share, then a table of the files with version, release, size, resolution, archived versions and a link to each file’s yml sidecar), the cards and tree of its subfolders, and Processing steps, the ingestion script’s docstring rendered as Markdown. Only published rows appear. A card shows the first three sentences of a folder’s text; the folder’s own page shows all of it, so a long about in _collections.yml is fine.

Each part of a page comes from one file:

To change Edit
Collection and folder titles, taglines and blurbs earth_economy_devstack/docs/base_data/_collections.yml. Top-level keys are the collections on the landing page, in order; a deeper key such as lulc/esa sets that folder’s card and page header. A folder not listed gets its tagline and blurb from the first paragraph of its ingestion script’s docstring, so a new folder needs no entry to appear.
The subfolder cards and tree on a folder page (headed Datasets on a collection’s page, Derived products on a dataset’s) and the tree on the landing page Nothing: they list every published folder, with its title, tagline and dataset count, from the same sources.
A folder’s Processing steps The docstring of its *_base_data_ingestion.py, as Markdown: hard-wrapped prose, numbered or bulleted steps (a blank line is added before a list for Pandoc), <name> placeholders stay text.
The file table The ingestion script’s METADATA and OVERRIDES; rerun it to rewrite the manifest.
A folder’s Legend section The folder’s <name>_base_data_legend.csv, named in the manifest’s legend column (see Legends).
A file’s yml sidecar Nothing by hand: it is rebuilt from the manifest row and the catalogue entry on every real publish. The contact it names is CONTACT in publish_base_data.py.
The landing page docs/base_data/_landing.html
The folder pages’ layout docs/base_data/_folder_page.qmd
Colours, fonts and spacing docs/base_data/_styles.css
The logo docs/base_data/teems_logo.png

The leading underscores keep the devstack site from rendering these templates itself. To preview a change without uploading, build the pages and serve them locally:

python -c "import hazelbean as hb; hb.write_base_data_index_pages('<path to>/earth_economy_devstack/docs/base_data', output_dir='base_data_site_preview')"
python -m http.server 8765 -d base_data_site_preview

Then open http://localhost:8765. To upload without publishing data, run the first command with dry_run=False (or run publish_base_data.py for real, which is slower because it hashes every file first). Pages are cached for 5 minutes, so a change can take that long to appear.

The site relies on one Cloudflare setting, already in place: a URL Rewrite rule on the teemlabs.org zone (Rules → Overview → Create rule → URL Rewrite Rule) that serves index.html for any path ending in /, since R2 doesn’t do that itself.

Not built yet

  • get_path resolving refs from R2, and from base_data_submissions/ (with the redirect after promotion).
  • hb.promote_base_data_submission.
  • The Drive mirror of the latest release, and automatic release notes.
  • Publishing a metadata-only change.
  • Window reads (rung=, subset=).
  • Reading the internal tier through p.get_path, the client instructions, and listing unpublished rows on the pages as available on request. Publishing to the internal tier works since 2026-11-20: set a row’s tier to internal and its file goes to the bucket behind the token and the login, while its description, sidecar and row on the public page stay public, marked as requiring credentials; see Tiers and access.

The proposal’s implementation order tracks them.