|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +This is `mapper-icij`, a Python script that converts ICIJ Offshore Leaks database files (Panama Papers, Paradise Papers, Bahamas Leaks, Offshore Leaks, Pandora Papers) to JSON format for loading into Senzing entity resolution. |
| 8 | + |
| 9 | +## Development Setup |
| 10 | + |
| 11 | +```bash |
| 12 | +# Create virtual environment and install all dependencies |
| 13 | +python -m venv ./venv |
| 14 | +source ./venv/bin/activate |
| 15 | +python -m pip install --upgrade pip |
| 16 | +python -m pip install --group all . |
| 17 | + |
| 18 | +# External dependency: mapper-base must be accessible |
| 19 | +export PYTHONPATH=$PYTHONPATH:/path/to/mapper-base |
| 20 | +``` |
| 21 | + |
| 22 | +## Common Commands |
| 23 | + |
| 24 | +```bash |
| 25 | +# Lint (matches CI workflow) |
| 26 | +pylint $(git ls-files '*.py' ':!:docs/source/*') |
| 27 | + |
| 28 | +# Other linting tools available |
| 29 | +black src/ |
| 30 | +isort src/ |
| 31 | +flake8 src/ |
| 32 | +mypy src/ |
| 33 | +bandit -c pyproject.toml -r src/ |
| 34 | +``` |
| 35 | + |
| 36 | +## Running the Mapper |
| 37 | + |
| 38 | +```bash |
| 39 | +python src/icij_mapper.py -i /path/to/csv/files -o output.json [-l stats.json] [-a] |
| 40 | +``` |
| 41 | + |
| 42 | +Required input CSV files: `nodes-entities.csv`, `nodes-intermediaries.csv`, `nodes-officers.csv`, `nodes-addresses.csv`, `nodes-others.csv`, `relationships.csv` |
| 43 | + |
| 44 | +## Architecture |
| 45 | + |
| 46 | +The mapper (`src/icij_mapper.py`) follows a single-script design: |
| 47 | + |
| 48 | +1. Loads ICIJ CSV files into a temporary SQLite database for efficient querying |
| 49 | +2. Creates SQL views to join node tables with relationships (edges) |
| 50 | +3. Processes each node type (entity, intermediary, officer, address, other) sequentially |
| 51 | +4. Outputs JSON lines format with Senzing entity resolution attributes |
| 52 | + |
| 53 | +Key external dependency: Requires `base_mapper` from [mapper-base](https://github.com/Senzing/mapper-base) for company name detection and variant handling. |
| 54 | + |
| 55 | +## Code Style |
| 56 | + |
| 57 | +- Line length: 120 characters (black, flake8) |
| 58 | +- Import sorting: isort with black profile |
| 59 | +- See `pyproject.toml` for tool configurations and `.pylintrc` for additional pylint settings |
0 commit comments