Skip to content

Implement catalog import module for U.S. stamp data ingestion#3

Draft
johnwhobbs with Copilot wants to merge 5 commits into
developmentfrom
copilot/implement-catalog-import-scripts
Draft

Implement catalog import module for U.S. stamp data ingestion#3
johnwhobbs with Copilot wants to merge 5 commits into
developmentfrom
copilot/implement-catalog-import-scripts

Conversation

Copilot AI commented Dec 22, 2025

Copy link
Copy Markdown

Implementation Plan for Catalog Import Scripts

  • Create project directory structure (/src and subdirectories)
  • Create database initialization script (create_database.py)
  • Implement catalog_import.py module with:
    • Fetch data from URLs or files
    • Parse JSON and CSV formats
    • Normalize catalog data (dates, denominations, text)
    • Handle alternate field names
    • Insert data into SQLite database
    • Duplicate detection
    • Error handling and logging
  • Create requirements.txt for dependencies
  • Add comprehensive tests (22 test cases, all passing)
  • Verify import works with sample data
  • Document usage in CATALOG_IMPORT.md
  • Run code review and address feedback
  • Run security scan (no vulnerabilities found)
  • Update README with Quick Start instructions
  • Fix URL reference (StampData.org → StampData.com)

Summary

Successfully implemented catalog import functionality for the Stamp Collection Management Application with all acceptance criteria met and feedback addressed.

Original prompt

This section details on the original issue you should resolve

<issue_title>Implement Catalog Import Scripts for Stamps (Catalog) Table</issue_title>
<issue_description>Create Python scripts that import U.S. stamp catalog data from publicly available online sources and populate the Stamps table in the SQLite database.

Primary Data Source
StampData.org — provides open, structured stamp metadata suitable for ingestion.

Secondary Sources (optional future tasks)
USPS Postal History

Smithsonian National Postal Museum

Colnect

StampWorld

Requirements
Create a new module:
catalog_import.py

Implement the following functionality:

  1. Fetch Catalog Data
    Download JSON or CSV data from StampData.org

Parse fields relevant to the schema:

catalog_number

denomination

color

subject

description (if available)

issue_date

issue_location

printing_method

image_url

  1. Normalize Data
    Convert dates to ISO format

Convert denominations to decimal (REAL)

Clean text fields (strip whitespace, normalize case)

Handle missing or incomplete fields gracefully

  1. Insert Into SQLite
    Use parameterized SQL

Avoid duplicate entries

Provide a function:

import_catalog_data(db_path: str)

  1. Logging & Error Handling
    Log skipped or malformed entries

Provide meaningful error messages

Acceptance Criteria
Running the import function populates the Stamps table with real catalog data

No duplicate catalog entries

All fields match the schema

Code is modular, documented, and ready for future expansion

A pull request is opened with the implementation</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@johnwhobbs
johnwhobbs changed the base branch from main to development December 22, 2025 03:21
Copilot AI and others added 3 commits December 22, 2025 03:24
Co-authored-by: johnwhobbs <152946121+johnwhobbs@users.noreply.github.com>
Co-authored-by: johnwhobbs <152946121+johnwhobbs@users.noreply.github.com>
Co-authored-by: johnwhobbs <152946121+johnwhobbs@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement catalog import scripts for Stamps table Implement catalog import module for U.S. stamp data ingestion Dec 22, 2025
Copilot AI requested a review from johnwhobbs December 22, 2025 03:30
@johnwhobbs

Copy link
Copy Markdown
Owner

@copilot stampdata.org is not the correct URL. Use stampdata.com

Co-authored-by: johnwhobbs <152946121+johnwhobbs@users.noreply.github.com>

Copilot AI commented Dec 22, 2025

Copy link
Copy Markdown
Author

@copilot stampdata.org is not the correct URL. Use stampdata.com

Fixed in commit 668651a. Updated all references from StampData.org to StampData.com in:

  • src/catalog_import.py
  • README.md
  • docs/CATALOG_IMPORT.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Catalog Import Scripts for Stamps (Catalog) Table

2 participants