AsciiWriter
About asciiWriter
A python library to draw with plain text in ASCII art style (but with Unicode).
Install
$ pip3 install asciiwriter
Links
- asciiWriter/sinus.py
- https://pypi.org/project/asciiWriter/
- https://git.vvvvvvaria.org/mb/asciiWriter
- https://vvvvvvaria.org/plaintext-partyline/
- https://www.algolit.net/index.php/Data_Workers_Publication
- https://darc.au.dk/publications/peer-reviewed-newspaper#c40171
- https://git.vvvvvvaria.org/mb/data-workers-publication
- https://monoskop.org/media/text/tenen_2017_plain_text/
Gallery
Plaintext Partyline, made by Varia/Manetta Berends, https://varia.zone/en/plaintext-partyline.html
Peer-reviewed Newspaper Vol 10 No 1 (2021): RESEARCH REFUSAL, made by OSP/Gijs de Heij, https://darc.au.dk/publications/peer-reviewed-newspaper#c40171
KASK Open Design workshop, example for posters made with plain text, made by OSP/Gijs de Heij, https://gitlab.constantvzw.org/osp/workshop.odc2019
Cover of the Data Workers publication, made by Manetta Berends for Algolit, https://www.algolit.net/index.php/Data_Workers_Publication
Screenshot of the Data Workers publication previewed in plain text, made by Manetta Berends for Algolit, https://git.vvvvvvaria.org/mb/data-workers-publication
Some thoughts
AsciiWriter is a Python library that can be used to generate plain text graphics and lay outs. The tool is embedded in a network of practices, scripts and events around OSP and Varia, in which plain text has been used to generate visuals and publications, such as the Data Workers, an exhibition catalog for Algolit (March 2019), a plaintext poster workshop at the Open Design Course at KASK (September 2019), Plaintext Partyline at Varia (April 2021) and a Peer-reviewed Newspaper made with asciiWriter (summer 2021).
My interest in plain text as a file format, environment and attitude, points to a engaged mode of computational meaning making. Plain text, with the X-Y axes as rigid constraints, embodies a monotone and spacial strictness of a monospace environment. Plain text can be an intimate space, with its manual possibilities to intervene in the drawing or lay out that you're making, but also the open ended range of possibilities for generating plain text material. Plain text can also be a fragile space, with its transformative, re-usable and ready to be rendered materiality, which comes to the surface when we think of plain text language corpora used for machine learning.
Matrix - matriz in Spanish, matris in Tagalog, the womb The intimate nature of an organization is visible in the way it holds information on its spreadsheets. To hold information womblike, allowing nutritive forces to find their way to what is being gestated. X, Y, axes to determine sex and maybe gender chromosomally. When an X-Y matrix is populated with information linearly, the possibility of curvature arises, of reading data on multiple hair-pin turns, down a column, through a row, and inter-lineally in other directions. It is this turning of attention on multiple tangent points that allows an anti-linear (?) reading. More than anti-linear, I would say it's hyperlinear. The greater the multiplicity of data points to turn on, the higher the possibility of representing fluid life forms. Am thinking about a drawing exercise I saw today on a meme account. It was an exercise from 1910. The instructions were to draw a cat using only angular lines.
Clara Balaguer, https://vvvvvvaria.org/plaintext-partyline/
Back to the asciiWriter! Turning asciiWriter into an pip-installable Python library was actually also an exploration in itself, both Gijs de Heij and myself had never done that before, and we were curious to give it a try. What does it mean to turn a bunch of scripts that are stored in git repo's here and there into something that is installable Python library? Would other people use and transform it? Do we need to maintain this library?
During the radio conversation Standards and work arounds, with Open Source Publishing (OSP), initiated by Simon Browne and myself in the context of the Publishing Partyline, the notion of tools was central to understanding what impact tool-making has on a design or publishing practice. What is the difference between a tool and a set of scripts? Is the gesture of turning something into a tool a gesture of claiming ownership and authorship? When we discussed the html2print project of OSP during the radio conversation, Alex, Gijs, Doriane and Amélie explained how the project first emerged as an experiment, but then grew into an approach and ecosystem. Something like a boilerplate that invites you to adapt it, a collection of hacks, or a tool chain. They preferred to look at it as a collection of practices, rather than a solid/fixed tool.
An example script
sinus.py
from asciiWriter.patterns import sinus_vertical
from asciiWriter.utils import make_lines, visit, print_lines, merge
from asciiWriter.marks import sentence, space
# Define width and height of the output
width = 70
height = 25
# As we draw multiple sinoids we will collect
# them in a list of layers
layers = []
# Loop through a range of X, X in steps of X
# (the amount of loops is the amount of layers)
for x in range(-50, 50, 5):
# Set the pattern with the changing offset
pattern = sinus_vertical(period=10, amplitude=40, offset=x)
# We use a sentence to draw the text
mark = sentence('▚▒▓▞')
# Define a blank character
blank = space('░')
# Make the canvas
lines = make_lines(width, height)
# Draw the sinoid, but add it to the list
result = visit(lines, pattern, mark, blank)
# Add it the result to the list of layers
layers.append(result)
# Merge the layers into one layer again
merged = merge(width, height, blank(), layers)
# Print the result
print_lines(merged)
Use asciiWriter
(Psst: this is incomplete documentation...)
marks
With marks you can specify what kind of text you are passing on to asciiWriter.
random()
sentence(str)
text(str)
single(str)
space(str)
patterns
You can draw patterns with the following functions.
diagonal(x, y, width, height, mark, blank)
Draw a diagnal line from top left to bottom right.
cross(x, y, width, height, mark, blank)
Draw two diagonals.
horizontal(y)
Draw horizontal line at given Y position.
vertical(x)
Draw a vertical line at given X position.
sinus_vertical(period=0.2, amplitude=0.5, offset_t=0, offset=0)
Draw a sinus shape vertically.
sinus_horizontal(period=0.2, amplitude=0.5, offset_t=0, offset=0)
Draw a sinus shape horizontally.
image(path, threshold=128)
Put marks based on a mask. Requires Pillow to be installed.
$ pip3 install pillow