Coder Social home page Coder Social logo

siddhant-vij / email-based-file-conversion-service Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 6 KB

Email-Based File Conversion Service from DOCX to PDF. Can be extended for other file formats.

License: MIT License

Python 100.00%
email file-conversion file-formats imaplib python smptlib

email-based-file-conversion-service's Introduction

Email-Based File Conversion Service

This service allows users to convert documents between different formats via email. Users send an email with the subject line indicating the desired conversion formats (e.g., "[DOCX] to [PDF]") and the document as an attachment. The service processes the request and sends back the converted file.

Table of Contents

  1. Features
  2. Installation
  3. Configuration
  4. Usage
  5. Security
  6. Contributing
  7. Future Enhancements
  8. License

Features

  • Parses email subject lines to determine the requested file conversion formats.
  • Converts DOCX files to PDF (with scope for adding more formats).
  • Handles invalid subject lines and unsupported conversion requests with informative failure emails.
  • Command-line interface for local testing.

Installation

  1. Ensure Python 3.x is installed.
  2. Clone this repository.
  3. Install dependencies: pip install -r requirements.txt.

Configuration

Create a .env file in the project root with the following contents:

  • EMAIL_USER: Your email username.
  • EMAIL_PASSWORD: Your email password.
  • IMAP_SERVER: IMAP server address (e.g., imap.gmail.com).
  • SMTP_SERVER: SMTP server address (e.g., smtp.gmail.com).

Usage

  • Create a temp directory in the project root.
  • Copy the .env copy file to the .env file & edit with your own details.
  • Run the server with file conversion service using python src/main.py.
  • Send an email to the configured email address with the subject line formatted as "[Format-1] to [Format-2]" and include the file to be converted as an attachment.

Security

  • The .env file is not committed to version control to keep credentials secure - only the template file is.
  • Proper validation and error handling are in place to prevent misuse.

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch:
    git checkout -b feature/AmazingFeature
  3. Commit your Changes:
    git commit -m 'Add some AmazingFeature'
  4. Push to the Branch:
    git push origin feature/AmazingFeature
  5. Open a Pull Request

Future Enhancements

  • Extend the service to support additional file format conversions.
  • Improve error handling and user feedback mechanisms.

License

Distributed under the MIT License. See LICENSE for more information.

email-based-file-conversion-service's People

Contributors

siddhant-vij avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.