Skip to main content

Export a Python project into a single Markdown file.

Project description

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

  • --root Root directory of the project (default: current directory)
  • --output Output Markdown file (default: project_export.md)
  • --title Title for the Markdown document
  • --include-exts Comma-separated list of file extensions to include (default: .py,.md)
  • --exclude-dirs Comma-separated list of directory names to exclude
  • --exclude-filesComma-separated list of file names to exclude
  • --use-gitignoreRespect .gitignore files in the export
  • --all-files Include all files, not just tracked files
  • --max-bytes Maximum size of files to include (default: 10,000,000)
  • --max-lines Maximum number of lines to include per file (0 = unlimited)
  • --tree-from-files Build 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, --input Input markdown file containing the project source (required)
  • -o, --output Output directory to recreate the project in (default: 'recreated_project')
  • --overwrite Allow 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

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

project_to_markdown-0.1.8.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

project_to_markdown-0.1.8-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file project_to_markdown-0.1.8.tar.gz.

File metadata

  • Download URL: project_to_markdown-0.1.8.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for project_to_markdown-0.1.8.tar.gz
Algorithm Hash digest
SHA256 199aaee80e4f3f5e2ff8bb6736da9ba081b71112b3e78cc87c9595bed201796e
MD5 9fd9f273e4c4aa2baa2229e871e400cb
BLAKE2b-256 62a39cfc56b51ec5e3a67c7b7f4702603f6c8fdbdd8aaaafc0fb89a29cf2fb87

See more details on using hashes here.

File details

Details for the file project_to_markdown-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for project_to_markdown-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 24c2ee3c3d491dd995fc6f5c78da9e3771ae1b76f5f388f8deb019ef888b3d4b
MD5 3395d5b546812b8961fe20de82b5fba9
BLAKE2b-256 e3b8c673d9f4625981944bc36c6b3ba611cdf03a0394cf21e86941a5dffbefd6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page