You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+
## Project Overview
6
+
7
+
**diffgetr** is a Python library for comparing nested data structures with detailed diff reporting and interactive navigation. It provides advanced diff capabilities beyond basic comparison, featuring pattern recognition, multiple output formats, and dictionary-like navigation through diff results.
8
+
9
+
## Installation and Development Commands
10
+
11
+
```bash
12
+
# Install the package locally
13
+
pip install .
14
+
15
+
# Install in development mode
16
+
pip install -e .
17
+
18
+
# Test the command line tool
19
+
diffgetr file1.json file2.json path.to.key
20
+
```
21
+
22
+
## Core Architecture
23
+
24
+
### Main Class: `diff_get`
25
+
26
+
The library centers around a single class `diff_get` located in `diffgetr/diff_get.py:9`. This class:
27
+
28
+
1.**Wraps DeepDiff**: Uses the `deepdiff` library as the underlying comparison engine with configurable parameters (`diffgetr/diff_get.py:22-24`)
29
+
30
+
2.**Enables Navigation**: Implements `__getitem__` to allow dictionary-like traversal through nested diff results (`diffgetr/diff_get.py:35-41`)
31
+
32
+
3.**Type Coercion**: Automatically converts lists/tuples to dictionaries for consistent comparison (`diffgetr/diff_get.py:14-17`)
33
+
34
+
4.**Location Tracking**: Maintains path context through the `loc` property for debugging and display (`diffgetr/diff_get.py:26-33`)
-`ignore_added=False`: Filter out added items to focus on changes/removals
73
+
- Configurable precision for numeric comparisons
74
+
- Threshold-based filtering in side-by-side output
75
+
76
+
## Development Notes
77
+
78
+
### Code Structure
79
+
- Single module design with one main class
80
+
- Heavy use of property decorators for computed values
81
+
- String/bytes handling for flexible output streams
82
+
- Recursive instantiation for navigation
83
+
84
+
### Key Dependencies
85
+
-`deepdiff>=6.0.0`: Core comparison engine
86
+
- Standard library: `json`, `re`, `argparse`, `pprint`
87
+
88
+
### Testing Approach
89
+
The library includes comprehensive examples in the README showing various use cases. When adding features, ensure compatibility with existing navigation patterns and output formats.
0 commit comments