PataLib

Python based pataphysical toolkit

This project is maintained by andydennis

PataLib a Pataphysical toolkit for Python

PataLib for Python is a toolkit for implementing pataphysically inspired algorithms.

A brief look at 'pataphysics

The following description is drawn from the paper:

"Investigation of a patadata-based ontology for text based search and replacement" (Dennis, 2016)

The field of ‘pataphysics was founded in the late 19th Century by the playwright Alfred Jarry. It can briefly be described as a field of philosophy or pseudoscience and its definition is often stated as:

...a supposed branch of philosophy or science that studies imaginary phenomena beyond the realm of metaphysics; the science of imaginary solutions." (‘pataphysics, 2015).

Jarry built upon his pataphysical concepts through several works over the course of his career including Ubu Roi, Gestes et opinions du docteur Faustroll pataphysicien (Exploits and Opinions of Dr. Faustroll Pataphysician), La Chandelle Verte: Lumières sur les Choses de ce Temps (The Green Candle: Lights on things in this time) and César-Antéchrist (Caesar Antichrist).

Many of the ideas he and those who followed him are expressed in this tool kit including:

Anomaly

An anomaly represents an exception to the rule, that which disrupts the order of a system. At its heart Jarry said ‘pataphysics is the law that governs exceptions.

Therefore if ‘pataphysics sees the world as a collection of unique events surely an anomaly cannot exist? It is here we find that the anomaly exists within the rule it contradicts. Thus an anomaly within ‘pataphysics is an oxymoron and is the exception within the rule that renders the rule no longer a rule.

Antinomy

The term antinomy is used to define the mutually exclusive. At its core it sums up symmetry and incompatibility. Examples are both plus and minus, good and evil black (the absence of light) and white (all the colours of the spectrum). In Jarry’s Caesar-Antichrist it is represented by the physick-stick. In an imaginary play acted out in this work the stick spins across the stage creating both a plus and minus.

Clinamen

For readers of Jarry’s work the most common clinamen they are likely to have come across is “merdre” derived from the French word merde (shit). Here we have a slight swerve away from the original word merde, with the addition of the ‘r’. The experimental Canadian poet Christian Bök has summed up the definition of a clinamen as: “the smallest possible aberration that can make the greatest possible difference”. (Bök 2002).

Equivalent/Synonym

The equivalent is the synonym of two phrases. For example ‘ground’ and ‘land’ being synonymous. The equivalent of course benefits from being similar, but not necessary identical. In so much that two words can reference the same thing, but have a subtle difference in how a reader interprets them in the context of a sentence.

Syzygy

The root of syzygy can be found in astronomy and refers to the alignment of three celestial bodies. The Sun and Earth in conjunction with the Moon being an example of one of these alignments. Outside of astronomy it can be found in a variety of other fields including poetry and philosophy. In ‘pataphysics it is used in the context of a pun resulting in something unexpected. An example being the name ‘pataphysics itself as we have seen. Other examples can be an unexpected result of a search. An example could be searching for the word “weed” and returning the word “band”. Whilst the initial search may have been meant in the context of an uncultivated plant growing in the garden, the returning of the word “band” throws it into a different context. Now we have the initial word meaning drugs, and the search result being a reference to a rock band and the associated dug use or the prohibition of drugs.

Installation instructions

The source code can be installed from pypi via pip:

pip install patalib

Alternatively the source code can be cloned from GitHub and also installed via pip

pip install -e patalib

Implementing the library

Implementing the PataLib library is fairly simple. The following examples demonstrate accessing each of the available features:

from patalib import PataLib
from patalib import Antonym, Synonym, Syzygy, Anomaly, Clinamen

test = Synonym().generate_synonym("bye")

test = Antonym().generate_antonym("bye")

test = Syzygy().generate_syzygy("bye")

test = Anomaly().generate_anomaly("bye", ["egg","apple"], 1)

test = Clinamen().generate_clinamen("hi", ["ho","he"], 1)

test = PataLib().palindrome("bye")

Each function bar the palindrome returns a dictionary object of the following format:

{'input' : input word, 'results' : results, 'category' : category type}

Here the input will be the input word, the results a list of matches and the category the category type for exampe anomaly, clinamen etc.

The Palindrome function returns true or false.

Testing

A nmber of tests exist in doc test and hypothesis fuzz testing format.

To run the tests from the command line you can run the following:

python -m doctest test_runner.py

References

Bök, C. 2002. 'Pataphysics: The Poetics of an Imaginary Science. Evanston IL, USA. Northwestern University Press.

Dennis, A.K 2016. Investigation of a patadata-based ontology for text based search and replacement.

“pataphysics," in Dictionary.com Unabridged, (2015). Available from: http://dictionary.reference.com/ [1 March 2016]