Normalize data schemas, enrich datasets, and fix API handler quality#65
Open
AdityaAsopa wants to merge 1 commit intoisro:masterfrom
Open
Normalize data schemas, enrich datasets, and fix API handler quality#65AdityaAsopa wants to merge 1 commit intoisro:masterfrom
AdityaAsopa wants to merge 1 commit intoisro:masterfrom
Conversation
The spacecraft_missions data had deeply inconsistent schemas — mass appeared as 'weight', 'lift-off_mass', 'spacecraft_mass', 'mass_at_lift-off' and 5 other variants; dates ranged from 'April 19, 1975' to '22 October 2008' to '26-05-1999' across 15+ formats; KALPANA-1 had mission_life stored in the 'mission' field as '7 Years'; and TES appeared as a duplicate entry. spacecrafts.json had only id+name for 113 records. launchers.json had only id for 81 records. customer_satellites.json mixed 'GERMANY' with 'Germany' and 'UK' with 'UNITED KINGDOM'. This commit introduces scripts/normalize_data.py — an idempotent pipeline that parses all date formats to ISO 8601, extracts numeric mass_kg and power_watts from free-text fields (handling edge cases like '15 Sq.m Solar Array generating 1360W'), classifies orbits (LEO/SSO/GEO/Lunar/Failed), infers mission status from launch date + mission life, and normalizes country names. The scraper was re-run against isro.gov.in and the fresh data is merged with existing records — no data is lost, only enriched. All 5 data files now have consistent, documented schemas. spacecrafts are enriched with launch date, vehicle, orbit type, and status from missions. Launchers are classified into 8 vehicle families. All API endpoints remain backward-compatible — same URLs, same structure, just cleaner data. API handlers: removed unused 'fs' imports, fixed misleading variable names (customer_satellites.js loaded data into a var called 'launchers'), added Content-Type: application/json headers, and sanitized error responses. Root endpoint now returns a JSON directory of all available endpoints.
This was referenced Mar 12, 2026
AdityaAsopa
added a commit
to AdityaAsopa/isro_api
that referenced
this pull request
Mar 12, 2026
- CHANGELOG.md: full project history (v1.0.0 → v1.1.0) documenting all 7 PRs (isro#65–isro#71) in Keep a Changelog format; Unreleased section for today's work - index.html: complete rewrite — space-themed mission control dashboard; live Chart.js visualisations (orbit distribution, mission status, vehicle families, top countries by satellite count); animated counters fed from /api/stats; responsive star-field background; endpoint quick-reference cards - style.css: full rewrite with CSS custom properties; dark space palette (#080818 bg, #06b8ee accent); responsive grid at 900 px and 600 px breakpoints - api/timeline.js: GET /api/timeline — aggregates launch dates from spacecraft_missions, spacecrafts, and customer_satellites into a unified chronological event stream; supports ?date=MM-DD, ?month=YYYY-MM, ?year=YYYY, ?range=YYYY,YYYY query params - isro_api_plan.md: big-picture vision document (10 major platform moves) - social_posts.md: LinkedIn posts and X thread for all 7 PRs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The ISRO API serves spacecraft, launcher, and mission data — but the underlying JSON has grown organically from multiple scrapers and manual edits, resulting in data that is difficult to consume programmatically. This PR brings schema consistency, data enrichment, and code quality fixes across all five endpoints without changing any API routes or response structures.
What was wrong (examples)
weight,lift-off_mass,liftoff_mass,lift_off_mass,spacecraft_mass,mass,liftoffmass,liftoff mass, …) and 5+ variants for power (power_of_solar_array,solar_array_power,electrical_power,power, …)"April 19, 1975","02-Oct-2008","22.10.2008","2015","Sept 23, 2009","July 15,2023", and moremission: "7 Years"(should bemission_life), another hadlift-off_mass: "IRS-P3"(a spacecraft name)id+namefor 113 records — no dates, orbits, or status"GERMANY"vs"Germany","UK"vs"UNITED KINGDOM")fs(unused), used misleading variable names (launchersfor customer satellite data), and returned noContent-TypeheaderWhat this PR does
1. Data normalization pipeline (
scripts/normalize_data.py)YYYY-MM-DD)mass_kg"15 Sq.m Solar Array generating 1360W"→1360)2. Data files normalized
spacecraft_missions.jsonspacecrafts.jsonlaunchers.jsoncustomer_satellites.jsoncentres.json3. API handler fixes
fsimports from all handlerslaunchers→customerSatellites,spacecraftMissions)Content-Type: application/jsonheader to all responses/api) now returns JSON endpoint directory instead of HTML string4. Landing page & documentation
/api/spacecraft_missionsendpoint toindex.htmlWhat is preserved
spacecrafts,launchers, etc.)Data verification
The normalization script was tested for idempotency (running it twice produces identical output) and spot-checked against isro.gov.in source pages. Fields that could not be confidently parsed are set to
nullrather than guessed.Test plan
Content-Typeheaderpython scripts/normalize_data.pyis idempotent (run twice, diff shows no changes)