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:
-
Navigate to the project root directory.
-
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. -
Commit the changes:
git add doc2markdown/__init__.py git commit -m "Bump version to x.y.z"
-
Tag the new version:
git tag -a vx.y.z -m "Version x.y.z"
-
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
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
Hashes for doc2markdown-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1621696dec3edf792422a5272b340bb2d6bfa302c244ed1c16f665c28807e424 |
|
MD5 | ea35158230c3042f89c5f261f429927c |
|
BLAKE2b-256 | a4191fd61b9a48bf4772746abc18f3146279197a1ef35e4348009c6a024ba601 |