Convert Scrivener projects to Obsidian-compatible Markdown, preserving binder structure, links, and metadata
Project description
Scrivenite
Convert Scrivener projects to Obsidian-compatible Markdown โ preserving your binder structure, internal links, and inspector metadata.
Features
- ๐ Binder Structure Preserved: Your Scrivener folder hierarchy maps directly to folders in your Obsidian vault, with optional
01 -ordering prefixes so the Manuscript reads in binder order - ๐ Wikilink Conversion: Internal Scrivener links (
scrivlnk://andscrivener://) become Obsidian[[Wikilinks]], with aliases when the link text differs from the title - ๐ท๏ธ YAML Frontmatter: Every note gets frontmatter with its original
scrivener_idand the document title as an alias, for robust search and cross-referencing - ๐ Metadata Rescue: Synopses, inspector Notes, and inline Comments are appended to each note under
## Synopsis,## Notes, and## Commentsheaders - ๐ผ๏ธ Media Support: Images and PDFs are copied over with companion
.mdfiles containing![[embeds]] - ๐งน Clean Markdown Output: Strips RTF artifacts, excessive escaping, Scrivener compile placeholders (
<$PROJECTTITLE>,<$wc100>, โฆ), and stray backticks - ๐ Collision-Safe Filenames: Titles become safe filenames (truncated to 100 chars); name collisions get a short UUID suffix
Prerequisites
- Python 3.8 or higher
- Pandoc (macOS:
brew install pandoc)
Installation
git clone https://github.com/krishnakumar-kapil/scrivenite.git
cd scrivenite
pip install -e .
Usage
Point the script at the .scrivx file inside your .scriv project bundle:
python scriv_to_obsidian.py path/to/MyNovel.scriv/MyNovel.scrivx output_folder
Options
| Option | Description |
|---|---|
-v, --verbose |
Detailed logging of every item processed |
--clear |
Delete the output folder before converting (useful when re-running) |
-o, --ordered-folders |
Folder titles whose contents get 01 - ordering prefixes (default: Manuscript; repeatable) |
--skip-trash |
Don't convert the contents of the Trash folder |
--conservative |
Disable opinionated cleanup heuristics (stray-backtick stripping, character-sheet header promotion). Use if your documents contain inline code or literal backticks |
Example with options:
python scriv_to_obsidian.py MyNovel.scriv/MyNovel.scrivx vault/MyNovel --clear -o Manuscript -o Characters -v
Example Project Structure
Input Scrivener binder:
MyNovel.scriv
โโโ Manuscript
โ โโโ Chapter 1
โ โ โโโ Scene 1
โ โ โโโ Scene 2
โ โโโ Chapter 2
โโโ Characters
โโโ Protagonist
Generated Obsidian vault:
output_folder/
โโโ Manuscript/
โ โโโ 01 - Chapter_1/
โ โ โโโ 01 - Scene_1.md
โ โ โโโ 02 - Scene_2.md
โ โโโ 02 - Chapter_2/
โโโ Characters/
โโโ Protagonist.md
Troubleshooting
- "File name too long" errors: Filenames are automatically truncated to 100 characters โ update to the latest version if you still see this.
- Backticks around normal text: An artifact of RTF conversion; the cleanup pass removes them. Please open an issue with a sample if any slip through.
- XML errors on start: Check that you passed the
.scrivxfile (not the.scrivfolder) and that it isn't empty (0 bytes). - Pandoc errors: Make sure
pandocis installed and on yourPATH(pandoc --version).
Roadmap
- Publish to PyPI (
pip install scrivenite) - Fully configurable header detection (currently tuned for character-sheet templates)
- Long-term: a native Obsidian plugin for 1-click imports
Development
Install with test dependencies and run the suite:
pip install -e ".[test]"
pytest
For iterating on cleanup rules or link resolution, convert into the same output directory each time (with --clear) so you can diff results in one vault. A --debug-port 5678 option is available for attaching a remote debugger (pip install debugpy).
Project Structure
scriv_to_obsidian.py: Main script with conversion logictests/: Unit tests and a sample Scrivener project undertests/data/
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run the tests
- Submit a pull request
Bug reports with weird RTF edge cases or unusual Scrivener templates are especially welcome โ they make the parser more robust for everyone.
License
MIT License - See LICENSE file for details
Project details
Release history Release notifications | RSS feed
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 scrivenite-0.1.0.tar.gz.
File metadata
- Download URL: scrivenite-0.1.0.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a52268a8626bc941dd21294b5d5df917370d525aa40a6a63eba424e043b003f
|
|
| MD5 |
2bbe063bd46294680296213c35278c67
|
|
| BLAKE2b-256 |
46f9d50d6021989df7965ab2eb49214440b828dda311315ce1ede49f463ba2f4
|
File details
Details for the file scrivenite-0.1.0-py3-none-any.whl.
File metadata
- Download URL: scrivenite-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63dca3432bd830869d12898a052b990af2b7b53f32d96e2f70d34c32bc6ebc5a
|
|
| MD5 |
0becbc79b042a06a8e890bc18520d95c
|
|
| BLAKE2b-256 |
1017ec40f72e993138e58b30c1ff7193c6e934b5342b656c12abf0b4801db546
|