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-2.3.9.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-2.3.9-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file hanifx-2.3.9.tar.gz.

File metadata

  • Download URL: hanifx-2.3.9.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-2.3.9.tar.gz
Algorithm Hash digest
SHA256 7573443f7566cf259708d6df7bda36a11e71f6c2e7fa37c67f6e272e62e1497c
MD5 9217de93cf1860da5a0cdc03e316a7f9
BLAKE2b-256 9b7ac3a7122a19ca6ed863bc7f41c9eeffed66f9a6030da636935a96a6a9d19b

See more details on using hashes here.

File details

Details for the file hanifx-2.3.9-py3-none-any.whl.

File metadata

  • Download URL: hanifx-2.3.9-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for hanifx-2.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1bf538dc429166bb034a27c92a96977b3aac0a25ce77a0b8418ccc9197d6df1d
MD5 c1270e40815bddca40d3882e7babd241
BLAKE2b-256 668b42af7fdd42a66ea6cc1c08dbc2ba7cdf76fc694c6f7178da5fb6132f222f

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