Skip to main content

Furrow

A lightweight, zero-dependency Python package to slice, group, and format messy text streams (like raw handwriting recognition outputs, chaotic OCR blocks, or unformatted LLM dumps) into separate lines without losing any of your data.

Installation

pip install furrow

How to Use It

To format your text cleanly, you need to call the engine's methods sequentially:

How to Use It

To format your text cleanly, choose your detectors and call the engine's methods sequentially:

  • NumberDetector: Finds numbered items like 1. or 20. while safely ignoring normal numbers inside sentences (like 500 grapes).

  • MultipleChoiceDetector: Finds letter choices A through D (handles A., A), or even glued text chunks like BTemple).

from furrow import Plow
from furrow.detectors import NumberDetector, MultipleChoiceDetector

# 1. Feed it your raw, smashed-together text block

messy_text = "1. hi there, A) testing BTemple 3 things. 100. dont do this!"


engine = Plow(messy_text, detectors=[NumberDetector, MultipleChoiceDetector])

# 2. Run the character boundary scanner (Crucial step!)
engine.run()

# 3. Pull your questions out as a clean list of data blocks
print(engine.collect())

# Output: [{'marker': '1', 'marker_type': 'number', 'text': '. hi there, '}, {'marker': 'A', 'marker_type': 'multiple choice', 'text': ' test '}, ...]

# 4. Generate the final text string with line breaks perfectly injected
print(engine.render())

# Output:
# 1. hi there, 
# A) testing 
# BTemple 3 things. 
# 100. dont do this!

The Processing Sequence

Furrow processes your text strings in three distinct, lightweight steps:

  • Step 1: engine.run() (The Tokenizer) – Steps through your text character by character using detectors to find numbers and alphanumeric choices. It maps out their exact start, end, and lookahead coordinates in the string.

  • Step 2: engine.collect() (The Filter) – Filters and clusters tokens based on text layouts. For numbers, it verifies the distance to trailing punctuation to ignore normal quantities (like 3 things). For choices, it isolates un-spaced markers (like BTemple) and injects missing formatting periods.

  • Step 3: engine.render() (The Serializer) – Uses the coordinate maps from the previous steps to slice into the original string and drop a clean newline (\n) right before your valid list boundaries.

Everything that isn't identified as a marker (like instructions, title headings, or random words) stays completely safe, untouched, and unmutated.

Metadata

Release files for furrow 0.1.4

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

Source distribution (sdist)

Source distribution for furrow 0.1.4
File Size Uploaded
furrow-0.1.4.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for furrow 0.1.4
File Interpreter ABI Platform
furrow-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 11.2 kB

Release files / furrow-0.1.4.tar.gz

Download URL furrow-0.1.4.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a1cbc1ae9bf61b6eab876edbfb170330e681a54aec73ae4b327d33564c18ae8f
BLAKE2b-256 checksum
How to use checksums
3e367df3b328501a357688a47411b7bba9e3ccbae09cac65e8ef164e56e5c0ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0

Release files / furrow-0.1.4-py3-none-any.whl

Download URL furrow-0.1.4-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f051d7fb989b89b39a9612c75f0d6c09694602eea11cbee4c19c01da5ed2dd69
BLAKE2b-256 checksum
How to use checksums
e8ce1468c4a71f2854ed0ffc95639a16f1713148cfd55a90679f3bbb0046228b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

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