Nyhtop: The Python Replacement You Never Knew You Didn’t Need
Nyhtop is here to revolutionize your coding experience by turning Python on its head – literally. Forget the simplicity and readability of Python; Nyhtop takes that elegance and adds an exciting twist: every line is written backwards! With Nyhtop, code clarity reaches a whole new level (of confusion), promising an impressively awkward and cryptic experience that will have you wondering how you ever tolerated straightforward syntax.
Nyhtop enthusiasts argue that it’s not just Python – it’s Python improved. Indentation wars? Resolved. All your indentation happens at the end of the line, so tabs vs. spaces is no longer a battle you can even see. And comments? They’re read from right to left, so cryptic notes and backward logic are just part of the Nythopic experience.
If you’re tired of the predictability and accessibility of Python, Nyhtop promises to shake things up by keeping things just familiar enough to fool you into thinking you know what’s happening. But in practice? It’s perfectly unreadable – just as any good esolang should be.
Enjoy the freedom of Nythop with these examples:
Arithmetic operations #
5 = a
3 = b
)b + a ,":muS"(tnirp
)b - a ,":ecnereffiD"(tnirp
)b * a ,":tcudorP"(tnirp
)b / a ,":tneitouQ"(tnirp
Leading whitespaces are not a problem #
5 = a
3 = b
)b + a ,":muS"(tnirp
)b - a ,":ecnereffiD"(tnirp
)b * a ,":tcudorP"(tnirp
)b / a ,":tneitouQ"(tnirp
5 Factorial #
:)n(lairotcaf fed
:0 == n fi
1 nruter
:esle
)1 - n(lairotcaf * n nruter
))5(lairotcaf ,":5 fo lairotcaF"(tnirp
Print up to 10th term of fibonacci #
:)n(iccanobif fed
1 ,0 = b ,a
:)n(egnar ni _ rof
)" "=dne ,a(tnirp
b + a ,b = b ,a
)01(iccanobif
Nythop supports the most advanced LLM technologies too! #
IAnepO tropmi smll.niahcgnal morf
)"yek-ipa-ruoy"=yek_ipa_ianepo(IAnepO = mll
)"?pohtyN htiw gnidoc yojne uoy oD"(mll = esnopser
)esnopser(tnirp
Ready to leave Python behind? Let’s dive in!
Table of Contents
Installation
Nyhtop is available on PyPI, so you can install it in seconds if you’re ready to turn Python upside-down. Just run:
pip install nythop
And that’s it! You’re now equipped to enjoy the Nythop experience.
Coding
Nyhtop is, at its core, just Python – but backwards. Every line is simply a reversed version of Python syntax, which means if you’re already familiar with Python, you’re halfway there (or perhaps halfway confused). Any valid Python code can be adapted to Nyhtop by flipping each line from right to left. For example:
print("Hello, World!")
)"!dlroW ,olleH"(tnirp
That’s it. No new keywords, no unfamiliar constructs – just reversed lines of Python code. Of course, this makes even the simplest tasks look cryptic, but it’s still technically Python. Indentation (the invisible kind) happens at the end of each line, so the usual debate over tabs vs. spaces doesn’t apply here.
Check out some of the possible for loop versions:
# Using the character ␠ to visualize whitespaces
:)01(egnar ni i rof
)"}20:i{ retI"f(tnirp␠␠␠␠
# You can move things around within the line, just don't mess with the invisible indentation at the end.
:)01(egnar ni i rof
)"}20:i{ retI"f(tnirp␠␠␠␠
# Maybe you're feeling adventurous and want to make it feel right.
:)01(egnar ni i rof
)"}20:i{ retI"f(tnirp␠␠␠␠
Once you get used to this “improvement,” you’ll find Nyhtop code offers the same functionality as Python but with the added benefit of looking impressively perplexing.
Running
Running Nyhtop from a File
Given the example file hello_world.yp:
)"!dlroW ,olleH"(tnirp
Run it with:
nyhtop hello_world.yp
Running Nyhtop with a Command
Alternatively, you can run Nyhtop code directly from the command line with the -c option:
nythop -c ')"!dlroW ,olleH"(tnirp'
Interactive REPL
To explore Nyhtop’s logic on the fly, you can start an interactive REPL session by simply running:
nyhtop
The REPL will wait for your input in a prompt format. Type )(tixe when you’re ready to escape.
Transpiler
Nyhtop comes with a built-in transpiler that allows you to convert Python code into Nyhtop syntax, turning your familiar Python code into its backward counterpart.
You can use the nythop-transpile command to transpile a Python script into Nyhtop. The basic usage
is:
usage: nythop-transpile [-h] [-c cmd] [-o [output]] [file]
Transpiles python code into nythop
positional arguments:
file Python script file
options:
-h, --help show this help message and exit
-c cmd program passed in as string
-o [output] output file
License
nythop is distributed under the terms of the GPL-3.0-or-later license.
Metadata
Release files for nythop 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| nythop-1.0.0.tar.gz | 70.8 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nythop-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 103.0 kB
Release files / nythop-1.0.0.tar.gz
| Download URL | nythop-1.0.0.tar.gz |
|---|---|
| Size | 70.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c76dcd94fdfd7bd5c2600751468ed8c889db985d2c33c37c51d4d7852bce3be2
|
|
BLAKE2b-256 checksum How to use checksums |
7d38bfd70f5c13be6a830baf05812497e52505bcc77995058fef66dea5ab9bde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2024.
Transparency logRelease files / nythop-1.0.0-py3-none-any.whl
| Download URL | nythop-1.0.0-py3-none-any.whl |
|---|---|
| Size | 32.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f8a338fa50101b719a796621045f2ff0ff47aa60cf7b06b0fbc60c4d16ef2e6b
|
|
BLAKE2b-256 checksum How to use checksums |
46b0a0a1aa40c33e77f0062c9c37834b3a2f35e3b6efef94c08406c11d180b9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2024.
Transparency logSecurity for nythop 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for nythop-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2024.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.