Skip to content

radu985/python-pandoc-fileconver

Repository files navigation

rkit - Dateiformate einfach transformieren

A Flask web application for converting document formats using Pandoc.

Features

  • Upload and convert documents between various formats
  • Supported input formats: DOCX, TXT, HTML, PPTX
  • Supported output formats: GFM (GitHub Flavored Markdown), HTML, DOCX, PDF, TXT
  • Beautiful, modern UI with drag & drop functionality
  • Real-time conversion status updates

Local Development

  1. Install dependencies:
pip install -r requirements.txt
  1. Run the application:
python run.py
  1. Open http://localhost:5000 in your browser

Deployment to Vercel

Prerequisites

  1. Install Vercel CLI:
npm i -g vercel
  1. Make sure you have a Vercel account at vercel.com

Deployment Steps

  1. Login to Vercel (if not already logged in):
vercel login
  1. Deploy the project:
vercel
  1. Follow the prompts:

    • Link to existing project? → No
    • Project name → rkit-file-converter (or your preferred name)
    • Directory → ./ (current directory)
    • Override settings? → No
  2. Set up environment variables (optional):

vercel env add FLASK_ENV production
  1. Deploy to production:
vercel --prod

Important Notes for Vercel Deployment

⚠️ Limitations:

  • Vercel's serverless functions have a 10-second timeout limit
  • File processing is limited to 50MB
  • Pandoc may not be available in the Vercel environment

Alternative Deployment Options

For production use with file conversion capabilities, consider:

  1. Heroku - Supports Pandoc and longer processing times
  2. DigitalOcean App Platform - Good for Python applications
  3. AWS Lambda - Serverless with custom runtime for Pandoc
  4. Google Cloud Run - Container-based deployment

Project Structure

task/
├── app/
│   ├── __init__.py          # Flask app factory
│   ├── routes.py            # API routes
│   ├── static/              # Static assets (CSS, JS, images)
│   └── templates/           # HTML templates
├── uploads/                 # Uploaded files (local only)
├── output/                  # Converted files (local only)
├── run.py                   # Application entry point
├── requirements.txt         # Python dependencies
├── vercel.json             # Vercel configuration
└── README.md               # This file

Technologies Used

  • Backend: Flask (Python)
  • Frontend: HTML, CSS, JavaScript
  • Document Conversion: Pandoc
  • Deployment: Vercel

License

This project is open source and available under the MIT License.

Heroku Deployment

Prerequisites

  1. Install Heroku CLI:
heroku login
  1. Make sure you have a Heroku account at heroku.com

Deployment Steps

  1. Create a new Heroku app:
heroku create
  1. Deploy the project:
git push heroku main
  1. Add a buildpack for Pandoc:
heroku buildpacks:add https://github.com/ryandotsmith/buildpack-pandas

Important Notes for Heroku Deployment

⚠️ Limitations:

  • Heroku's dyno instances have limited storage and processing power
  • File processing is limited to 50MB
  • Pandoc may not be available in the Heroku environment

Alternative Deployment Options

For production use with file conversion capabilities, consider:

  1. DigitalOcean App Platform - Good for Python applications
  2. Google Cloud Run - Container-based deployment
  3. AWS EC2 or Lightsail - Full server for Pandoc and Flask

Project Structure

task/
├── app/
│   ├── __init__.py          # Flask app factory
│   ├── routes.py            # API routes
│   ├── static/              # Static assets (CSS, JS, images)
│   └── templates/           # HTML templates
├── uploads/                 # Uploaded files (local only)
├── output/                  # Converted files (local only)
├── run.py                   # Application entry point
├── requirements.txt         # Python dependencies
├── vercel.json             # Vercel configuration
└── README.md               # This file

Technologies Used

  • Backend: Flask (Python)
  • Frontend: HTML, CSS, JavaScript
  • Document Conversion: Pandoc
  • Deployment: Heroku

License

This project is open source and available under the MIT License.

Procfile

web: gunicorn run:app