chaoss / chaoss/UNSDG-classifier-tool

Replace single unsdg.json download with a context/ folder (metadata.json, publiccode.yaml, README.md, debug.json)

Open
#64 0 comments 0 reactions 1 assignee Claimed by @david-lippert View on GitHub
enhancement
Dominant language
Python
Stars
12
Forks
32
Avg merge
3d 15h
Merged PRs (30d)
4

Description

Summary
One of the key purposes of our tool is to make projects that are addressing the UN SDGs discoverable by APIs and individuals. Therefore we want multiple small output files in standard formats put in a single context (metadata) folder to enable humans, bots, and APIs to easily search and find details about these impactful projects. Today, downloading SDG results produces one detailed unsdg.json file (see [handleDownload](https://github.com/chaoss/UNSDG-classifier-tool/blob/main/frontend/components/results.tsx#L128)). This issue proposes replacing that with a context/ folder (delivered as context.zip) containing four purpose-specific files:
- metadata.json — minimal machine-readable summary: {"UN SDGs": [1, 3, 7, ...]} with the SDG numbers the classifier/user settled on.
- publiccode.yml — the same "UN SDGs" list in YAML form.
- README.md — human-readable, opens with an attestation: "This project is 'highly relevant' at addressing the following United Nation (UN) Sustainable Development Goals (SDGs)", then each selected SDG's number, name, and full description.
- debug.json — today's detailed analysis JSON (predictions, confidence summary, timestamps), renamed/relocated, for anyone who wants the raw data.

Why
The single JSON file mixes a machine-readable summary with debug detail, and isn't in a format other tooling (e.g. publiccode.yaml consumers) can pick up directly. Splitting it out lets a repo maintainer drop the context/ folder straight into their own project.

Notes
- Bundled as a zip client-side (browsers can't write folders directly) using the jszip library — one click, all four files land under context/.
- Includes unit tests for the new file-building logic (frontend/lib/sdgReference.ts, frontend/lib/contextExport.ts), and installs Jest + React Testing Library for the frontend since no test runner exists yet ([docs/TESTING.md](https://github.com/chaoss/UNSDG-classifier-tool/blob/main/docs/TESTING.md)).
- Issue and code created with the help of CLAUDE pro (Sonnet 5)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.