skillfed

us

US state meta information and other fun stuff

us v3.2.0 2.4M downloads/30d#3,106 on PyPI518
License unclear Copyright (c) 2014, Sunlight Labs All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: *… (full text in the JSON record) Active released

What it is and what it does

The us package is a reference library for US state and territory data. It provides programmatic access to states and territories with their postal abbreviations, FIPS codes, capitals, statehood years, time zones, and geographic classifications (contiguous, continental). It includes a phonetic name lookup powered by jellyfish for fuzzy matching and generates URLs to 2010 Census Bureau shapefiles for various geographic regions (state, county, congressional district, census tract, block, etc.). The package also offers a command-line tool for quick lookups and a mapping function to generate dictionaries between any two state attributes.

It is designed for developers building applications that need authoritative US geographic metadata—data validation, address parsing, geographic analysis, or administrative dashboards. The library is pure Python with minimal dependencies, installs quickly, and has been maintained since its early releases with active support for modern Python versions. DC can optionally be included in state lists via an environment variable.

Use it for:

  • Validate and normalize US state abbreviations or FIPS codes in address or form-processing pipelines.
  • Build geographic dashboards or reports that need state capitals, time zones, or contiguity information.
  • Download Census Bureau shapefiles for mapping or GIS analysis by state or region.
  • Implement fuzzy state name matching in user-facing search or autocomplete features.
  • Generate lookup tables mapping between FIPS codes, postal abbreviations, and state names for data integration.
  • Query state metadata (statehood year, time zone, AP abbreviation) for reference or display purposes.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides structured access to US state and territory metadata including postal abbreviations, FIPS codes, capitals, time zones, and shapefile URLs for geographic regions.

Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and solves a common reference-data problem with a clean API. The unclear license treatment is a minor concern—review the BSD text if you have strict compliance requirements—but poses no practical barrier for most projects. Install it if you need reliable US state metadata or geographic lookups.

Install

us on PyPI

pip

pip install us

uv

uv add us

poetry

poetry add us

Installing us

Before you install

Low friction installation with a single pure-Python runtime dependency (jellyfish). Actively maintained with recent commits and support for current Python versions (3.8–3.12).

License in practice

License treatment is unclear; the package carries a BSD-style license from Sunlight Labs but lacks an SPDX identifier. Review the full license text before use in proprietary or copyleft projects.

Quickstart

pip install us

import us
state = us.states.lookup('maryland')
print(state.fips, state.abbr, state.name)

Verify before relying

  • Whether the unclear license treatment poses a practical barrier for your project's license compliance requirements.
  • Whether phonetic matching accuracy via jellyfish meets your tolerance for fuzzy state name lookups.
  • Total number of US states and territories covered by the package.

Package facts

License Copyright (c) 2014, Sunlight Labs All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: *… (full text in the JSON record) (unclear)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — jellyfish
Maintenance actively maintained — 753 days since the last release
Last repo commit
First released
Downloads 2,357,635/month — #3,106 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: us-3.2.0-py3-none-any.whl

Programming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

us state metadata lookupfips code state abbreviationstate information libraryus territories postal codesstate shapefile urlsphonetic state name matchingstate time zonesus geographic data
reference-dataus-geographymetadata

More Utilities packages