Skip to content
Closed
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
34 changes: 33 additions & 1 deletion .github/workflows/validate-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,48 @@ on:
jobs:
self-validate:
runs-on: ubuntu-latest
outputs:
validation_scope: ${{ steps.scope.outputs.scope }}
steps:
- uses: actions/checkout@v4
with:
# The committed Pages dump contains over a million generated files.
# Start with the validator and its tests. Data is added only when
# the pull request actually changes a record.
sparse-checkout: |
.github
app
tests
sparse-checkout-cone-mode: true
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Select validation scope
id: scope
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
echo "scope=full" >> "$GITHUB_OUTPUT"
elif gh api --paginate "repos/${GITHUB_REPOSITORY}/pulls/${{ github.event.pull_request.number }}/files" --jq '.[].filename' | grep -q '^data/'; then
echo "scope=full" >> "$GITHUB_OUTPUT"
else
echo "scope=tests" >> "$GITHUB_OUTPUT"
fi
- name: Self-check (bundled validator)
run: python -m app.validate
shell: bash
run: |
if [[ "${{ steps.scope.outputs.scope }}" == "full" ]]; then
git sparse-checkout add data
python -m app.validate
else
python -m unittest discover -s tests -v
fi

engine-validate:
needs: self-validate
if: needs.self-validate.outputs.validation_scope == 'full'
uses: GetTechAPI/TechEngine/.github/workflows/validate-data.yml@main
with:
data-ref: ${{ github.event.pull_request.head.sha || github.sha }}
55 changes: 26 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,47 @@
# TechAPI

> **Curated, open dataset for consumer electronics specs.** Free, share-alike, machine-readable.
> Curated, open dataset for consumer electronics specifications and game metadata.

[![validate-data](https://github.com/GetTechAPI/TechAPI/actions/workflows/validate-data.yml/badge.svg)](https://github.com/GetTechAPI/TechAPI/actions/workflows/validate-data.yml)
 Data: **CC-BY-SA 4.0**
Data: **CC-BY-SA 4.0**

This repo holds the curated **dataset** and the **public site** (Astro intro +
playground). The API server, ingestion crawlers, coverage checks, and the
static-dump generator live in
[**TechEngine**](https://github.com/GetTechAPI/TechEngine).
This repository owns the versioned dataset and the public Astro site. The API
server, ingestion crawlers, coverage checks, and static-dump generator live in
[TechEngine](https://github.com/GetTechAPI/TechEngine), included here as the
`TechEngine` submodule.

## Layout

```text
data/brand/<country>/<slug>.json # e.g. data/brand/kr/samsung.json
data/soc/<manufacturer>/<year>/<slug>.json # data/soc/qualcomm/2024/snapdragon-8-elite.json
data/smartphone/<brand>/<year>/<slug>.json # data/smartphone/samsung/2025/galaxy-s25.json
data/gpu/<manufacturer>/<year>/<segment>/<slug>.json # data/gpu/nvidia/2025/consumer/geforce-rtx-5090.json
data/cpu/<manufacturer>/<year>/<segment>/<slug>.json # data/cpu/intel/2023/consumer/core-i9-14900k.json
data/brand/<country>/<slug>.json
data/cpu/<manufacturer>/<year>/<segment>/<slug>.json
data/gpu/<manufacturer>/<year>/<segment>/<slug>.json
data/smartphone/<brand>/<year>/<slug>.json
data/game/<slug[:2]>/<slug>.json
site/ # Astro Pages site
site/public/v1/ # committed static API dump from TechEngine
app/validate.py # stdlib-only, fast repository self-check
```

All paths use singular folder names. Slugs are kebab-case and unique within each category.
The game directory is sharded by normalized slug rather than genre or import
batch. See [the data layout guide](docs/DATA_LAYOUT.md) before adding or moving
game records.

The Astro site lives under `site/` and is the deploy target for GitHub Pages. It
consumes the static JSON dump produced by TechEngine's `weekly-refresh` workflow.

## Self-Check

A lightweight bundled validator lives at `app/validate.py`. It runs on every PR via
[`validate-data.yml`](.github/workflows/validate-data.yml) and is also chained into
the heavier TechEngine validation workflow as a downstream job.
## Local workflow

```bash
python -m app.validate
cd site && npm ci && npm run build
```

The validator uses only the Python standard library; no install step required.

## Contributing
Use TechEngine for ingest, API, and dump generation. Do not change its code or
submodule pointer as part of a data-only change. The committed
`site/public/v1/` dump is deployed by GitHub Pages; its contents must remain in
the repository even when it is too large to browse comfortably locally.

Open a PR with the new/updated JSON file. The PR template walks through what to
include. The validator must pass. All records (`brand`, `soc`, `smartphone`,
`gpu`, and `cpu`) must include `source_urls` with at least one canonical
reference (vendor product page, Wikipedia infobox, datasheet).
For a focused workflow and the boundary between this repository and TechEngine,
see [docs/LOCAL_WORKFLOW.md](docs/LOCAL_WORKFLOW.md).

## License

Data is licensed **CC-BY-SA 4.0**; attribute "Data from TechAPI" and share alike.
The bundled validator code is [MIT](LICENSE).
Data is licensed **CC-BY-SA 4.0**. The bundled validator is [MIT](LICENSE).
Loading
Loading