๐งฌ Living Code โ Python functions that watch themselves, feel pain, and evolve.
Project description
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
pip install hanifx
That's it. No extra setup. No config files. Nothing.
๐ Quick Start
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
find_duplicates.stats()
# Output:
# ๐ Stats for: find_duplicates
# Total calls : 127
# Average time : 18ms
# Last call : 2026-05-11 10:32:14
โ๏ธ Advanced Usage
# 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!
- Fork the repo
- Create your branch (
git checkout -b feature/amazing) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing) - Open a Pull Request
๐ Found a Bug?
Open an issue here โ ๐ 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hanifx-27.0.0.tar.gz.
File metadata
- Download URL: hanifx-27.0.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7028a20fc3df759301a56b826d504e9eb310beee6a08c57bf3543c618583ef53
|
|
| MD5 |
e023ddef7e1c6486f8b6464483b3bfdb
|
|
| BLAKE2b-256 |
38a3b8c5d65dbdf559603977f09b42eee27c599795adb97569c482ed018f0c8c
|
File details
Details for the file hanifx-27.0.0-py3-none-any.whl.
File metadata
- Download URL: hanifx-27.0.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9120b1a5f31ebd60944981f51bd13472ec1dead82d87637f903987399a9bea6a
|
|
| MD5 |
45a2192e07c3a3c99517fb5002e46cde
|
|
| BLAKE2b-256 |
5b96ec765ed952532da3558ef006758d20c9c88016fce5657e37831842f3bd91
|