Skip to main content

BICAM Dataset Downloader - Access comprehensive congressional data

Project description

BICAM - Comprehensive Congressional Data Downloader

PyPI version Python versions License: MIT

The BICAM package provides easy programmatic access to the Bulk Ingestion of Congressional Actions & Materials (BICAM) dataset, a comprehensive collection of congressional data including bills, amendments, committee reports, hearings, and more sourced from the official congress.gov and GovInfo APIs.

Features

  • 📦 12 Dataset Types: Access bills, amendments, members, committees, hearings, and more
  • 🚀 Fast Downloads: Optimized S3 downloads with progress tracking
  • 💾 Smart Caching: Automatic local caching to avoid re-downloads
  • 🔧 Simple API: Both Python API and command-line interface
  • Data Integrity: Automatic checksum verification
  • 📊 Large Scale: Efficiently handles datasets from 100MB to 12GB+

Installation

From PyPI (Recommended)

# Using uv (faster, recommended)
uv pip install bicam

# Using pip (alternative)
pip install bicam

From Source

# Clone and install in development mode
git clone https://github.com/bicam-data/bicam
cd bicam
uv pip install -e .

Quick Start

Python API

import bicam

# Download a dataset
bills_path = bicam.download_dataset('bills')
print(f"Bills data available at: {bills_path}")

# Load data directly into a DataFrame (downloads if needed)
bills_df = bicam.load_dataframe('bills', 'bills_metadata.csv', download=True)
print(f"Loaded {len(bills_df)} bills")

# List available datasets
datasets = bicam.list_datasets()
print(f"Available datasets: {datasets}")

# Get dataset information
info = bicam.get_dataset_info('bills')
print(f"Size: {info['size_mb']} MB")

Command Line Interface

# List all available datasets
bicam list-datasets

# Download a specific dataset
bicam download bills

# Get detailed information about a dataset, such as size and file names
bicam info hearings

# Show cache usage
bicam cache

# Clear cached data
bicam clear bills        # Clear specific dataset
bicam clear --all       # Clear all cached data

Available Datasets

Dataset Size Description
bills ~2.5GB Complete bills data including text, summaries, and related records
amendments ~800MB All amendments with amended items
members ~150MB Historical and current member information
nominations ~400MB Presidential nominations data
committees ~200MB Committee information, including history of committee names
committeereports ~1.2GB Committee reports, with full text and related information
committeemeetings ~600MB Committee meeting records
committeeprints ~900MB Committee prints, including full text and topics
hearings ~3.5GB Hearing information, such as address and transcripts
treaties ~300MB Treaty documents with actions, titles, and more
congresses ~100MB Congressional session metadata, like directories and session dates
complete ~12GB Complete BICAM dataset with all data types

Configuration

Environment Variables

# Set custom cache directory (default: ~/.bicam)
export BICAM_DATA=/path/to/cache

# Control logging
export BICAM_LOG_LEVEL=DEBUG

# Disable version check
export BICAM_CHECK_VERSION=false

Python Configuration

import bicam

# Get current cache size
cache_info = bicam.get_cache_size()
print(f"Total cache size: {cache_info['total']}")

# Clear specific dataset cache
bicam.clear_cache('bills')

# Clear all cached data
bicam.clear_cache()

Contributing

We may welcome contributions in the future. For now, please visit https://bicam.net/feedback for suggestions, concerns, or data inaccuracies.

Citation

If you use BICAM in your research, please cite:

{FUTURE CITATION GOES HERE}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Acknowledgments


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bicam-0.1.1.tar.gz (172.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bicam-0.1.1-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file bicam-0.1.1.tar.gz.

File metadata

  • Download URL: bicam-0.1.1.tar.gz
  • Upload date:
  • Size: 172.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.20

File hashes

Hashes for bicam-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fd165a7e4bf26a1755be855d6803f80486edcc23e484b5b372614fc7591c4b20
MD5 ea9dd88d1e2038eee2573809ae2d058b
BLAKE2b-256 7c3a4cfd4d280fa05b2f2bf746f52ae151a3422cbca4475290f42a74add8fb2c

See more details on using hashes here.

File details

Details for the file bicam-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: bicam-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.20

File hashes

Hashes for bicam-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fc25e4e2896ab7813be9cc0568d37b07918cd99fa4b04f1348c48d0408b6ee6a
MD5 9502f816ab9737f2d03aad3e29a16766
BLAKE2b-256 9b8483339ac202f97d428c37faeadc77266299959b52cb17a7c546c05299ee4d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page