Metadata-Version: 2.4
Name: summarystatvjsonopensearch
Version: 0.1.0
Summary: Schema-driven profiler for OpenSearch / JSON index data — field stats, role inference, null analysis, correlation detection and LLM-ready YAML export.
Author: Subhajit Bhattacharyya
License-Expression: MIT
Project-URL: Homepage, https://github.com/yourusername/summarystatvjson
Project-URL: Issues, https://github.com/yourusername/summarystatvjson/issues
Keywords: opensearch,json profiling,data quality,summary statistics,EDA,LLM context
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: pandas>=1.5
Requires-Dist: numpy>=1.23
Requires-Dist: pyyaml>=6.0

# summarystatvjson

A schema-driven profiler for OpenSearch index data. Generates rich field-level statistics, infers semantic roles, detects null patterns and categorical correlations, and exports a compact YAML summary ready to be passed as context to an LLM or agent.

---

## Installation

```bash
pip install summarystatvjson
```

---

## Quick Start

```python
import json
from summarystatvjson import json_metadata, to_yaml

with open("my_schema.json") as f:
    schema = json.load(f)

with open("my_data.json") as f:
    raw_data = json.load(f)

result = json_metadata(raw_data, schema)
print(to_yaml(result))
```

Or use the built-in file handler:

```python
from summarystatvjson import lambda_handler

event = {
    "rawDataPath": "my_data.json",
    "schemapath":  "my_schema.json",
}
json_res, yaml_res = lambda_handler(event, None)
```

---

## Inferred Roles

| Role | Meaning |
|---|---|
| `id_field` | High cardinality identifier |
| `constant` | Single value across all records |
| `timestamp` | Date or datetime field |
| `metric` | Numeric measurement (duration, code, count etc.) |
| `categorical` | Low cardinality text |
| `free_text` | Variable text with no clear pattern |
| `opaque` | Flattened or geo object — profiling skipped |

---

## Requirements

- Python >= 3.9
- pandas >= 1.5
- numpy >= 1.23
- pyyaml >= 6.0

---

## License

MIT
