Yes, this is a joke. But I think it works? *rofl* A joke… that works…
Projects like Coconut and cursed-for offer new syntax on top of the standard Python syntax. They achieve this by preprocessing code of their customized form down to standard Python. One option for this preprocessing is to leverage the source code encoding features of Python. For example, specifying # coding: coconut, after some other setup, can enable Coconut syntax for that file. But, what if you need multiple of these syntax modifying encodings? That’s where shimtax comes in and let’s you apply multiple other encodings.
# coding: shimtax:cursed-for:coconut
for (i = 0; i < 10; i += 2):
i |> print
Given that each encoding is offering custom syntax that the others are presumably unaware of, expect many combinations to be order dependent or to simply not work. Those that simply operate on the code as a string are much more likely to be mixable. Those that parse the code via a Python syntax parser are likely to fail.
Setup
shimtax can be set to be automatically enabled using the CLI. This will insert a .pth file in the platlib directory returned by sysconfig.get_path("platlib"). That file will register the shimtax encoding so you don’t have to.
$ .venv/bin/shimtax register
The CLI can also remove the .pth file.
$ .venv/bin/shimtax unregister
If handling this yourself is preferred, you can use the registration helper function.
import shimtax
shimtax.register()
Metadata
Release files for shimtax 0.1
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 | |
|---|---|---|---|---|
| shimtax-0.1.tar.gz | 6.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| shimtax-0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.0 kB
Release files / shimtax-0.1.tar.gz
| Download URL | shimtax-0.1.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
efcf6d227ee979f2cf61c4a9c5f415fcac7a7ddd9f3030cf6c3c2f0cae1d5cd9
|
|
BLAKE2b-256 checksum How to use checksums |
d030170f4879d641b6687655e18664666ef92d22b2168c8f16e01b9b6708eca1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / shimtax-0.1-py3-none-any.whl
| Download URL | shimtax-0.1-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7889f14aad45a8588390915a57a741d511c44357be88532b5f994284611a9dc6
|
|
BLAKE2b-256 checksum How to use checksums |
a10121bd548f745803f3913b466e8c4c4f22087ed5f65beea58ff83b80bfa655
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Security for shimtax 0.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.