Skip to main content

๐Ÿงฌ 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!

  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


๐Ÿ“„ 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hanifx-27.0.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hanifx-27.0.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

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

Hashes for hanifx-27.0.0.tar.gz
Algorithm Hash digest
SHA256 7028a20fc3df759301a56b826d504e9eb310beee6a08c57bf3543c618583ef53
MD5 e023ddef7e1c6486f8b6464483b3bfdb
BLAKE2b-256 38a3b8c5d65dbdf559603977f09b42eee27c599795adb97569c482ed018f0c8c

See more details on using hashes here.

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

Hashes for hanifx-27.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9120b1a5f31ebd60944981f51bd13472ec1dead82d87637f903987399a9bea6a
MD5 45a2192e07c3a3c99517fb5002e46cde
BLAKE2b-256 5b96ec765ed952532da3558ef006758d20c9c88016fce5657e37831842f3bd91

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page