Download src/utils/config.py from fokan/pdf-4: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/spaces/fokan/pdf-4/resolve/main/src/utils/config.py
- Command line
-
hf download hf://spaces/fokan/pdf-4/src/utils/config.py
-
curl -L -o config.py https://huggingface.co/spaces/fokan/pdf-4/resolve/main/src/utils/config.py
1.15 kB
| #!/usr/bin/env python3 | |
| """ | |
| Configuration module for the DOCX to PDF converter | |
| """ | |
| import os | |
| from typing import List | |
| class Config: | |
| """Application configuration""" | |
| # File handling | |
| MAX_FILE_SIZE = int(os.environ.get("MAX_FILE_SIZE", 50 * 1024 * 1024)) # 50MB default | |
| SUPPORTED_MIME_TYPES: List[str] = [ | |
| "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | |
| ] | |
| ALLOWED_EXTENSIONS: List[str] = [".docx"] | |
| # Conversion settings | |
| MAX_CONVERSION_TIME = int(os.environ.get("MAX_CONVERSION_TIME", 120)) # 2 minutes | |
| TEMP_DIR = os.environ.get("TEMP_DIR", "/tmp/conversions") | |
| # API settings | |
| API_TITLE = "Enhanced DOCX to PDF Converter" | |
| API_DESCRIPTION = "Professional API for converting DOCX files to PDF with perfect formatting preservation" | |
| API_VERSION = "2.0.0" | |
| # CORS settings | |
| CORS_ORIGINS = os.environ.get("CORS_ORIGINS", "*").split(",") | |
| CORS_CREDENTIALS = os.environ.get("CORS_CREDENTIALS", "true").lower() == "true" | |
| CORS_METHODS = os.environ.get("CORS_METHODS", "*").split(",") | |
| CORS_HEADERS = os.environ.get("CORS_HEADERS", "*").split(",") |