Skip to main content

Code formatter to get less boring Python files

Project description

Fancifypy

Are you tired of boring Python code? Or do you want to make a real impression with your next PR? Look no further! Fancifypy will transform any plain and boring Python code into a feast for the eyes.

pipx run fancifypy code "print(range(5))" --seed 42
pᵣⁱⁿt ( ᵣ𝙖𝕟ᵍ𝐞 ( 5 ) )

Alternatively, you can fancify files directly

pipx run fancifypy path script.py

and defancified files (if you for some reason want boring files again)

pipx run fancifypy boring script.py

Note that fancifypy leaves somewhat odd whitespaces, so we reccommend using Ruff or Black afterwards to format the code.

Is this safe?

Fancifypy checks that the abstract syntax tree doesn't change after fancifying, so this is 100% safe (for CPython). This means that any code that imported your code before fancifying will also work with it after fancifying with no modifications.

How does this work?

When CPython looks up identifiers, it first normalizes the code using "NFKC" normalization. This program detects identifiers in a Python file and replaces all character with a different character that normalizes to it. So for Python, there is no change in the files.

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

fancifypy-0.1.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

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

fancifypy-0.1.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file fancifypy-0.1.0.tar.gz.

File metadata

  • Download URL: fancifypy-0.1.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.24.1 CPython/3.12.1 Linux/6.8.0-1026-azure

File hashes

Hashes for fancifypy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 baed8a7d4355a6854d3b34e2108d8e957074589459ee4747063661ad36ea95e4
MD5 4e700ba8a52999857dd2a418f2ca7759
BLAKE2b-256 c5790d63b4fada3d28f39b5494728160206538510b695e78190bddb7ae580728

See more details on using hashes here.

File details

Details for the file fancifypy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fancifypy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.24.1 CPython/3.12.1 Linux/6.8.0-1026-azure

File hashes

Hashes for fancifypy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90b75620726debc548747ff384389d9ecc81846eeeac94a3b49decfa3ff68c5b
MD5 8c3aeb86b61796b5eaf7a1f93877f347
BLAKE2b-256 ffd4069d1daddce613d53a543b306b151acecec25766f22f9150473be6142866

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