Git Product home page Git Product logo

mdfy's Introduction

mdfy

mdfy is a FastAPI-based web service that converts various document formats to Markdown.

This repository contains the source code for the PDF to Markdown conversion service, which uses code from the RAG project.

Features

  • Convert PDF, DOCX, XLSX, PPTX, HWP, OXPS, EPUB, and MOBI files to Markdown
  • Process files from URLs or direct uploads
  • Redis caching for improved performance
  • OAuth2 authentication for secure access

Prerequisites

  • Python 3.11+
  • Poetry
  • Redis server
  • Docker (optional)

Installation

  1. Clone the repository:
git clone https://github.com/jaigouk/mdfy.git
cd mdfy
  1. Create a virtual environment and activate it:
conda create -n mdfy python=3.11
conda activate mdfy
  1. Install the required packages:
poetry install
  1. Copy the .env.example file to .env and fill in the required values:
cp .env.example .env

Running the server

Local development

poetry run uvicorn mdfy:app --reload

The server will be available at http://127.0.0.1:8000.

Production (using Docker)

  1. Build the Docker image:
docker build -t mdfy .
  1. Run the container:
docker run -p 8000:8000 --env-file .env mdfy

The server will be available at http://localhost:8000.

API Endpoints

  • GET /: Welcome message
  • GET /health: Health check endpoint
  • POST /process_url/: Convert a document from a URL to Markdown
  • POST /process_upload/: Convert an uploaded document to Markdown

FastAPI automatically generates interactive API documentation:

  • Swagger UI: http://127.0.0.1:8000/docs
  • ReDoc: http://127.0.0.1:8000/redoc

You can use these interfaces to explore and test the API endpoints.

OpenAPI Specification

The OpenAPI (Swagger) specification is available at: http://127.0.0.1:8000/openapi.json

Running Tests

poetry run pytest

License

This project is licensed under the GNU AGPL v3.0 License - see the LICENSE file for details.

mdfy's People

Contributors

jaigouk 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.