Metadata-Version: 2.4
Name: pylib-dictutils
Version: 0.1.0
Summary: Deep merge, flatten, pick, omit, and transform nested dicts. Essential for data processing.
Author: pylib-dictutils
License: MIT
Project-URL: Homepage, https://github.com/upendra-manike/PyLib
Project-URL: Repository, https://github.com/upendra-manike/PyLib
Project-URL: Documentation, https://github.com/upendra-manike/PyLib
Project-URL: Issues, https://github.com/upendra-manike/PyLib/issues
Keywords: ai,data-processing,data-science,dictionaries,machine-learning,ml,nlp,utilities
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# pydictutils

Deep merge, flatten, pick, omit

## Installation

```bash
pip install pydictutils
```

## 💡 Usage Examples

### Basic Operations

```python
from pylib_dictutils import deep_merge, flatten_dict, pick, omit

# Deep merge dictionaries
dict1 = {"a": 1, "b": {"c": 2}}
dict2 = {"b": {"d": 3}, "e": 4}
merged = deep_merge(dict1, dict2)
# {'a': 1, 'b': {'c': 2, 'd': 3}, 'e': 4}

# Flatten nested dictionary
nested = {"a": 1, "b": {"c": 2, "d": 3}}
flat = flatten_dict(nested)
# {'a': 1, 'b.c': 2, 'b.d': 3}

# Pick specific keys
data = {"name": "John", "age": 30, "city": "NYC"}
picked = pick(data, ["name", "age"])
# {'name': 'John', 'age': 30}

# Omit specific keys
omitted = omit(data, ["age"])
# {'name': 'John', 'city': 'NYC'}
```

### AI/ML Use Cases

```python
from pylib_dictutils import deep_merge, flatten_dict, pick, omit

# Merge API responses with defaults
default_config = {"model": "gpt-4", "temperature": 0.7}
user_config = {"temperature": 0.9}
final_config = deep_merge(default_config, user_config)

# Flatten ML model parameters
model_params = {"layers": {"hidden": 128, "output": 10}}
flat_params = flatten_dict(model_params)
# {'layers.hidden': 128, 'layers.output': 10}
```

## 📚 API Reference

See package documentation for complete API reference.


## 🤖 AI Agent Friendly

This package is optimized for AI agents and code generation tools:
- **Clear function names** and signatures
- **Comprehensive docstrings** with examples
- **Type hints** for better IDE support
- **Common use cases** documented
- **Zero dependencies** for reliability

## License

MIT
