Spaces:
Runtime error
title: Monthly Employed Persons by Occupation and DAIOEs
emoji: π
colorFrom: yellow
colorTo: indigo
sdk: docker
pinned: false
license: mit
Monthly Employed Persons by Occupation and DAIOEs
Live app on Hugging Face Spaces
Overview
This repository builds and deploys the AI Exposure & Employment Dashboard β an interactive Shiny app for exploring monthly Swedish employment by occupation alongside DAIOE (Dynamic AI Occupational Exposure Index) scores.
DAIOE measures the potential applicability of AI to occupational content over time. It tracks annual progress across nine AI subdomains (games, vision, language, speech) and links capability advances to occupational requirements via O*NET abilities, weighted by ability importance and social-skill intensity. It is a measure of AI exposure, not adoption or automation probability. See the AI-Econ Lab for full methodology.
The dashboard filters observations by year, sex, occupation, DAIOE metric, and employment-change horizon, then shows summary value boxes (average AI exposure, median employment change, observation count), a Plotly scatter plot with an OLS trendline, and a filterable data table.
Runtime Files
The deployable app is intentionally small:
app.pydefines the Shiny Express app._brand.ymldefines the Shiny theme and points to the lab logo.logos/lab.svgis shown in the app sidebar and README.data/scb_months_lvl1.parquetis the app dataset.Dockerfile,.dockerignore,pyproject.toml, anduv.lockdefine the containerized runtime.
Dependencies
Key Python packages (see pyproject.toml for pinned versions):
| Package | Purpose |
|---|---|
shiny[theme] |
Shiny for Python web framework |
shinywidgets |
Plotly widget integration |
plotly |
Interactive scatter plots |
polars |
Fast dataframe operations |
pandas |
DataFrame conversion for Plotly |
pyarrow |
Parquet file I/O |
statsmodels |
OLS trendline in scatter plot |
Requires Python β₯ 3.14.
Local Development
Install dependencies with uv:
uv sync
Run the app locally:
uv run shiny run app.py --reload
Or run with the project virtual environment directly:
.venv/bin/python -m shiny run app.py --reload
Docker
Build the image:
docker build -t ai-econ-daioe-months .
Run it locally:
docker run --rm -p 7860:7860 ai-econ-daioe-months
The container serves the app on http://127.0.0.1:7860.
Branch Workflow
This repository uses separate branches for each stage of the data and deployment pipeline.
| Branch | Purpose | Main output |
|---|---|---|
scb_pull |
Pulls or prepares the monthly SCB employment data. The SCB Pull -> DAIOE Pull workflow runs main.py on this branch. |
data/scb_months.parquet |
daioe_pull |
Receives the SCB output and enriches or merges it with DAIOE exposure data. The DAIOE Pull -> Development workflow runs main.py here. |
data/scb_months_lvl1.parquet |
development |
Integration branch for the merged dataset and deployable app files before promotion. The Development -> Main workflow promotes the deploy bundle from here. |
deploy-ready app files |
main |
Production/deployment branch. This branch contains the Dockerized Shiny app and syncs to Hugging Face Spaces. | running dashboard |
The pipeline is therefore:
scb_pull -> daioe_pull -> development -> main -> Hugging Face Spaces
GitHub Actions
The repository contains four workflows:
.github/workflows/01_scb_pull_to_daioe_pull.ymlbuilds the base SCB parquet and pushes it todaioe_pull..github/workflows/02_daioe_pull_to_development.ymlbuilds the DAIOE-enriched parquet and pushes it todevelopment..github/workflows/03_development_to_main.ymlpromotes deployable app files tomain..github/workflows/sync_to_hub.ymlsyncsmainto the Hugging Face Spacejoseph-data/app_months.
The scheduled workflows run daily at 00:00 UTC, and each can also be run manually
with workflow_dispatch.
Data Shape
The app dataset (data/scb_months_lvl1.parquet) has monthly occupation-level rows with:
year,month,sex,occupation,emp_countβ dimensions and employment countpct_chg_1m,pct_chg_3m,pct_chg_6mβ percentage employment change over 1, 3, and 6 months
DAIOE weighted-average exposure columns (daioe_*_wavg) used as x-axis metrics:
| Column | Label |
|---|---|
daioe_allapps_wavg |
All AI Applications |
daioe_stratgames_wavg |
Strategic Games |
daioe_videogames_wavg |
Video Games |
daioe_imgrec_wavg |
Image Recognition |
daioe_imgcompr_wavg |
Image Compression |
daioe_imggen_wavg |
Image Generation |
daioe_readcompr_wavg |
Reading Comprehension |
daioe_lngmod_wavg |
Language Models |
daioe_translat_wavg |
Translation |
daioe_speechrec_wavg |
Speech Recognition |
daioe_genai_wavg |
Generative AI |