- Python 99.8%
- Dockerfile 0.2%
fix(deps): update dependency kimiworker to v8.0.4 See merge request logius/nldoc/worker/pdf-nldocspec!174 |
||
|---|---|---|
| .vscode | ||
| integration_test | ||
| utilities | ||
| .dockerignore | ||
| .editorconfig | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| CHANGELOG.md | ||
| CODEOWNERS | ||
| conftest.py | ||
| docker-compose.yaml | ||
| Dockerfile | ||
| DUPLICATE_CODE_PLAN.md | ||
| LICENSE | ||
| main.py | ||
| poetry.lock | ||
| pyproject.toml | ||
| README.md | ||
| renovate.json | ||
| test_main.py | ||
PDF NLdocSpec Worker
A Python worker that converts PDF document content to NLdocSpec output format. This worker processes PDF structures and transforms them into the standardized NLdocSpec format for further processing in the NLdoc pipeline.
Features
- PDF content transformation to NLdocSpec format
- Content pre-processing and post-processing pipelines
- Support for various PDF elements (paragraphs, headings, lists, tables, figures)
- Integration with RabbitMQ for message queuing
- MinIO support for object storage
- Docker and Kubernetes deployment ready
Getting Started
Local Installation
-
Clone the repository:
git clone https://gitlab.com/logius/nldoc/worker/pdf-nldocspec.git cd pdf-nldocspec -
Install Poetry (dependency management):
curl -sSL https://install.python-poetry.org | python3 - -
Install dependencies:
poetry install -
Install shell plugin:
poetry self add poetry-plugin-shell && poetry self update -
Activate virtual environment:
poetry shell
Running the Worker
Using Docker Compose (Recommended)
-
Ensure Docker and Docker Compose are installed (Installation Guide)
-
Start the services:
docker compose up -
The integration test will run automatically to test PDF to NLdocSpec conversion
-
Access the management interfaces:
- RabbitMQ Console:
http://localhost:15672/ - MinIO Console:
http://localhost:9001/
- RabbitMQ Console:
-
Once the
docker compose upcommand has been exited using Ctrl+C, all containers relative to this instance will have shut down automatically.
Running Directly
To run the worker without Docker:
python3 main.py
For configuration options, refer to the Python base worker config.
Testing and Development
Run tests with pytest:
pytest
Deployment
Docker Images
Pre-built Docker images are available in our container registry.
Run the latest version:
docker run --rm registry.gitlab.com/logius/nldoc/worker/pdf-nldocspec:latest
Documentation
License
This project is licensed under the European Union Public License 1.2 - see LICENSE for details.