GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - enonymous1/gsa-vendor-toolkit: GSA Federal Supply Schedule vendor price-list pipeline: download, organize, merge, filter, and analyze vendor pricing (SIN 54151S and NAICS 541611) into per-title metrics, interactive HTML dashboards, and executive summaries.

BranchesTags
Open more actions menu

Latest commit

 

History

17 Commits
17 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
docs
docs
 
 
original
original
 
 
sample-data
sample-data
 
 
src/vendors_toolkit
src/vendors_toolkit
 
 
tests
tests
 
 
tools
tools
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

gsa-vendor-toolkit

CI

You have a GSA schedule vendor list and hundreds of published price lists. This turns them into per-title pricing metrics, interactive dashboards, and executive summaries — one command per stage, from a vendor snapshot CSV to a report you can open in a browser.

Interactive pricing dashboard

GSA vendor price-list pipeline, refactored from the original ss-gsaVendors scripts into an installable, maintainable Python package (vendors_toolkit).

Why

The original workflow was 20 organically grown scripts, each duplicating the next, with silent disagreements (retries, copy-vs-move, dashboard page length) hidden in the copies. This package unifies them into one tested pipeline: the same engines for both variants, the drift captured explicitly in config.py, and differential tests proving the new outputs match the originals byte-for-byte where they should — and fixing the places where the originals were quietly wrong (see Behavioral notes).

Non-goals

  • Not a vendor-data fetcher. The vendor snapshot CSV comes from a manual GSA eLibrary export (see Step 0); eLibrary has no public API, and this tool does not scrape it.
  • Not a live price monitor. It analyzes a snapshot, not a feed. Re-run it when you have a new export.
  • Not a SAM.gov replacement. The SAM.gov client is an optional enrichment scaffold (entity lookup, exclusion screening); the pipeline works without it.
  • Not a publisher of SAM.gov export data. The integrity stage analyzes a Responsibility and Integrity Records export you place under <root>/integrity/; the real export (thousands of officials' contact details) is never committed. The repo ships only a fictional workbook.
  • Not a web service. No server, no API, no scheduler — a CLI you run when you need a report.

Try it in 2 minutes

The repo ships a small fictional dataset (sample-data/) so you can run the whole pipeline without a real GSA export:

git clone https://github.com/enonymous1/gsa-vendor-toolkit.git
cd gsa-vendor-toolkit
pip install -e .
cp -r sample-data demo          # sample-data stays pristine; work in demo/
vendors-toolkit --root demo sanitize
vendors-toolkit --root demo organize
vendors-toolkit --root demo merge --states VA
vendors-toolkit --root demo filter --states VA
vendors-toolkit --root demo metrics --states VA
vendors-toolkit --root demo report --states VA
open demo/output/reports/VA_IT_Pricing_Full_Report.html
# Offline SAM.gov integrity-records analysis (fictional sample included):
vendors-toolkit --root demo integrity

(download is skipped here because the sample price lists are already in place; national, audit, and export are optional stages — see below.)

Pipeline: download vendor price lists → organize by State/City → merge Excel "Price List" sheets into per-state master CSVs → filter by SIN → compute per-title pricing metrics → audit / export → build the national master → generate HTML dashboards and Markdown executive summaries.

Two pipeline variants share the engines: 54151S (IT services) and 541611 (management consulting). Where the original script twins disagreed (retries, copy-vs-move, dashboard page length, …), the drift is captured explicitly in config.py rather than hidden in duplicated code.

Layout

gsa-vendor-toolkit/
├── .github/workflows/ci.yml       # pytest + ruff + mypy on Python 3.10–3.12
├── pyproject.toml                 # packaging, ruff + mypy-strict, `vendors-toolkit` entry point
├── sample-data/                   # fictional dataset for the 2-minute quick start
│   ├── integrity/                 # fictional SAM.gov integrity-records workbook
│   ├── opportunities/             # fictional SAM.gov opportunity-search payload
│   └── solicitations/             # fictional GSA legacy schedule solicitations
├── docs/dashboard-preview.png     # screenshot of the generated dashboard
├── src/vendors_toolkit/
│   ├── __init__.py
│   ├── cli.py                     # `vendors-toolkit` subcommands (one per stage)
│   ├── config.py                  # centralized frozen-dataclass configuration
│   ├── logging_config.py          # idempotent stdlib logging
│   ├── data/                      # GSA_MAP, sanitize_frame, title/price cleaning helpers
│   ├── pipeline/                  # sanitize, download, organize, merge, filter, national
│   ├── analysis/                  # metrics, audit + cardinality, exports, unique titles,
│   │                            # integrity-records export analysis, opportunity parsing,
│   │                            # legacy solicitation archive normalization
│   ├── reporting/                 # HTML dashboards + executive summaries
│   └── integrations/              # SAM.gov API client (scaffold; needs SAM_API_KEY)
├── tools/export_to_md.py          # standalone .py → Markdown exporter (unchanged)
├── original/                      # pristine copies of the 20 original scripts (reference only)
└── tests/                         # pytest suite (see CI run for the current count)

Install

pip install -e .          # runtime (+ `vendors-toolkit` on PATH)
pip install -e ".[dev]"   # + pytest, ruff, mypy, pandas-stubs

Usage

# project root: --root, else $VENDORS_ROOT, else the working directory
vendors-toolkit --root /data/vendors --variant 54151S sanitize
vendors-toolkit --root /data/vendors --variant 541611 download --limit 100
vendors-toolkit --root /data/vendors merge --states VA DC
vendors-toolkit --root /data/vendors filter --variant 54151S --states VA
vendors-toolkit --root /data/vendors metrics --states VA DC National
vendors-toolkit --root /data/vendors national --variant 54151S
vendors-toolkit --root /data/vendors report --states VA National
vendors-toolkit --help            # global options
vendors-toolkit download --help   # per-stage options

Stages run in pipeline order: sanitize → download → organize → merge → filter → metrics → audit → export → national → report. --variant accepts 54151S, 541611, or all (default). Logging: --log-level, --log-dir (rotating DEBUG file), or the VENDORS_LOG_LEVEL env var.

Worked example

From the sample data: two Virginia vendors, three job titles. After merge, filter, and metrics, VA_IT_Role_Metrics.csv holds:

Title_Key,Count,Min_Price,Max_Price,Mean_Price,Median_Price,Mode_Price,Merged_Descriptions,Price_Range
ANALYST,2,100,200,150.0,150.0,100,Does analysis | More analysis,100
CLERK,1,75,75,75.0,75.0,75,,0
MANAGER,1,1000,1000,1000.0,1000.0,1000,Manages,0

And report turns it into an executive summary:

# IT Pricing Executive Summary: VA

- **Total Unique Roles**: 3

## 🏆 Top 10 Roles by Frequency
| Job Title | Count | Mean Price |
| :--- | :---: | :---: |
| ANALYST | 2 | $150.00 |
| CLERK | 1 | $75.00 |
| MANAGER | 1 | $1,000.00 |

plus the full interactive dashboard (searchable, sortable, filterable) shown at the top of this README.

Pipeline / workflow

flowchart TD
    snapshot[Vendor snapshot CSV<br/>manual eLibrary export] --> sanitize
    sanitize --> download
    download --> organize
    organize --> merge
    merge --> filter
    filter --> metrics
    metrics --> report[report: dashboards + summaries]
    merge --> audit[audit / export]
    organize --> national[national master, 54151S]
Loading

Step 0 — Get the input file (the pipeline does not fetch this itself)

The pipeline starts from a vendor snapshot CSV: one row per vendor, with at least these columns: Vendor, Contact #, Price List (the URL of the vendor's published price list), Category, State, City, Has_Price_List_Flag.

Where it comes from: GSA eLibrary (gsaelibrary.gsa.gov) — search by SIN (54151S = IT Professional Services; 541611 = management consulting) or by contractor name, and export/save the vendor listing as a CSV. eLibrary has no public API, so this step is a manual export, not a download stage.

Where it goes: ext_res/ under the configured name — 2026_02_12_04_10_24.csv for 54151S, 2026_03_02_08_18_31.csv for 541611 (those dated names are just the snapshots the config was built with; rename your export to match, or pass --input to sanitize to use another file).

Stages and their outputs (under output/)
Stage Reads Writes
sanitize ext_res/<raw CSV> ext_res/<sanitized CSV>
download sanitized CSV's Price List URLs downloads/<price lists>, summaries/<manifest>
organize downloads dir downloads/<by_region>/<STATE>/<City>/
merge organized workbooks' "Price List" sheets <analysis>/<STATE>_Master_Price_List.csv
filter merged masters merged_filtered/<STATE>_SIN_<SIN>_Only.csv
metrics filtered files (54151S) / merged files (541611) <metrics>/<STATE>_<..._Metrics.csv (+ xlsx)
audit sanitized CSV, merged masters output/audit_summary.md, column_selections/*.json
export sanitized CSV price_lists/, regional/<STATE>/, summaries/*.md
national manifest + sanitized CSV + organized workbooks (54151S) merged_national/National_IT_Master_Price_List.csv
report metrics CSVs <reports>/<STATE>_*_Full_Report.html, *_Executive_Summary.md
integrity (standalone) SAM.gov integrity-records .xlsx under <root>/integrity/ output/integrity/ count CSVs + integrity_summary.md
opportunities (standalone) SAM.gov API search, or a saved search payload JSON output/opportunities/ opportunities.csv + opportunities_summary.md
solicitations (standalone) Saved GSA legacy schedule solicitation JSON (file or <root>/solicitations/ directory) output/solicitations/ solicitations.csv + solicitation_documents.csv + solicitations_summary.md

The download stage is plain HTTP file fetching (requests.get per Price List URL, with retries) — there is no API behind the price lists. The national stage re-reads the organized workbooks through the download manifest; it does not concatenate the merged state files.

SAM.gov enrichment (scaffold, optional)

integrations/samgov.py wires the free SAM.gov APIs for future vendor enrichment (entity lookup by UEI/CAGE, exclusion screening, opportunity search). It is inert until a key exists:

# free key: SAM.gov account → Account Details → "Public API Key"
export SAM_API_KEY="SAM-..."
vendors-toolkit sam --status          # check configuration, no API call
vendors-toolkit sam --uei <UEI>       # entity lookup
vendors-toolkit sam --uei <UEI> --excluded   # exclusion check
vendors-toolkit sam --keywords "IT services" --naics 54151S

Free tiers: 10 requests/day with a basic account, 1,000/day with a SAM entity role. Keys expire every 90 days. The sam command runs once per invocation (not per variant) so it never double-spends the daily budget.

Integrity-records export analysis (offline, folded in from mp-sam-data-bank)

analysis/integrity.py analyzes the SAM.gov Responsibility and Integrity Records export — the FPS workbook with a two-row preamble, a 38-column header row, and one row per record — without any API key:

# Place your SAM.gov export under <root>/integrity/, or pass it directly:
vendors-toolkit --root demo integrity
vendors-toolkit integrity --input /path/to/export.xlsx --output /path/to/reports

It finds the header row by content (no brittle skiprows=2), validates the required columns, normalizes empty cells (no float-NaN leakage), parses record dates to days, buckets trends by month, and writes count CSVs (record type, agency, state, NAICS, monthly) plus integrity_summary.md under output/integrity/. There is no PDF output: the original's single-page ReportLab dump ran off the page, and CSV + Markdown match the rest of this toolkit's reporting. The original's hardcoded F:/Code/... path, undeclared reportlab dependency, and per-timestamp "trend" counts are all fixed; the loader was verified against the real 2,838-row export as well as the fictional sample.

Do not commit a real export. It contains officials' names, phones, and emails. The sample workbook (sample-data/integrity/sam_integrity_sample.xlsx, 24 fictional rows, 555-010 numbers, @example.com addresses) is the only integrity data that ships.

Opportunity search (folded in from mp-sam)

analysis/opportunities.py is the current-standard version of mp-sam, which scraped the SAM.gov search page with Selenium and absolute XPaths. The fold-in keeps the job (search active opportunities, one row per notice ID, clean CSV) and replaces the scrape with the official API, so a markup change can't break it and no browser session is involved:

# Offline, no key needed: parse the fictional sample payload
vendors-toolkit opportunities --input sample-data/opportunities/sam_opportunities_sample.json --output /tmp/opp

# Live, one API call per invocation (counts against the free daily budget):
export SAM_API_KEY=<redacted>
vendors-toolkit opportunities --keywords "IT services" --naics 54151S --output /tmp/opp

It fixes the original's bugs: the model no longer overwrites title on free-text lines, the CSV has a fixed header with exactly one row per notice (the original's notice-ID list had 10,032 rows for 9,416 unique IDs, and its extracted CSV mixed several opportunities into one row), duplicate IDs are dropped with the count reported, rows with no notice ID are skipped instead of coerced, and the output path is a CLI argument instead of a hardcoded macOS path. The original's March 2025 bulk snapshot of real notices and saved SAM.gov HTML pages do not ship; the only opportunity data in the repo is the 5-row fictional payload above (including one duplicate and one ID-less row, so the dedupe/skip behavior is visible).

Live-run note: the parser is tested against that fictional payload, which mirrors the API's opportunitiesData shape, but no live call has been made from this box (no key is stored here). The first run with a real key is the gate for confirming the live field set.

Legacy schedule solicitations archive (offline, folded in from ss-gsa)

analysis/solicitations.py is the current-standard version of ss-gsa, which scraped GSA's eOffer portal with Scrapy for legacy schedule solicitations (reference-only solicitations; no new offers are accepted under them). The fold-in keeps only the solicitations job and drops the live crawl entirely — this stage parses saved spider output, makes no HTTP requests, and adds no Scrapy dependency:

# Offline: parse the fictional sample (5 rows: 3 schedules, 1 duplicate, 1 skipped)
vendors-toolkit solicitations --input sample-data/solicitations/solicitations_sample.json --output /tmp/sol

# Or point it at a directory of saved spider output (index + per-schedule files):
vendors-toolkit --root demo solicitations   # reads <root>/solicitations/

It fixes the original's bugs: the listing index it reads was two JSON arrays concatenated in one file (invalid as a single document), and every index row had an empty documents list because the feed item was emitted before the documents page was parsed — the loader decodes successive JSON values and merges rows by schedule, unioning document lists by URL, so an index row plus its per-schedule file becomes one complete record. Status strings are whitespace-normalized (the original's non-breaking spaces become plain spaces), rows with no schedule are skipped instead of coerced, documents missing a name or URL are dropped and counted, and nothing is deleted on run (the original's spider __init__ rotated prior outputs away, keeping 2 backups instead of the intended 3). Output is solicitations.csv (one row per schedule, with a document count), solicitation_documents.csv (one row per document link), and solicitations_summary.md under output/solicitations/.

The original's unfinished Acquisition Gateway forecast spider does not ship here: it guessed at API endpoints and never produced a typed item, and the opportunities stage above already covers that job via SAM.gov's official API. The original's 12 MB of tracked output (including 9.2 MB of duplicated debug dumps) does not ship either; the only solicitation data in the repo is the 5-row fictional sample above.

Live-run note: no live eOffer crawl has been run from this box, and the saved pages the format was verified against are from February 2025. If a live re-crawl is ever wanted, it is a separate decision — with robots and rate-limit rules of its own — not an extension of this offline archive stage.

Configuration

config.py holds every knob the originals hardcoded: paths, download retries/timeouts/workers, merge sheet matching, metrics filenames, dashboard CDN URLs, and the per-variant drift (VariantConfig). All dataclasses are frozen.

Behavioral notes (deliberate fixes vs the originals)

  • Missing input files raise FileNotFoundError instead of printing and continuing.
  • Missing titles normalize to "" (the IT analyzer emitted "NONE"/"None").
  • Price cleaning strips $/commas on every pandas version — the IT analyzer's dtype == object check silently dropped $-prices on pandas 3.
  • Dashboard descriptions are HTML-escaped (the originals injected raw markup).
  • The 54151S downloader no longer crashes keying futures on an unhashable Series.
  • Both mergers match the "price list" sheet exactly (case-insensitive).

Quality gates

ruff check src/ tests/ && ruff format --check src/ tests/
mypy src/          # strict
pytest             # 77 tests

Differential tests proving byte-level behavioral parity with original/ were run per phase during the refactor (see the git history: phases 3–7).

About

GSA Federal Supply Schedule vendor price-list pipeline: download, organize, merge, filter, and analyze vendor pricing (SIN 54151S and NAICS 541611) into per-title metrics, interactive HTML dashboards, and executive summaries.

Topics

clidata-pipelinedatatablesexcelfederal-supply-schedulegovernment-contractinggsapandasprice-analysisprocurementpythonvendor-pricing

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.