File2Markdown is a simple and lightweight Python program that converts files into Markdown format using Microsoft's MarkItDown library. This tool is currently focused on scanning and converting local files, making it ideal for desktop use.
- Convert local files (e.g., PDFs, Word documents, Excel spreadsheets) to Markdown.
- Simple command-line interface for ease of use.
- Outputs Markdown content either to the console or to a specified
.md
file.
Note: This tool does not yet utilize advanced features like GPT integration for additional processing. It focuses solely on converting local files to Markdown.
- Python 3.7 or later
pip
package manager
-
Clone this repository:
git clone https://github.com/mthomason/File2Markdown cd File2Markdown
-
Create and activate an virtual environment (recommended)
# On Windows: python -m venv venv venv\\Scripts\\activate # On macOS/Linux: python3 -m venv venv source venv/bin/activate
-
Install the dependencies:
pip install -r requirements.txt
Run the program using the following command:
python src/md.py --file path/to/your/input-file.pdf
python src/md.py --file path/to/your/input-file.pdf --output path/to/output.md
Convert a PDF file and save the Markdown content:
python src/md.py --file sample.pdf --output sample.md
The above command will save the converted content in sample.md
.
File2Markdown/
├── .gitignore # Files and directories to be ignored by Git
├── .vscode/settings.json # VSCode configuration files
├── LICENSE # MIT license file
├── requirements.txt # Python dependencies for the project
├── src/
│ ├── __init__.py # Placeholder for Python package
│ └── md.py # Main script for file conversion
We welcome contributions to improve and expand the functionality of File2Markdown. Here are some ideas:
- Add support for processing files via URLs.
- Integrate GPT capabilities to provide richer context or descriptions for the content.
- Add unit tests and improve code coverage.
To contribute:
- Fork this repository.
- Create a new branch for your feature/bugfix.
- Submit a pull request with a detailed description of your changes.
This project is licensed under the MIT License. See the LICENSE file for details.
If you encounter any issues or have suggestions for improvements, feel free to open an issue on GitHub. We value your feedback and ideas to make File2Markdown better!
Enjoy converting files to Markdown effortlessly with File2Markdown!