{"id":26078374,"url":"https://github.com/and3sil4/documents-classifier","last_synced_at":"2026-04-23T09:36:35.855Z","repository":{"id":278251098,"uuid":"934865089","full_name":"AND3SIL4/documents-classifier","owner":"AND3SIL4","description":"Repository for store the model in Python for classify the document types","archived":false,"fork":false,"pushed_at":"2025-02-18T20:11:19.000Z","size":262,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-18T20:24:09.133Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AND3SIL4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-18T14:28:41.000Z","updated_at":"2025-02-18T20:11:23.000Z","dependencies_parsed_at":"2025-02-18T20:24:17.524Z","dependency_job_id":"c18fb2a9-6c0e-4f94-9c52-d4b061a65479","html_url":"https://github.com/AND3SIL4/documents-classifier","commit_stats":null,"previous_names":["and3sil4/documents-classifier"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AND3SIL4%2Fdocuments-classifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AND3SIL4%2Fdocuments-classifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AND3SIL4%2Fdocuments-classifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AND3SIL4%2Fdocuments-classifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AND3SIL4","download_url":"https://codeload.github.com/AND3SIL4/documents-classifier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242640899,"owners_count":20162054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-09T03:59:10.531Z","updated_at":"2026-04-23T09:36:35.826Z","avatar_url":"https://github.com/AND3SIL4.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Document Classifier API\n\n![document-classifier](./images/document-classifier.png)\n\n## Índice\n\n1. [Descripción del proyecto](#descripción-del-proyecto)\n2. [Requisitos](#requisitos)\n3. [Instalación](#instalación)\n4. [Uso de la API](#uso-de-la-api)\n   - [Clasificar documentos](#clasificar-documentos)\n   - [Descargar archivos clasificados](#descargar-archivos-clasificados)\n5. [Estructura del proyecto](#estructura-del-proyecto)\n6. [Ejemplos de uso](#ejemplos-de-uso)\n7. [Contribución](#contribución)\n8. [Licencia](#licencia)\n\n---\n\n## Descripción del proyecto\n\nEste proyecto es una API construida con **FastAPI** y **Astro** en una arqutectura de monorepo multipaquete usando **NX** que permite clasificar documentos (PDF e imágenes) en categorías predefinidas utilizando un modelo de machine learning llamado RandomForest. Los documentos se procesan, clasifican y organizan en carpetas según su categoría. Luego, el usuario puede descargar los archivos clasificados en un archivo ZIP.\n\n---\n\n## Requisitos\n\nPara ejecutar este proyecto, necesitas:\n\n- Python 3.13 o superior.\n- Las siguientes bibliotecas de Python:\n  - `fastapi`\n  - `uv` package manager\n  - `uvicorn`\n  - `pytesseract`\n  - `pymupdf` (fitz)\n  - `scikit-learn`\n  - `numpy`\n  - `pydantic`\n  - `python-multipart`\n\nPuedes instalar las dependencias usando el archivo `pyproject.toml`:\n\n```bash\nuv sync\n```\n\n---\n\n## Instalación\n\n```bash\ngit clone https://github.com/AND3SIL4/documents-classifier.git ./document-classifier\ncd document-classifier\nnpm start\n```\n\n## Entorno backend (fastapi)\nCrear el entorno virtual\n\n```bash\nuv venv # crear entorno virtua\nsource .venv/bin/activate\n```\n\nEjecuta la aplicación:\n\n```bash\nuv run fastapi dev\n```\n\n---\n\n## Uso de la API\n\n### Clasificar documentos\n\nEndpoint:\nMétodo: POST\nURL: /classify\n\nDescripción: Sube un archivo ZIP que contiene documentos (PDF o imágenes) para clasificarlos.\n\nSolicitud:\nBody: form-data\n\nClave: file\n\nValor: Archivo ZIP que contiene los documentos.\n\nRespuesta:\nCódigo de estado: 200 OK\n\nBody:\n\n```json\n{\n  \"message\": \"Classifications completed successfully\",\n  \"request_id\": \"a15d472c-1458-4fdd-9db5-9edbc8061c0a\",\n  \"download_link\": \"/download/a15d472c-1458-4fdd-9db5-9edbc8061c0a\"\n}\n```\n\nEjemplo con curl\n\n```bash\ncurl -X 'POST' \\\n  'http://127.0.0.1:8000/classify' \\\n  -H 'Content-Type: multipart/form-data' \\\n  -F 'file=@/ruta/al/archivo.zip'\n```\n\n### Descargar archivos clasificados\n\nEndpoint:\nMétodo: GET\nURL: /download/{request_id}\n\nDescripción: Descarga un archivo ZIP con los documentos clasificados.\n\nRespuesta:\nCódigo de estado: 200 OK\n\nBody: Archivo ZIP (classified_files.zip).\n\nEjemplo con curl:\n\n```bash\ncurl -X 'GET' \\\n  'http://127.0.0.1:8000/download/a15d472c-1458-4fdd-9db5-9edbc8061c0a' \\\n  --output classified_files.zip\n```\n\n---\n\n## Estructura del proyecto\n\n```txt\ndocument-classifier/\n│\n├── app/\n│   ├── main.py                # Código principal de la API\n│   ├── machine_learning/\n│   │   ├── model.pkl          # Modelo de clasificación\n│   │   └── vectorizer.pkl     # Vectorizador de texto\n│   └── ...\n│\n├── pyproject.toml             # Dependencias y configuración del proyecto\n├── README.md                  # Documentación del proyecto\n└── ...\n```\n\n## Licencia\n\nEste proyecto está bajo la licencia MIT. Para más detalles, consulta el archivo LICENSE.\n\n---\n\n_Created by [Felipe Silva](https://github.com/and3sil4)_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fand3sil4%2Fdocuments-classifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fand3sil4%2Fdocuments-classifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fand3sil4%2Fdocuments-classifier/lists"}