Selaa lähdekoodia

docs: Update README

Michael 11 kuukautta sitten
vanhempi
commit
e88cc68c7e
1 muutettua tiedostoa jossa 105 lisäystä ja 1 poistoa
  1. 105
    1
      README.md

+ 105
- 1
README.md Näytä tiedosto

@@ -1,3 +1,107 @@
1 1
 # PDF Processing Server
2 2
 
3
-FastAPI server for online PDF processing.
3
+FastAPI server for online PDF processing.
4
+
5
+## Table of Contents
6
+
7
+- [Introduction](#introduction)
8
+- [Installation](#installation)
9
+- [Configuration](#configuration)
10
+- [Running the Server](#running-the-server)
11
+- [API Endpoints](#api-endpoints)
12
+  - [Extraction Endpoint](#extraction-endpoint)
13
+  - [Replacement Endpoint](#replacement-endpoint)
14
+- [License](#license)
15
+
16
+## Introduction
17
+
18
+PDF Processing Server is a FastAPI-based server designed for online PDF processing. It provides endpoints for extracting text from PDF files and replacing content within PDF files. This project is developed and maintained by Gleematic Pte. Ltd.
19
+
20
+## Installation
21
+
22
+1. Clone the repository:
23
+    ```sh
24
+    git clone <repository-url>
25
+    cd PDF-Processing-Server
26
+    ```
27
+
28
+2. Create a virtual environment and activate it:
29
+    ```sh
30
+    python -m venv venv
31
+    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
32
+    ```
33
+
34
+3. Install the dependencies:
35
+    ```sh
36
+    pip install -r requirements.txt
37
+    ```
38
+
39
+## Configuration
40
+
41
+1. Copy the [.env.example](.env.example) file to [.env](.env):
42
+    ```sh
43
+    cp .env.example .env
44
+    ```
45
+
46
+2. Edit the [.env](.env) file to set your configuration values:
47
+    ```env
48
+    BASE_DIR=/path/to/base/dir
49
+    API_KEY=your_api_key
50
+    ```
51
+
52
+## Running the Server
53
+
54
+1. Start the FastAPI server:
55
+    ```sh
56
+    uvicorn app.main:app --reload
57
+    ```
58
+
59
+2. The server will be running at `http://127.0.0.1:8000`.
60
+
61
+## API Endpoints
62
+
63
+### Extraction Endpoint
64
+
65
+- **URL:** `/extraction`
66
+- **Method:** `POST`
67
+- **Request Body:**
68
+    ```json
69
+    {
70
+        "pdf_zip": "base64_encoded_zip_file"
71
+    }
72
+    ```
73
+- **Response:**
74
+    ```json
75
+    {
76
+        "status": "success",
77
+        "data": "base64_encoded_extracted_texts"
78
+    }
79
+    ```
80
+
81
+### Replacement Endpoint
82
+
83
+- **URL:** `/replacement`
84
+- **Method:** `POST`
85
+- **Request Body:**
86
+    ```json
87
+    {
88
+        "pdf_zip": "base64_encoded_zip_file",
89
+        "replacement_data": "base64_encoded_json_string",
90
+        "preserve_original_fonts": true
91
+    }
92
+    ```
93
+- **Response:**
94
+    ```json
95
+    {
96
+        "status": "success",
97
+        "data": "base64_encoded_output_zip"
98
+    }
99
+    ```
100
+
101
+## License
102
+
103
+This project is licensed under the AGPL License due to its dependency on [PyMuPDF](https://github.com/pymupdf/PyMuPDF), which is licensed under AGPL. For more details, see the [AGPL-3.0 License](https://www.gnu.org/licenses/agpl-3.0.html).
104
+
105
+---
106
+
107
+Developed and maintained by [Gleematic Pte. Ltd.](https://www.gleematic.com)