Pure Python code minimap render.
Project description
Python Code Minimap
This is a pure Python port of the wonderful code-minimap.
It is a lot slower than the original.
Usage
usage: code-minimap [-h] [--hscale HSCALE] [--vscale VSCALE] [--padding PADDING] [--octant] [file]
Render a Braille minimap of a text file.
positional arguments:
file File to read. Use '-' or omit to read from stdin.
options:
-h, --help show this help message and exit
--hscale, -H HSCALE Horizontal scaling factor (default: 1.0).
--vscale, -V VSCALE Vertical scaling factor (default: 1.0).
--padding, -p PADDING
Pad each output line to this width.
--octant Use the octant block character set instead of Braille.
$ python -m code_minimap -V 0.25 -H 0.5 code_minimap.py
⣿⣿⣿⣿⣿⣿⣿⣭⣥⣤⣤⣤⣤⣄⣀⣀⣀⡀
⣿⣿⣿⣿⡿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠇
⣒⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠶⠶⠶⠄
⠶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣤⣤⣤⣤⣤⠤⠄
⠤⣭⣿⣿⣿⣿⣿⣿⣿⣿⠿⠿⠿⠿⠭⠭⠤⠤⠤⠤⠤
⣀⣤⣿⣿⣿⣛⣛⣛⡛⠃
⣒⣿⣿⣿⣿⣿⣿⣿⣿⣿⣓⣒⣒⣒⣂⣀⣀⣀
⠒⣿⣿⣿⣿⣿⣭⣭⣤⠤⠤⠤⠤⠤
⠛⠿⣿⣿⣷⣶⣶⣶⣤⠤⠤
⠀⠛⠛⠿⣿⣿⣷⣶⣶⡶⠤⠤
⠤⣶⣿⣿⣿⣿⣿⣿⣿⣟⣛⣓⣀⣀⣀⡀
⠀⠿⣿⣿⣿⠿⠭⠭⠭⠭⠭⠭⠭⠭⠉⠉
⠀⣭⣿⣿⣿⣿⣿⣟⣛⣛⣛⣛⡋⠁
⠒⠿⣿⣿⣿⣯⣭⣭⣭⣭⣭⣭⣭⣤⣤⣤⣤⣤⣤⠤
⠒⠛⠛⠛⠛⠛⠋⠉⠉⠉⠉⠉
Installation
pip install python-code-minimap
Python API
from code_minimap import render
minimap = render(Path("code_minimap.py").read_text(), hscale=0.5, vscale=0.25)
print(minimap)
You can also iterate over lines of the minimap using the iter_minimap_lines function.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_code_minimap-0.1.1.tar.gz.
File metadata
- Download URL: python_code_minimap-0.1.1.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
451cb6872ab81721b1a7882e0779f370122527a3463bf29175f962678c3d3025
|
|
| MD5 |
7690dfb43c041b31c15b5b3359775f43
|
|
| BLAKE2b-256 |
b106d545e0e1b9999b54c32e12d11f0bad9f11211580d3b20e4b015d74a2026b
|
File details
Details for the file python_code_minimap-0.1.1-py3-none-any.whl.
File metadata
- Download URL: python_code_minimap-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74c8f12f9b8a9edd4ee8d41b0727191a099d618703c6fd5ffa4c833e4bb8445f
|
|
| MD5 |
692ecada148ec2e375ca6ab9f1a1b41c
|
|
| BLAKE2b-256 |
98196ae43df1404866b81e600496caf7ee287fc7db4534de0ce6770ac7d025ee
|