Skip to main content

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.

Metadata

Release files for python-code-minimap 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-code-minimap 0.1.1
File Size Uploaded
python_code_minimap-0.1.1.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-code-minimap 0.1.1
File Interpreter ABI Platform
python_code_minimap-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.6 kB

Release files / python_code_minimap-0.1.1.tar.gz

Download URL python_code_minimap-0.1.1.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
451cb6872ab81721b1a7882e0779f370122527a3463bf29175f962678c3d3025
BLAKE2b-256 checksum
How to use checksums
b106d545e0e1b9999b54c32e12d11f0bad9f11211580d3b20e4b015d74a2026b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.0

Release files / python_code_minimap-0.1.1-py3-none-any.whl

Download URL python_code_minimap-0.1.1-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74c8f12f9b8a9edd4ee8d41b0727191a099d618703c6fd5ffa4c833e4bb8445f
BLAKE2b-256 checksum
How to use checksums
98196ae43df1404866b81e600496caf7ee287fc7db4534de0ce6770ac7d025ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.0

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page