Metadata-Version: 2.4
Name: candy-ai
Version: 12.0.0
Summary: Pont Python vers Cedric7-Thinking — 50 personnalités, 20 utilitaires (translate, summarize, sentiment, codegen...), Helper, CLI, profils, conversations, batch, streaming.
License-Expression: MIT
Project-URL: Homepage, https://client.hubworld.net
Keywords: ai,candy,cedric7-thinking,llm,chatbot,api,cli,nlp
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27.0

# 🍬 candy-ai v12

**Pont Python vers Cedric7-Thinking** — pas une IA, le logiciel qui fait le lien.  
50 personnalités · 20 utilitaires · Helper · CLI · Profils · Conversations · Batch · Streaming

---

## Installation

```bash
pip install candy-ai
```

---

## Démarrage immédiat

```python
from candy import Coding
print(Coding.ask("Write a quicksort in Python"))
```

---

## 🆕 v12 — 20 nouveaux utilitaires

```python
from candy import (
    translate, summarize, spellcheck, keywords, sentiment,
    generate_title, ask_about, rephrase, generate_faq, compare,
    codegen, explain_code, mock_data, timed_ask, cached_ask,
    clear_cache, optimize_prompt, extract, pipeline, full_report,
    detect_lang
)
```

### Traduction & Langue

```python
# Détecter la langue
from candy import detect_lang
print(detect_lang("Bonjour tout le monde"))  # → FR

# Traduire
from candy import translate
print(translate("Hello world", to="FR"))   # → Bonjour le monde
print(translate("Hola", to="EN"))          # → Hello
```

### Analyse de texte

```python
from candy import summarize, sentiment, keywords, full_report

# Résumé en N mots
print(summarize(long_text, words=30, lang="FR"))

# Sentiment
s = sentiment("Ce produit est fantastique !")
print(s["label"])   # → positive
print(s["score"])   # → 0.95

# Mots-clés
kws = keywords("Article sur le machine learning", n=5)
# → ["machine learning", "réseaux neuronaux", ...]

# Rapport complet
report = full_report(my_article, lang="FR")
print(report["summary"])
print(report["sentiment"])
print(report["keywords"])
print(report["titles"])
```

### Génération de contenu

```python
from candy import generate_title, rephrase, spellcheck, generate_faq

# Titres accrocheurs
titles = generate_title(article, lang="FR", n=5)

# Reformulation
print(rephrase("C'est trop bien", style="formal", lang="FR"))

# Correction orthographique
print(spellcheck("Bonjour je mappelle Jean", lang="FR"))

# FAQ automatique
faq = generate_faq(product_description, n=5, lang="FR")
for item in faq:
    print(f"Q: {item['question']}")
    print(f"A: {item['answer']}")
```

### Code

```python
from candy import codegen, explain_code

# Génération de code
code = codegen("fonction qui trie une liste par longueur", language="python")
print(code)

# Explication de code
print(explain_code("def fib(n): return n if n<=1 else fib(n-1)+fib(n-2)", lang="FR"))
```

### Utilitaires avancés

```python
from candy import timed_ask, cached_ask, clear_cache, optimize_prompt

# Mesurer le temps de réponse
result = timed_ask("coding", "What is a decorator?")
print(f"Réponse en {result['time_ms']}ms — {result['words']} mots")

# Cache de réponses (évite les doublons, TTL 1h)
r1 = cached_ask("math", "C'est quoi pi ?")   # → API
r2 = cached_ask("math", "C'est quoi pi ?")   # → cache instantané
clear_cache()  # vider le cache

# Optimiser un prompt
better = optimize_prompt("explique les décorateurs", personality="coding")
print(better)
```

### Extraction & Pipeline

```python
from candy import extract, pipeline, compare, ask_about, mock_data

# Extraire des données structurées d'un texte
data = extract(email_text, ["sender_name", "subject", "date", "action_required"])
print(data["sender_name"])

# Pipeline de transformations
result = pipeline(
    "Mon texte brut...",
    steps=[
        ("summarizer", "Résume en 2 phrases"),
        ("writing",    "Rends le plus engageant"),
        ("reviewer",   "Vérifie la grammaire"),
    ],
    lang="FR"
)
print(result["final"])

# Comparer deux textes
diff = compare(version1, version2)
print(diff["similarities"])
print(diff["differences"])

# Q&A sur un texte
answer = ask_about(article, "Quelle est la conclusion ?", lang="FR")

# Générer des données de test
users = mock_data("user with name, email, age, city", n=5)
```

---

## Profils

```python
from candy import cfg, Coding

cfg.A.lang       = "FR"
cfg.A.max_tokens = 2000
cfg.A.style      = "detailed"

cfg.A = cfg.preset("french_beginner")  # preset rapide
cfg.default.lang = "FR"

print(Coding.ask("Hello"))
print(Coding.use("A").ask("Explique les listes"))
```

**Presets :** `french_beginner` `french_expert` `english_beginner` `english_expert`
`quick` `academic` `creative` `teacher` `coder` `journalist` `storyteller` `analyst` `coach` `debug`

---

## Tous les paramètres

| Paramètre | Défaut | Valeurs |
|-----------|--------|---------|
| `lang` | `"EN"` | `FR EN ES DE IT PT ZH JA AR RU NL PL SV TR KO HI VI ID CS RO` |
| `max_tokens` | `800` | `100` → `4096` |
| `temperature` | `0.7` | `0.0` → `1.5` |
| `style` | `"default"` | `default concise detailed bullet academic casual technical eli5` |
| `tone` | `"neutral"` | `neutral encouraging strict humorous empathetic socratic` |
| `output_format` | `"text"` | `text markdown json html` |
| `expertise` | `"intermediate"` | `beginner intermediate expert` |
| `retry` | `1` | tentatives en cas d'échec |
| `verbose` | `False` | affiche les infos de requête |

---

## CLI

```bash
candy helper          # ouvre la fenêtre Helper
candy -- script.cdy   # exécute un fichier .cdy
```

---

## Les 50 personnalités

`Math` `Coding` `Reflexion` `Analytic` `Full` `Science` `Writing` `History`
`Law` `Medicine` `Finance` `Marketing` `Security` `Design` `Language`
`Psychology` `Education` `Research` `Business` `Productivity` `Cooking`
`Travel` `Music` `Film` `Sports` `Philosophy` `Environment` `Architecture`
`Automotive` `Astronomy` `Biology` `Chemistry` `Physics` `Engineering`
`Entrepreneur` `Ethics` `Geopolitics` `Crypto` `AI` `DevOps` `Database`
`GameDev` `Comic` `Storyteller` `Translator` `Summarizer` `Debugger`
`Reviewer` `Planner` `Tutor`

---

Propulsé par **Cedric7-Thinking** · Quota 800 req/jour · MIT License
