Metadata-Version: 2.4
Name: hanifx
Version: 27.0.0
Summary: 🧬 Living Code — Python functions that watch themselves, feel pain, and evolve.
Home-page: https://github.com/hanifx-540/hanifx
Author: hanif
Author-email: 
License: MIT
Project-URL: Homepage, https://github.com/hanifx-540/hanifx
Project-URL: Bug Tracker, https://github.com/hanifx-540/hanifx/issues
Project-URL: Documentation, https://github.com/hanifx-540/hanifx#readme
Project-URL: Source Code, https://github.com/hanifx-540/hanifx
Project-URL: Changelog, https://github.com/hanifx-540/hanifx/releases
Keywords: evolve,living code,self-optimizing,performance,decorator,profiler,monitoring,debugging,auto-optimize,function tracker,code evolution,smart code,ai,machine learning,adaptive
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
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
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Debuggers
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: System :: Monitoring
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Natural Language :: English
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: flake8>=6.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: isort>=5.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=7.0; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=1.0; extra == "docs"
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: platform
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-python
Dynamic: summary

# hanifx 🧬

> **Living Code** — Python functions that watch themselves, feel pain, and evolve.

---

## 🤔 What is hanifx?

Imagine you write a function.
It runs. It works. Great!

But tomorrow? It runs the same way.
Next year? Still the same.
Forever? **Exactly the same.**

Normal code never learns. Never improves. Never grows.

**hanifx changes that.**

With just one line — `@evolve` — your function comes **alive.**
It watches itself. It feels when something is wrong.
And one day, it tells you — *"Hey, I can do better."*

---

## ✨ Features

| Feature | What it does |
|---|---|
| 🧠 **Memory Layer** | Remembers every single time your function runs |
| ⚠️ **Pain Detector** | Knows when your function is slow or broken |
| 🔥 **Evolution Alert** | Tells you when your function is ready to improve |
| 📊 **Live Stats** | Shows you how your function is doing anytime |
| 🔒 **Conscience** | Never makes unsafe changes without asking you |
| ⏪ **Rollback** | Go back to any older version anytime |

---

## 📦 Installation

```bash
pip install hanifx
```

That's it. No extra setup. No config files. Nothing.

---

## 🚀 Quick Start

```python
from hanifx import evolve

# Step 1 — Just add @evolve on top of your function
@evolve
def find_duplicates(data):
    result = []
    for item in data:
        if data.count(item) > 1:
            result.append(item)
    return result


# Step 2 — Use your function normally
for i in range(50):
    find_duplicates([1, 2, 3, 2, 1, 4, 5, 4])


# Step 3 — hanifx is silently watching...
# After 10 calls:
# 🧬 [find_duplicates] Ran 10 times! hanifx is observing...

# After 50 calls:
# 🔥 [find_duplicates] EVOLUTION READY!
```

---

## 📊 Check Stats Anytime

```python
find_duplicates.stats()

# Output:
# 📊 Stats for: find_duplicates
#    Total calls  : 127
#    Average time : 18ms
#    Last call    : 2026-05-11 10:32:14
```

---

## ⚙️ Advanced Usage

```python
# Choose your evolution style
@evolve(goal="speed", safety="strict", notify="always")
def calculate_tax(income, rate):
    tax = 0
    for i in range(int(income)):
        tax += rate / 100
    return tax
```

| Option | Values | Meaning |
|---|---|---|
| `goal` | `speed`, `memory` | What to optimize |
| `safety` | `strict`, `loose` | How careful to be |
| `notify` | `always`, `never` | When to alert you |

---

## 🌱 How a Function Lives

```
Born      →  You write it
Childhood →  First 10 calls, hanifx just watches
Teenage   →  Patterns start to appear
Adult     →  First Evolution Alert fires 🔥
Wise      →  Knows its own best version
```

---

## 🗺️ Roadmap

- ✅ **v0.1** — Memory Layer + Pain Detector
- 🔜 **v0.2** — Evolution Proposals
- 🔜 **v0.3** — CLI Tool (`hanifx run`, `hanifx stats`)
- 🔜 **v0.4** — Team Sync
- 🔜 **v1.0** — Full Release 🚀

---

## 🙋 Who is this for?

- 🐣 **Beginners** — Understand what's wrong with your code easily
- 💼 **Professionals** — Monitor production functions silently
- 👨‍👩‍👧 **Teams** — Learn from everyone's code together
- 🎓 **Students** — Learn to write better code naturally

---

## 🤝 Contributing

Contributions are welcome!

1. Fork the repo
2. Create your branch (`git checkout -b feature/amazing`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing`)
5. Open a Pull Request

---

## 🐛 Found a Bug?

Open an issue here →
👉 [github.com/hanifx-540/hanifx/issues](https://github.com/hanifx-540/hanifx/issues)

---

## 📄 License

MIT License — free to use, share, and modify.

---

## 👨‍💻 Author

Built with ❤️ by **hanif**

> *"Code shouldn't just run — it should learn."*

---

⭐ If you like hanifx, give it a star on GitHub!
👉 [github.com/hanifx-540/hanifx](https://github.com/hanifx-540/hanifx)
