Metadata-Version: 2.4
Name: aimarket-dataset
Version: 2.0.0
Summary: Weekly anonymized invocation corpus exporter (open data)
Author-email: AI-Factory <dev@modelmarket.dev>
License-Expression: MIT
Project-URL: Homepage, https://github.com/alexar76/aimarket-plugins
Project-URL: Documentation, https://github.com/alexar76/aimarket-plugins/tree/main/plugins/aimarket-dataset#readme
Project-URL: Repository, https://github.com/alexar76/aimarket-plugins
Project-URL: Issues, https://github.com/alexar76/aimarket-plugins/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aimarket-hub>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Dynamic: license-file

# aimarket-dataset

## Documentation

| Document | Description |
|----------|-------------|
| [User guide](docs/user-guide.md) | Install, configure, verify plugin is loaded |
| [User cases](docs/user-cases.md) | Personas and cross-plugin workflows |
| [SDK integration](docs/sdk-integration.md) | Code examples and hook behavior |

---

**Weekly anonymized invocation corpus. Open data for researchers.**
Every week, exports `ai-market-corpus-week-N.jsonl` — fully anonymized invocation records (hashed IDs, PII scrubbed). Researchers cite it. Your orchestrator trains on it. Marketing effect: "the AI Economy's public dataset."

## When to Use
- Academic research on AI marketplace economics
- Training data for your own orchestrator (which capabilities get called for which tasks)
- Public transparency — "here's what the AI economy looks like this week"
- Marketing — press coverage from data journalists

## Installation
```bash
pip install aimarket-dataset
```

## Example
```python
from aimarket_hub.database import HubDatabase
from aimarket_dataset.dataset_exporter import export_dataset, schedule_weekly_export

db = HubDatabase("data/hub.db")

# Export this week's corpus
path = export_dataset(db, output_dir="data/datasets", week_number=21)
print(f"Exported to: {path}")

# Check a record
import json
with open(path) as f:
    record = json.loads(f.readline())
    print(record)
    # {"week": 21, "capability_id": "e1b44c49d7b5",
    #  "product_id": "cc2a8f969bd2", "price_usd": 0.40,
    #  "latency_ms": 8100, "success": true, ...}

# Cron-friendly: idempotent — exports only if this week's file doesn't exist
schedule_weekly_export(db)
```

## Schema
```json
{
  "week": 21,
  "capability_id": "sha256hash12",
  "product_id": "sha256hash12",
  "source_hub": "sha256hash12",
  "price_usd": 0.40,
  "latency_ms": 8100,
  "success": true,
  "timestamp": "2026-05-22T12:00:00Z",
  "protocol_version": "v2"
}
```

## Privacy
- All IDs are SHA-256 hashed (12-char prefix)
- PII patterns scrubbed (emails → `[email]`, SSN → `[ssn]`, cards → `[card]`, IPs → `[ip]`)
- No consumer addresses, no wallet data
- License: CC-BY 4.0

## License
MIT · Maintained by AI-Factory
