A utility to format raw text protocols into styled PDFs
Project description
Format raw text protocols into clean, publish-ready Word and pdf documents
Say goodbye to messy indentation, unclear bulleting, and formatting inconsistency in step-by-step protocols.
✨ Features
- Automatically detects stepwise sections in
.txtprotocols - Adds clean spacing between blocks
- Handles blank lines, indents, and bullet lists
- Formats output to a well-structured
.docxdocument - Output file uses the same name as input (with
.docxextension) - Fully local and fast
📦 Installation
pip install protocol_formatter
Note for macOS/Linux users:
This package relies on system-level libraries like Cairo, Pango, and GDK-Pixbuf for converting.docxto
Make sure to install them using:brew install cairo pango gdk-pixbuf libffi # macOS sudo apt install libcairo2 libpango-1.0-0 libgdk-pixbuf2.0-0 libffi-dev # Debian/Ubuntu
🧪 How to Use
protocol_formatter path/to/input_protocol.txt
- You’ll be prompted to provide a path if not passed as argument.
- Output will be saved as a
.docxfile in the same folder.
📂 Input Format
Supports .txt files containing stepwise procedures like:
- Prepare solutions
* Mix reagents...
* Adjust pH...
** nested content
- Sample Treatment
* Add buffer
* Incubate at 37°C
🖨 Sample Output
A fully formatted DOCX output example:
🛠 Developer Notes
- Entry point defined in
__init__.py - Uses
python-docxfor Word file creation - Compatible with Python 3.7+
📜 License
Licensed under the MIT License. See LICENSE for details.
Project details
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 protocol_formatter-0.1.3.tar.gz.
File metadata
- Download URL: protocol_formatter-0.1.3.tar.gz
- Upload date:
- Size: 3.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef0d4158d60a0951f907bcdd24d048d7e630826cbf1c8cb5ed2d81c8bfa63adb
|
|
| MD5 |
5997e3f489cc801560ddfb162d715d3a
|
|
| BLAKE2b-256 |
ab36f07b50655cf576abd14c1a82985c3e284859b631d5dbd3ab3a883c723884
|
File details
Details for the file protocol_formatter-0.1.3-py3-none-any.whl.
File metadata
- Download URL: protocol_formatter-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e03c9137ad3936a88d3651dfd046d8c4ff9d2356064002ca3ef933a3a361714d
|
|
| MD5 |
46a0a6f7a887630d8808dcb0c68dbed4
|
|
| BLAKE2b-256 |
9c4774c6b07d94a2424c58822080b6b9ab256c634b6ad59f60a4019de3da2ffb
|