Spatialize linear text into pictures you can read: walks, spirals, dotplots, and concordances
Project description
lexograph
Spatialize linear text into pictures you can read — in pure Python, rendered with matplotlib.
lexograph is the visualization member of the corpus-lx family (alongside chronowords, kenon, and keyflux). It turns a text into a picture through one four-step spine — segment → layout → encode → render — and ships several presets that are each just a point on that spine:
- Punctuation spiral — every non-alphanumeric mark, in order, along an Archimedean spiral, coloured by symbol class.
- Text walk (2-D / 3-D) — each sentence steps forward and turns 90°, space-filling; size, colour, and glyph encode per-unit attributes. The 3-D variant lifts the walk into a corkscrew.
- Recurrence dotplot — the only preset that plots a text against itself: a sentence × sentence self-similarity grid that exposes internal echo structure.
- Concordance — a term's dispersion across the text (and across texts/time), with optional KWIC.
Every preset returns a matplotlib Figure and never calls show(), so it renders
inline in Jupyter and saves cleanly with fig.savefig(...). The core is headless and
dependency-light; heavy analysis (sentence embeddings, graph centrality, communities)
lives behind an optional [graph] extra.
Installation
uv add lexograph
The core depends only on numpy, matplotlib, and nltk.
Quickstart
from lexograph import (
load_demo_text, punctuation_spiral, text_walk, recurrence_plot, concordance,
)
text = load_demo_text() # Chapter 1 of Pride and Prejudice (public domain)
punctuation_spiral(text) # marks on an Archimedean spiral
text_walk(text) # the 2-D space-filling walk
text_walk(text, helix=True, z_step=4.0) # the 3-D corkscrew
recurrence_plot(text) # the text against itself
concordance(text, ["Bennet", "Bingley", "wife"]) # term dispersion
Every call returns a matplotlib Figure. For PageRank-sized, community-coloured, or
semantically-recurrent figures, install the [graph] extra and feed
lexograph.analyze.analyze_text's arrays into any preset.
The data contract
Every visual channel is fed by a plain per-unit array — a scalar array for size,
an array of labels or values for colour, an optional glyph/font. Nothing in the
core knows where those numbers came from, so you can drive a spiral or a walk from
length, frequency, or your own column with no analysis stack at all. The optional
analyze layer and the [kenon] / [chronowords] integrations only produce arrays
that satisfy this contract.
Documentation
Full documentation — quickstart, a tutorial per preset, troubleshooting, and the API
reference — is at lexograph.readthedocs.io. The
sources live in docs/.
Roadmap
Open modelling and packaging decisions are analysed in
CHANGES_SUMMARY.md, and the failure modes in
PRE-MORTEM.md. The main not-yet-built pieces:
- Vendor the four OFL/Apache handwriting fonts so the handwriting walk works out of the box (the width-step already runs on any TTF).
-
integrations/— thin[kenon]and[chronowords]adapters over the data contract. - Optional interactive HTML/WebGL export (
render/html.py), ported from the source viewers and gated behind a stretch extra. - A space-filling / non-self-overlapping turn rule for very uniform texts.
Made by
lexograph is made by Crow Intelligence.
License
MIT
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 lexograph-0.1.0.tar.gz.
File metadata
- Download URL: lexograph-0.1.0.tar.gz
- Upload date:
- Size: 33.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfd65479455b90ae4c8a6258af53f742e550191398c04e6e16d07a2949b74b74
|
|
| MD5 |
4b3fb5068678facc2f5bdb0270654f57
|
|
| BLAKE2b-256 |
b674f97aa66b3e95642b39b376eb5dfa899c751a5a6dd8b0dd5335fb26a031d4
|
Provenance
The following attestation bundles were made for lexograph-0.1.0.tar.gz:
Publisher:
publish.yml on crow-intelligence/lexograph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lexograph-0.1.0.tar.gz -
Subject digest:
bfd65479455b90ae4c8a6258af53f742e550191398c04e6e16d07a2949b74b74 - Sigstore transparency entry: 2034163699
- Sigstore integration time:
-
Permalink:
crow-intelligence/lexograph@2d96cc32873a614adfab7c752cda17829b8c096c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/crow-intelligence
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2d96cc32873a614adfab7c752cda17829b8c096c -
Trigger Event:
release
-
Statement type:
File details
Details for the file lexograph-0.1.0-py3-none-any.whl.
File metadata
- Download URL: lexograph-0.1.0-py3-none-any.whl
- Upload date:
- Size: 49.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11f3dcc82e63ccc153cc10d0cb89c9eec233f324a181838e8e5f5e5241e814a6
|
|
| MD5 |
50dc350a3706cf7899cc61cae2d04cc9
|
|
| BLAKE2b-256 |
3720880716cd5481ee6cc2efd98bec121e3d79dfc7b1a55c5700eae78a8b1779
|
Provenance
The following attestation bundles were made for lexograph-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on crow-intelligence/lexograph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lexograph-0.1.0-py3-none-any.whl -
Subject digest:
11f3dcc82e63ccc153cc10d0cb89c9eec233f324a181838e8e5f5e5241e814a6 - Sigstore transparency entry: 2034164586
- Sigstore integration time:
-
Permalink:
crow-intelligence/lexograph@2d96cc32873a614adfab7c752cda17829b8c096c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/crow-intelligence
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2d96cc32873a614adfab7c752cda17829b8c096c -
Trigger Event:
release
-
Statement type: