Skip to main content

Extralit
Extralit Server

Extract structured data from scientific literature with human validation

CI Codecov Downloads

This repository contains developer information about the backend server components. For general usage, please refer to our main repository or our documentation.

Source Code Structure

The server components are split into two main services:

/extralit_server
  /api # Core extraction API endpoints
    /handlers # FastAPI request handlers
    /schemas # Data models and validation
    /services # Business logic services
    /utils # Helper utilities
  /ml # Machine learning components
    /extractors # Document extraction models
    /ocr # OCR processing
    /pipeline # Extraction pipeline orchestration
  /storage # Data persistence layer
    /models # Database models
    /search # Search engine integration
    /vector # Vector store
/extralit_server
  /api # Annotation UI API endpoints
    /handlers
    /schemas
  /models # Database models
  /auth # Authentication
  /tasks # Background jobs

Development Environment

The development environment uses Docker Compose to run all required services. Key commands:

# Start all services
docker-compose up -d

# Install dependencies
uv sync --dev

# Run server in dev mode
uv run uvicorn extralit_server:app --host 0.0.0.0 --port 6900 --reload

# Run tests
uv run pytest tests

# Format and lint
uv run ruff format
uv run ruff check

Key Components

FastAPI Servers

  • Extraction Server: Handles document processing, extraction pipeline, and ML model serving
  • Annotation Server: Manages UI, data validation workflow, and user collaboration

Databases

  • PostgreSQL: Main database for user data, annotations, and metadata
  • Elasticsearch: Vector store for semantic search and document indexing
  • Weaviate: Vector database for table and section embeddings

Background Processing

Uses Celery for asynchronous tasks like:

  • Document OCR and preprocessing
  • ML model inference
  • Batch extraction jobs
  • Data export

CLI Commands

Key management commands:

# Database management
python -m extralit_server db migrate
python -m extralit_server db create-user

# Start servers
python -m extralit_server start
python -m extralit_server start

# Run workers
python -m extralit_server worker

See full CLI documentation in our developer docs.

Running Tests

The pytest suite is primarily designed to run in the CI environment using GitHub Actions as defined in .github/workflows/extralit-server.yml. This workflow sets up the necessary dependencies including Elasticsearch, PostgreSQL, Redis, and Minio.

Note that some tests are specifically skipped when running locally due to differences between the CI environment and local development environments. These tests may involve:

  • Search engine dynamics (Elasticsearch/OpenSearch compatibility)
  • File storage operations with Minio
  • Authentication and permission checks

To run tests in CI, create a pull request to trigger the test workflow.

If you need to run a specific test locally for debugging purposes, you can use:

cd extralit-server
python -m pytest [test_path] -v

However, expect some tests to fail or be skipped when running locally.

Contributing

Check our contribution guide and join our Slack community.

Roadmap

See our development roadmap and share your ideas!

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

extralit_server-0.7.1.tar.gz (15.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

extralit_server-0.7.1-py3-none-any.whl (14.6 MB view details)

Uploaded Python 3

File details

Details for the file extralit_server-0.7.1.tar.gz.

File metadata

  • Download URL: extralit_server-0.7.1.tar.gz
  • Upload date:
  • Size: 15.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for extralit_server-0.7.1.tar.gz
Algorithm Hash digest
SHA256 45eb6767ec3f6684b6e973de31655ca8d4385384efa2fa3551064ceb38222d6e
MD5 0eb3e31232f66d675359894b536d3b79
BLAKE2b-256 76df9f0fe7ced22fdf242c538b1773ee6ef7c1e154b6b63cfc7f489767ef026c

See more details on using hashes here.

File details

Details for the file extralit_server-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: extralit_server-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 14.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for extralit_server-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 605cad6483071c5267d4228efef5cc2b2e9c40c7b4685dc29c545cbde90ae9ad
MD5 4b2b8ccc7d45af1e5f3f8188c0aa5441
BLAKE2b-256 6f68a1b72c3e3c8c35e2ff186ed3b6980df5c48c48ad0191875974486db0cb51

See more details on using hashes here.

Release history Release notifications | RSS feed

0.7.2

2 files

This release

0.7.1 This release

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

0.4.0

2 files

0.2.1

2 files

0.2.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page