Metadata-Version: 2.4
Name: pytriz
Version: 0.1.0
Summary: A Python package for TRIZ (Theory of Inventive Problem Solving) tools and techniques.
Author: mmysior
Author-email: mmysior <mysior.marek@gmail.com>
License-Expression: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Dist: colorlog>=6.10.1
Requires-Dist: jinja2>=3.1.6
Requires-Dist: numpy>=2.4.6
Requires-Dist: pydantic>=2.13.4
Requires-Dist: pydantic-ai>=1.104.0
Requires-Dist: pydantic-settings>=2.14.1
Requires-Dist: python-frontmatter>=1.3.0
Requires-Dist: rank-bm25>=0.2.2
Requires-Dist: sentence-transformers>=5.5.1
Requires-Python: >=3.12, <3.14
Project-URL: Homepage, https://github.com/mmysior/pytriz
Project-URL: Issues, https://github.com/mmysior/pytriz/issues
Description-Content-Type: text/markdown

# PyTRIZ

A Python library for applying TRIZ (Theory of Inventive Problem Solving) — look up parameters, principles, and contradiction matrix results, or use LLM-powered agents to analyze engineering trade-offs.

## Installation

```bash
pip install pytriz
```

Requires Python 3.12+. LLM features require an API key for your chosen provider (OpenAI, Anthropic, Mistral, or OpenRouter).

## Quick start

### Data lookups (no API key needed)

```python
from pytriz import contradictions

# Find TRIZ principles for a contradiction
principles = contradictions.get_principles_from_matrix(
    improving_parameters=[1, 3],
    preserving_parameters=[17, 23],
)

# Search parameters and principles by description
params = contradictions.search_parameters("improves durability", top_k=5)
principles = contradictions.search_principles("segmentation", top_k=5)
```

### LLM-powered analysis

```python
import asyncio
from pytriz import contradictions

result = asyncio.run(
    contradictions.analyze_contradiction(
        "Increasing blade thickness improves durability but increases weight.",
        provider="openai",   # or "anthropic", "mistral", "openrouter"
        model="gpt-4.1",
    )
)

print(result.contradiction)
print(result.improving_parameter)
print(result.preserving_parameter)
```

Set your API key in a `.env` file or as an environment variable:

```
OPENAI_API_KEY=your-key-here
```
