This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
make dev- Set up complete development environment (deps, install, pre-commit hooks)make deps- Install development dependencies using uvmake install- Install the package in development mode
make test- Run full test suite with coveragemake test-fast- Run tests without coverage for faster feedbackmake coverage- Run tests with coverage reportmake coverage-html- Generate HTML coverage report
make lint- Run ruff linting checksmake lint-fix- Run ruff linting and fix auto-fixable issuesmake format- Format code using ruffmake format-check- Check if code is properly formattedmake typecheck- Run ty static type checkingmake check- Run all checks (lint, format-check, typecheck, test)make fix- Fix common issues (format + lint-fix)
make build- Build the package for distributionmake build-check- Build and check the package with twine
make version-patch- Bump patch version and push tagmake version-minor- Bump minor version and push tagmake version-major- Bump major version and push tag
make clean- Remove build artifacts and cache filesmake version- Show current version information
- Single Module Design: All functionality is contained in
dateutils/dateutils.py- a single, comprehensive module - Standard Library Only: No external dependencies beyond Python's standard library
- Full Type Annotations: Complete type hints using Python 3.9+ typing features
- Comprehensive Testing: Single test file
tests/test_dateutils.pywith extensive coverage using pytest and freezegun
- UTC Operations: Core timestamp and UTC date functions (
utc_now_seconds,utc_today,epoch_s) - Business Day Logic: Weekend and holiday-aware calculations (
workdays_between,add_business_days) - US Federal Holidays: Built-in cached holiday calculations for business day functions
- Timezone Handling: Robust timezone conversion using
zoneinfo - Date Parsing: Multi-format date/datetime parsing with comprehensive validation
- Quarter/Month/Week Operations: Time period calculations and generators
- Human-readable Formatting: Pretty date formatting ("2 hours ago", "Yesterday")
- All public functions are re-exported through
dateutils/__init__.py - Constants for common time calculations (SECONDS_IN_DAY, DAYS_IN_WEEK, etc.)
- Extensive input validation with descriptive error messages
- Generator-based functions for memory-efficient date range operations
- LRU caching for expensive operations like holiday calculations
- Uses
uvfor fast dependency management rufffor linting and formatting (configured for 120 character line length)tyfor fast static type checking (Astral's Rust-based type checker)pytestwithfreezegunfor time-sensitive testing- Pre-commit hooks for code quality enforcement
- Comprehensive Makefile for all development tasks
- Single comprehensive test file covering all functionality
- Time-based testing using
freezegunfor consistent results - Coverage requirements enforced through pytest configuration
- Tests validate both success cases and error conditions with proper exception handling