Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:

concurrency:
group: pages
cancel-in-progress: true
cancel-in-progress: false

env:
JUST_VERSION: "1.51.0"
Expand Down
62 changes: 54 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,67 @@ just update # Convert to Parquet (DuckDB)
just import # Load into PostgreSQL
```

To process a specific dataset:

```bash
DATAS_LIST=sirene just update
DATAS_LIST=sirene just import
```

> **Note:** `DATAS_LIST` accepts multiple comma-separated dataset names:
>
> ```bash
> DATAS_LIST=sirene,vigilo just update
> DATAS_LIST=geonames,vigilo,nafrev2,sirene just import
> ```

Available datasets: `geonames`, `vigilo`, `sirene`, `nafrev2`
### Per-dataset workflows

Each dataset has two workflows: **update** (full refresh from source → publish to R2) and **import** (consume published Parquet files from R2).

#### GeoNames

```bash
# Full update (download from geonames.org, convert, publish)
DATAS_LIST=geonames just download
DATAS_LIST=geonames just update
DATAS_LIST=geonames just release

# Import only (download Parquet from R2, load into DuckDB)
DATAS_LIST=geonames just import
```

#### Vigilo

```bash
# Full update (download from Vigilo API, convert, publish)
DATAS_LIST=vigilo just download
DATAS_LIST=vigilo just update
DATAS_LIST=vigilo just release

# Import only (download Parquet from R2, load into DuckDB)
DATAS_LIST=vigilo just import
```

#### NAF Rev. 2

```bash
# Full update (download from INSEE, convert, publish)
DATAS_LIST=nafrev2 just download
DATAS_LIST=nafrev2 just update
DATAS_LIST=nafrev2 just release

# Import only (download Parquet from R2, load into DuckDB)
DATAS_LIST=nafrev2 just import
```

#### SIRENE

```bash
# Full update (download from data.gouv.fr ~4 GB, convert, publish)
DATAS_LIST=sirene just download
DATAS_LIST=sirene just update
DATAS_LIST=sirene just release

# Import only (download Parquet from R2, load into DuckDB)
DATAS_LIST=sirene just import
just sirene-etab-parquets # generate Observable etab/ parquets from APE parquets
```

> **Note:** SIRENE download is ~4 GB. `just sirene-etab-parquets` must be run after import to generate the per-letter establishment parquets used by the Observable interface.

---

Expand Down
4 changes: 2 additions & 2 deletions importer/release_download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ for dataset in $datasets; do

echo "[release-download] ${dataset}: syncing from ${tag}..."
python3 - "$manifest_local" "$dataset" "$FORCE" "$DL_TMP" "$REPO" "$tag" << 'PYEOF'
import sys, json, os, subprocess
import sys, json, os, shutil, subprocess

manifest_path, dataset, force, dl_tmp, repo, tag = sys.argv[1:]
force = force == "1"
Expand All @@ -79,7 +79,7 @@ for asset_name, rel_path in manifest.items():
print(f"[release-download] ERROR downloading {asset_name}: {result.stderr.strip()}")
continue
downloaded = os.path.join(dl_tmp, asset_name)
os.rename(downloaded, target)
shutil.move(downloaded, target)
print(f"[release-download] {asset_name} → {target}")
PYEOF

Expand Down
Loading
Loading