Urtext /ˈʊrtekst/ is an open-source Python library for writing and knowledge management. It wraps an API around a simple, freeform syntax whose contents can be accessed and manipulated to the extent of the Python language.

Freeform, Flexible Syntax

Syntax Overview _  (the single underscore character denotes the node title)

Most of the syntax is freeform!

{ This is a bracket node. It has its own identity within the project. 
{

Bracket nodes can be nested to arbitrary depth. An optional linter indents and formats the syntax as you write.

}

}

| Link >
| Pointer >>

Timestamp: <Thu., May. 08, 2025, 09:20 PM CEST>

Metadata_Key::Metadata value another metadata value etc.

#hash_metadata_value (a shorthand)

Urtext syntax combines content, structure and instructions together; there is no additional code or markup “behind” the syntax.

Metadata

User-definable metadata syntax permits unlimited tagging.

{

type::book
title::The Beautiful and Damned
author::| Scott Fitzgerald >

}
{

Scott Fitzgerald _
Inside this node may be more metadata, including more nodes as metadata:
birthday::<1900>
nationality::United States
short_description::{ Short description here inside another node}

}

Links

An Urtext project encompass up to thousands of files, within which nodes may be linked in wiki-link fashion. Links can also run actions or arbitrary Python code.

Link Examples _
Link to another node:
| Other node id here >

Links to a character position in the destination node
| Destination node id here >:30

Link to a file (absolute or relative):
|/ README.md >

Trigger Link – on click, executes the Python code block in the linked node
|! Open Urtext Website >

Action Link – runs an Action, such as Random Node
|: Random Node >

Cross-Project Link – link to a node in another active projeg
=>”Name or Path of the other project”| destination node ID >

Python Block Execution

Being implemented in Python, Urtext can execute self-modifying or arbitrary Python code. It can be extended to add or modify functionality, to the extent of the Python language. If Urtext does not have a feature you want, you can add it with a little Python knowledge.

{Code Example _

[[
. >(| Python Output >)
. EXEC(@self)
]]

%%Python

# text in here is not parsed as Urtext
# code must respect Python indentation
def times_ten(i):
return i*10
print(times_ten(8))

%%

}

{~ Python Output _
80
}

Local First

Urtext operates on files locally present. It is not dependent on any cloud or other subscription service. Third-party services may be used to sync Urtext projects across devices, but we have found robust version control tools such as Git to be the best solution.

Everything in Text Buffers

Urtext forms a user interface out of its own syntax. Though GUI integrations are possible, everything in Urtext can be accomplished without leaving the text buffer.

No Need to Touch Files

Direct interaction with file system is mostly unnecessary. Creating, naming, saving, and organizing files is handled for you.

Future Proof

No binary or propriety file format is used. The .urtext file extension denotes the syntax only, which is held in Unicode. Plaintext is fast, human-readable, flexible, cross-platform, device-portable, and future-proof. It can be easily diffed and version-controlled. Because the storage format is plain text, an interpreter, compiler, and editor could be implemented in any sufficiently capable language, current, past or future.

Implementations

The core library is headless and requires a implementation in an editor. Implementations are currently available for Sublime Text for desktop and Pythonista for iOS.