Skip to contents

A read-only R interface to the SQLite databases generated by the EntropIA desktop application. Built in a tidyverse style: explore your full document corpus — items, transcriptions, entities, LLM analysis, searches — without writing a single line of SQL.

Every access is lazy (tbl_sql via dbplyr), typed on materialisation (timestamps to POSIXct, JSON to list-columns) and backed by schema compatibility checks against the live database. And by design: the database is opened read-only, never modified.

Features

  • Lazy access to 18 tables: entropia_items(), entropia_entities(), entropia_transcriptions(), entropia_llm_results(), and more. Compose with dplyr verbs and materialise with entropia_collect().
  • Typed materialisation: timestamp columns to POSIXct (automatic milliseconds/seconds handling) and JSON columns to list-columns.
  • Full-text search (FTS5), parameter-safe: entropia_search().
  • Domain layer: unified corpus with the best available text, parsed metadata and text-extraction helpers.
  • Corpus diagnostics: OCR/metadata coverage, orphaned-reference detection and connection validation.
  • Ready-made analysis: temporal profiles, document lengths, entity and topic frequencies, collection comparison, and reproducible datasets with provenance.
  • Visualisation with ggplot2 (entropia_plot_*) and reproducible export to CSV, TSV, JSON, RDS, Parquet or Arrow, with provenance sidecars.

Installation

remotes::install_github("HumaLab/EntropIA-R")

Requires R >= 4.1.

Quick start

library(entropiaR)

# The package ships a small example database so you can try it right away.
con <- entropia_connect(system.file("extdata", "entropia-example.sqlite",
                                    package = "entropiaR"))

entropia_items(con)                          # lazy tbl_sql: nothing loaded yet
entropia_collect(entropia_items(con))        # typed tibble: POSIXct + JSON list-columns
entropia_search(con, "huelga")               # parameter-safe full-text search (FTS5)
entropia_corpus(con) |> entropia_collect() |> entropia_document_lengths()

entropia_disconnect(con)

Connect your own database

If you use the EntropIA application, connect the database it generates the same way:

con <- entropia_connect("path/to/your/entropia.sqlite")

The connection is read-only and runs a schema-compatibility check against the live database on open (controlled with options(entropiaR.schema_policy = "warn" | "error" | "allow")).

Documentation

Project status

Early development. The current release (v1) is read-only: it opens the database for querying and never writes to it. The write API is already designed and available as stubs with clear errors; its full implementation arrives in v2.

License

MIT.


Spanish version