fedcomp-index-scoring 2026.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FedComp Index
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,123 @@
1
+ # FedComp Index Scoring
2
+
3
+ ![FedComp Index](https://fedcompindex.org/static/img/FedComp-Index-Tabularium-1.png)
4
+
5
+ Federal contractor posture scoring. Scores any federal contractor from 0 to 100 based on public award data from USASpending.gov.
6
+
7
+ Each contractor receives a [FedComp Index](https://fedcompindex.org/) score and a posture class:
8
+
9
+ - **Class 1** (score 60+) - dominant award volume, typically $100M+ over 5 years
10
+ - **Class 2** (score 40-59) - mid-tier, typically $5M-$100M
11
+ - **Class 3** (below 40) - emerging or low-volume
12
+
13
+ ## Install
14
+
15
+ ```bash
16
+ npm install fedcomp-index-scoring
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ```javascript
22
+ const { scoreContractor, PostureClass } = require("fedcomp-index-scoring");
23
+
24
+ const result = scoreContractor(15_000_000, "2025-09-15");
25
+
26
+ result.fedcompIndex; // 58
27
+ result.postureClass; // "Class 2"
28
+ result.volumeDriver; // 53
29
+ result.recencyDriver; // 100
30
+ ```
31
+
32
+ ## FedComp Index scoring methodology
33
+
34
+ Two drivers, no normalization:
35
+
36
+ | Driver | Weight | How it works |
37
+ |--------|--------|-------------|
38
+ | Award volume | 90% | log10 of total dollars won, mapped to 0-100 |
39
+ | Award recency | 10% | Last award date, bucketed by age |
40
+
41
+ The FedComp Index score is an absolute measure. A contractor scoring 60 always represents roughly the same award volume regardless of state or time period. Scores are not percentile-ranked against peers.
42
+
43
+ Posture classes use fixed thresholds tied to the score:
44
+
45
+ | Posture class | FedComp Index score | Typical award volume |
46
+ |---------------|--------------------|--------------------|
47
+ | Class 1 | 60-100 | $100M+ |
48
+ | Class 2 | 40-59 | $5M-$100M |
49
+ | Class 3 | 0-39 | Under $5M |
50
+
51
+ Full methodology: [fedcompindex.org/methodology](https://fedcompindex.org/methodology/)
52
+
53
+ See the [FedComp Index Glossary](https://github.com/npetro6/fedcomp-index-glossary) for complete terminology definitions.
54
+
55
+ ## Related packages
56
+
57
+ | Package | What it does |
58
+ |---------|-------------|
59
+ | [fedcomp-index](https://www.npmjs.com/package/fedcomp-index) | Meta-package (installs both) |
60
+ | [fedcomp-index-scoring](https://www.npmjs.com/package/fedcomp-index-scoring) | Scoring engine (this one) |
61
+ | [fedcomp-index-data](https://www.npmjs.com/package/fedcomp-index-data) | Pre-scored contractor datasets |
62
+
63
+ ## Also available on PyPI
64
+
65
+ ```bash
66
+ pip install fedcomp-index-scoring
67
+ ```
68
+
69
+ - [fedcomp-index](https://pypi.org/project/fedcomp-index/) - meta-package
70
+ - [fedcomp-index-scoring](https://pypi.org/project/fedcomp-index-scoring/) - scoring engine
71
+ - [fedcomp-index-data](https://pypi.org/project/fedcomp-index-data/) - pre-scored datasets
72
+
73
+ ## Data sources
74
+
75
+ All data is sourced from public federal records:
76
+
77
+ - [USASpending.gov](https://www.usaspending.gov/) - award history, dollar amounts, agencies, NAICS codes, PSC codes
78
+ - [SAM.gov](https://sam.gov/) - entity registration, certifications, CAGE/UEI
79
+ - [SBA.gov](https://www.sba.gov/) - small business certification verification
80
+
81
+ ## Live rankings
82
+
83
+ Scored contractor rankings with dossier pages, proximity maps, and spectator tracking:
84
+
85
+ - [Nevada](https://fedcompindex.org/nv/) - 349 contractors scored
86
+
87
+ ## Datasets
88
+
89
+ Pre-scored datasets available for download:
90
+
91
+ - [Nevada Federal Contractors - FedComp Index](https://huggingface.co/datasets/npetro6/nevada-federal-contractors) (HuggingFace)
92
+ - [Nevada Federal Contract Awards - Monthly](https://huggingface.co/datasets/npetro6/nevada-federal-awards) (HuggingFace)
93
+ - [Nevada Federal Contractors - FedComp Index](https://www.kaggle.com/datasets/npetro6/nevada-federal-contractors-fedcomp-index) (Kaggle)
94
+ - [Nevada Federal Contract Awards - Monthly](https://www.kaggle.com/datasets/npetro6/nevada-federal-awards-2026-02) (Kaggle)
95
+
96
+ ## Links
97
+
98
+ - Website: [https://fedcompindex.org/](https://fedcompindex.org/)
99
+ - Nevada Rankings: [https://fedcompindex.org/nv/](https://fedcompindex.org/nv/)
100
+ - Methodology: [https://fedcompindex.org/methodology/](https://fedcompindex.org/methodology/)
101
+ - Tabularium: [https://fedcompindex.org/tabularium/](https://fedcompindex.org/tabularium/)
102
+ - FAQ: [https://fedcompindex.org/faq/](https://fedcompindex.org/faq/)
103
+ - Glossary: [https://github.com/npetro6/fedcomp-index-glossary](https://github.com/npetro6/fedcomp-index-glossary)
104
+ - Source: [https://github.com/npetro6/FedCompIndex](https://github.com/npetro6/FedCompIndex)
105
+ - npm packages: [https://github.com/npetro6/fedcomp-index-npm](https://github.com/npetro6/fedcomp-index-npm)
106
+ - PyPI: [https://pypi.org/project/fedcomp-index/](https://pypi.org/project/fedcomp-index/)
107
+ - HuggingFace: [https://huggingface.co/datasets/npetro6/nevada-federal-contractors](https://huggingface.co/datasets/npetro6/nevada-federal-contractors)
108
+ - Kaggle: [https://www.kaggle.com/datasets/npetro6/nevada-federal-contractors-fedcomp-index](https://www.kaggle.com/datasets/npetro6/nevada-federal-contractors-fedcomp-index)
109
+
110
+ ## Citation
111
+
112
+ ```bibtex
113
+ @software{fedcomp_index,
114
+ title = {FedComp Index},
115
+ author = {FedComp Index},
116
+ url = {https://fedcompindex.org/},
117
+ year = {2026}
118
+ }
119
+ ```
120
+
121
+ ## License
122
+
123
+ MIT
package/index.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ export declare const PostureClass: {
2
+ readonly CLASS_1: "Class 1";
3
+ readonly CLASS_2: "Class 2";
4
+ readonly CLASS_3: "Class 3";
5
+ };
6
+
7
+ export interface FedCompResult {
8
+ fedcompIndex: number;
9
+ postureClass: string;
10
+ volumeDriver: number;
11
+ recencyDriver: number;
12
+ }
13
+
14
+ export declare function scoreContractor(
15
+ totalAwardsUsd: number,
16
+ lastAwardDate?: string | Date | null
17
+ ): FedCompResult;
package/index.js ADDED
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * FedComp Index Scoring - Federal contractor posture scoring.
5
+ *
6
+ * Scores federal contractors on a 0-100 scale based on public award data
7
+ * from USASpending.gov. Each contractor is assigned a FedComp Index score
8
+ * and a posture class (Class 1, Class 2, or Class 3).
9
+ *
10
+ * Methodology: https://fedcompindex.org/methodology/
11
+ * Data: https://huggingface.co/datasets/npetro6/nevada-federal-contractors
12
+ */
13
+
14
+ const PostureClass = Object.freeze({
15
+ CLASS_1: "Class 1",
16
+ CLASS_2: "Class 2",
17
+ CLASS_3: "Class 3",
18
+ });
19
+
20
+ // Scoring constants
21
+ const W_VOLUME = 0.9;
22
+ const W_RECENCY = 0.1;
23
+ const LOG_MIN = 4; // log10($10K)
24
+ const LOG_MAX = 10; // log10($10B)
25
+
26
+ function volumeDriver(totalAwardsUsd) {
27
+ if (typeof totalAwardsUsd !== "number" || !isFinite(totalAwardsUsd) || totalAwardsUsd <= 0) return 0;
28
+ const logVal = Math.log10(totalAwardsUsd);
29
+ return Math.max(0, Math.min(100, Math.round(((logVal - LOG_MIN) / (LOG_MAX - LOG_MIN)) * 100)));
30
+ }
31
+
32
+ function recencyDriver(lastAwardDate) {
33
+ if (!lastAwardDate) return 0;
34
+ let parsed;
35
+ if (typeof lastAwardDate === "string") {
36
+ const s = lastAwardDate.length === 7 ? lastAwardDate + "-01" : lastAwardDate;
37
+ parsed = new Date(s + "T00:00:00Z");
38
+ } else if (lastAwardDate instanceof Date) {
39
+ parsed = lastAwardDate;
40
+ } else {
41
+ return 0;
42
+ }
43
+ if (isNaN(parsed.getTime())) return 0;
44
+ const daysAgo = Math.floor((Date.now() - parsed.getTime()) / 86400000);
45
+ if (daysAgo <= 365) return 100;
46
+ if (daysAgo <= 730) return 60;
47
+ if (daysAgo <= 1095) return 30;
48
+ if (daysAgo <= 1825) return 10;
49
+ return 0;
50
+ }
51
+
52
+ function classify(score) {
53
+ if (score >= 60) return PostureClass.CLASS_1;
54
+ if (score >= 40) return PostureClass.CLASS_2;
55
+ return PostureClass.CLASS_3;
56
+ }
57
+
58
+ /**
59
+ * Compute the FedComp Index score and posture class for a contractor.
60
+ *
61
+ * @param {number} totalAwardsUsd - Total federal award dollars over trailing 5-year window.
62
+ * @param {string|Date|null} [lastAwardDate] - Date of most recent award. String "YYYY-MM-DD" or "YYYY-MM" or a Date object.
63
+ * @returns {{ fedcompIndex: number, postureClass: string, volumeDriver: number, recencyDriver: number }}
64
+ *
65
+ * @example
66
+ * const { scoreContractor } = require("fedcomp-index-scoring");
67
+ *
68
+ * const result = scoreContractor(15_000_000, "2025-09-15");
69
+ * console.log(result.fedcompIndex); // 58
70
+ * console.log(result.postureClass); // "Class 2"
71
+ */
72
+ function scoreContractor(totalAwardsUsd, lastAwardDate) {
73
+ if (totalAwardsUsd !== null && typeof totalAwardsUsd === 'object') {
74
+ throw new TypeError('scoreContractor(totalAwardsUsd, lastAwardDate) takes two positional arguments, not an object');
75
+ }
76
+ const d1 = volumeDriver(totalAwardsUsd);
77
+ const d2 = recencyDriver(lastAwardDate || null);
78
+ const raw = d1 * W_VOLUME + d2 * W_RECENCY;
79
+ const fedcompIndex = Math.min(100, Math.max(0, Math.round(raw)));
80
+
81
+ return {
82
+ fedcompIndex,
83
+ postureClass: classify(fedcompIndex),
84
+ volumeDriver: d1,
85
+ recencyDriver: d2,
86
+ };
87
+ }
88
+
89
+ module.exports = { scoreContractor, PostureClass };
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "fedcomp-index-scoring",
3
+ "version": "2026.3.2",
4
+ "description": "FedComp Index scoring engine. Computes posture scores and posture classes for federal contractors from USASpending award data.",
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "files": [
8
+ "index.js",
9
+ "index.d.ts",
10
+ "LICENSE"
11
+ ],
12
+ "keywords": [
13
+ "federal contracting",
14
+ "government procurement",
15
+ "small business",
16
+ "posture scoring",
17
+ "fedcomp index",
18
+ "posture class",
19
+ "usaspending",
20
+ "sam.gov",
21
+ "contractor scoring",
22
+ "federal awards",
23
+ "scoring algorithm",
24
+ "procurement",
25
+ "NAICS",
26
+ "competitive intelligence",
27
+ "competitive topology",
28
+ "obligation-verified",
29
+ "registration-obligation gap",
30
+ "NAICS corridor",
31
+ "proximity map",
32
+ "competitive radius"
33
+ ],
34
+ "author": "FedComp Index <contact@fedcompindex.org>",
35
+ "license": "MIT",
36
+ "homepage": "https://fedcompindex.org/",
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/npetro6/fedcomp-index-npm.git",
40
+ "directory": "packages/fedcomp-index-scoring"
41
+ },
42
+ "engines": {
43
+ "node": ">=14.0.0"
44
+ },
45
+ "bugs": {
46
+ "url": "https://github.com/npetro6/FedCompIndex/issues"
47
+ },
48
+ "funding": {
49
+ "type": "individual",
50
+ "url": "https://fedcompindex.org/"
51
+ }
52
+ }