project-to-markdown
A bidirectional tool to export Python projects to Markdown and recreate projects from Markdown files.
Features
Export (project-to-markdown)
- Recursively scans a project directory
- Includes code and markdown files (configurable)
- Outputs a single, well-structured Markdown file
- Supports file/directory exclusion and size limits
- Git-aware (respects .gitignore when requested)
Import (markdown-to-project)
- Recreates project structure from exported Markdown files
- Preserves directory hierarchy and file contents
- Handles UTF-8 encoding properly
- Safe overwrite protection
Installation
pip install project-to-markdown
Or, for local development:
pip install .
Usage
Export a Project to Markdown
project-to-markdown --root path/to/project --output export.md --include-exts .py,.md --exclude-dirs .venv,.git --title "My Project"
Export Options
--rootRoot directory of the project (default: current directory)--outputOutput Markdown file (default: project_export.md)--titleTitle for the Markdown document--include-extsComma-separated list of file extensions to include (default: .py,.md)--exclude-dirsComma-separated list of directory names to exclude--exclude-filesComma-separated list of file names to exclude--use-gitignoreRespect .gitignore files in the export--all-filesInclude all files, not just tracked files--max-bytesMaximum size of files to include (default: 10,000,000)--max-linesMaximum number of lines to include per file (0 = unlimited)--tree-from-filesBuild tree from included files (mirrors gitignore/filters)
Recreate a Project from Markdown
python -m project_to_markdown.markdown_to_project -i exported_project.md -o recreated_project
Import Options
-i, --inputInput markdown file containing the project source (required)-o, --outputOutput directory to recreate the project in (default: 'recreated_project')--overwriteAllow writing into an existing, non-empty output directory
Examples
Export Example
project-to-markdown --root my_project --output my_project.md --title "My Project"
Import Example
markdown-to-project -i my_project.md -o recreated_project --overwrite
Project Structure
codebase_to_markdown/
├── project_to_markdown/
│ ├── __init__.py
│ ├── project_to_markdown.py # Export script - project to markdown
│ └── markdown_to_project.py # Import script - markdown to project
├── pyproject.toml
├── README.md
├── MANIFEST.in
├── example.md
└── __init__.py
License
MIT License
Created by Benaya Trabelsi. Contributions welcome! benaya7@gmail.com
Metadata
Release files for project-to-markdown 0.1.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| project_to_markdown-0.1.13.tar.gz | 10.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| project_to_markdown-0.1.13-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.9 kB
Release files / project_to_markdown-0.1.13.tar.gz
| Download URL | project_to_markdown-0.1.13.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21679e4a61d717684158355d3403fe00290e68dfa32c755bbbef832d9035764a
|
|
BLAKE2b-256 checksum How to use checksums |
a3eac4dd877aa23ad941d9c795ef6d0f13a3a6d151cdb7ab5fc1da966f7de397
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / project_to_markdown-0.1.13-py3-none-any.whl
| Download URL | project_to_markdown-0.1.13-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d89c4c96177f5196053f6f18110055e8672e29e7d5f56491fc52ffe9805405d5
|
|
BLAKE2b-256 checksum How to use checksums |
cf1695fe610aaccfc45de1fac7fdaf8052d25eba766fe88181b2d6a7d3b649b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|