@aclymatepackages/emissions-factors
v1.7.1
Published
Single source of truth for every emissions factor Aclymate uses. Factors are versioned in git, validated against a unified schema, and published to npm on every merge.
Downloads
564
Readme
@aclymatepackages/emissions-factors
Single source of truth for every emissions factor Aclymate uses. Factors are versioned in git, validated against a unified schema, and published to npm on every merge.
Install
npm install @aclymatepackages/emissions-factorsUsage
const {
getFactor,
findFactorsByAlias,
findFactorsBySearchTerm,
listFactorTypes,
listFactorsByType,
manifest
} = require("@aclymatepackages/emissions-factors");
getFactor("ceda-481000-US-2023"); // returns the air-transportation CEDA factor
findFactorsByAlias("Air transportation"); // returns matches across all factor types
listFactorTypes(); // ["ceda_dataset_version", "ceda_region_fallback", ...]
listFactorsByType("vehicle"); // every vehicle factor (gasoline, diesel, hybrid, ...)
manifest.package_version; // "1.0.0"
manifest.git_commit_sha; // hash of the commit this build was published from
manifest.factor_count; // total number of factor objects publishedgetFactor returns undefined (not null) on miss. Alias and search-term lookups use lower-cased, whitespace-trimmed string matching and return arrays sorted by factor_type then factor_id.
Propose a change
Don't edit the JSON files directly. Use the "Emissions Factors" section inside aclymate-internal-admin. The admin UI form-validates your edit, opens a single-file PR via the Aclymate GitHub App, and routes it through CODEOWNERS review (William + Mike). On merge, the publish workflow bumps semver, regenerates manifest.json, tags the commit, and publishes to npm.
Factor schema
Every factor object conforms to a unified shape:
{
factor_id: "egrid-serc-2024",
factor_type: "egrid",
category: "SERC Reliability Corporation",
keys: { /* type-specific lookup keys */ },
values: { /* metric → number */ },
units: { /* metric → unit string */ },
source: {
name: "EPA eGRID",
citation: "EPA eGRID 2024 Summary Tables",
url: "https://www.epa.gov/egrid",
attribution_license: null,
vintage_year: 2024
},
aliases: ["SERC", "Southeast Reliability"],
search_terms: ["serc", "southeast", "us"],
methodology_id: null
}schema.js ships a pure-JS validateFactor(obj) for use in tooling.
