Skip to main content

A tool to convert various document formats to Markdown

Project description

📄 doc2markdown

doc2markdown is a Python command-line tool that converts various document formats (PDF, PPTX, DOCX) to Markdown. It processes files in a given directory and its subdirectories, maintaining the original folder structure in the output.

✨ Features

  • 📑 Converts PDF, PPTX, and DOCX files to Markdown format
  • 🗂️ Preserves folder structure from input to output
  • 💻 Command-line interface for easy use and integration with other tools
  • 🔍 Verbose mode for detailed processing information

⚙️ Installation

To install doc2markdown, run the following command:

pip install doc2markdown

This will install doc2markdown along with its dependencies.

🚀 Usage

Basic usage:

doc2markdown /path/to/input/file.pdf /path/to/output/folder 
doc2markdown /path/to/input/folder /path/to/output/folder

With verbose output:

doc2markdown /path/to/input/folder /path/to/output/folder -v

For help and more options:

doc2markdown --help

🛠️ Requirements

  • Python 3.6+
  • PyPDF2
  • python-pptx
  • python-docx

These dependencies will be automatically installed when you install doc2markdown using pip.

🚀 Future Improvements

We're constantly working to improve doc2markdown. Here are some features and enhancements we're considering for future releases:

TODO:

  • Implement parallel processing for faster conversion of multiple files
  • Add a progress bar for large batches of file conversions
  • Create a plugin system for easy addition of new file format converters
  • Implement comprehensive unit tests for each converter function
  • Add logging mechanism for better debugging and user feedback
  • Implement input sanitization for enhanced security
  • Add type hints throughout the codebase for improved readability and maintainability
  • Create a CONTRIBUTING.md file with guidelines for contributors

We welcome contributions from the community to help implement these features and improve doc2markdown. If you're interested in working on any of these tasks, please check our issues page or submit a pull request.

📝 Changelog

[0.1.2]

  • Renamed to doc2markdown
  • Added support for encrypted PDFs

[0.1.1]

  • Added File as well as folder support
  • Improved the CLI messaging

[0.1.0]

  • Initial release
  • Basic functionality to convert PDF, PPTX, and DOCX files to Markdown
  • Command-line interface with verbose mode option

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📜 License

This project is licensed under the MIT License.

🙏 Acknowledgements

This tool was inspired by the need for easy conversion of various document formats to Markdown for use with Large Language Models and other text processing applications.

Contributing

Bumping the Version

To bump the version of the project, use the bump_version.py script:

  1. Navigate to the project root directory.

  2. Run the script with the following command:

    python bump_version.py doc2markdown/__init__.py [major|minor|patch]
    

    Replace [major|minor|patch] with the type of version bump you want to perform.

  3. Commit the changes:

    git add doc2markdown/__init__.py
    git commit -m "Bump version to x.y.z"
    
  4. Tag the new version:

    git tag -a vx.y.z -m "Version x.y.z"
    
  5. Push the changes and tags:

    git push origin main
    git push --tags
    

This process will update the version number in the __init__.py file and create a new git tag for the release.

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

doc2markdown-0.1.2.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

doc2markdown-0.1.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file doc2markdown-0.1.2.tar.gz.

File metadata

  • Download URL: doc2markdown-0.1.2.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.6

File hashes

Hashes for doc2markdown-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8d42896d7964870f0ee073ad45bf507d61006984ea93353dbd1e31bf18348147
MD5 76f31a48b66ceaeeda92abaf6ae0b4d7
BLAKE2b-256 22e18f02c5fae5aec6768dcfc31b863117b611b8b08b0323470564cadd725255

See more details on using hashes here.

File details

Details for the file doc2markdown-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: doc2markdown-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.6

File hashes

Hashes for doc2markdown-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1621696dec3edf792422a5272b340bb2d6bfa302c244ed1c16f665c28807e424
MD5 ea35158230c3042f89c5f261f429927c
BLAKE2b-256 a4191fd61b9a48bf4772746abc18f3146279197a1ef35e4348009c6a024ba601

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