cd /news/developer-tools/read-one-field-from-a-rida-dataset-w… · home › topics › developer-tools › article
[ARTICLE · art-182039] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Read one field from a RIDA dataset with Python and Node.js

The maker of RIDA published a tutorial showing how to read a single field from a RIDA dataset by record ID in both Python and Node.js, using the rida-format 3.0.2 package. The example builds a small bilingual Arabic-Urdu records file into a Demo.rida dataset with a companion index, then retrieves the Urdu value for entry-1 via RidaFile.get in Python and RidaReader.get in Node.js, with no second build or JSON export. The author notes the index also supports HTTP byte-range retrieval for remote reads, provided the host supports byte ranges and the reader has the companion index.

recommendation

For prepared, read-heavy collections where the record ID is already known, build a RIDA index and fetch only the needed fields instead of loading whole records; keep the companion index with the dataset and confirm byte-range support before remote reads.

more in playbook: Retrieval and RAG
by read2 min views5 publishedDec 4, 2026

I used AI assistance to draft this tutorial. I’m sharing RIDA as its maker.

A bilingual archive gives you a simple reason to read a record one field at a time. When you want the Urdu translation, there is no reason to send the Arabic text and every note along with it. RIDA builds an index over prepared records so a reader can look up a field by record ID. Here is a small example you can reproduce with the same file in Python and Node.js.

Use Python 3.10 or later and Node.js 20 or later. In a fresh directory, save this as records.json:

{
  "entry-1": {
    "arabic": "كتاب",
    "urdu": "کتاب",
    "category": "glossary"
  }
}
python3 -m venv .venv
source .venv/bin/activate
python -m pip install rida-format==3.0.2
rida build records.json Demo.rida --yes

Keep Demo.rida and its companion index together. The build writes a dataset to disk. Use a fresh output name for another build.

Save this as read_demo.py and run python read_demo.py from the same directory.

from rida import RidaFile

with RidaFile("Demo.rida") as dataset:
    print(dataset.get("entry-1", "urdu"))

Expected output is کتاب. You can fetch both values in one call with dataset.get_many("entry-1", ["arabic", "urdu"]) inside the with block.

Install the Node reader with npm install rida-format@3.0.2. Save the following as read_demo.mjs, then run node read_demo.mjs.

import { RidaReader } from "rida-format";

const reader = await RidaReader.open("./Demo.rida");
try {
  console.log(await reader.get("entry-1", "urdu"));
} finally {
  await reader.close();
}

You should see the same کتاب. Both programs read the same data and index. There is no second build or intermediate JSON export.

The lookup still starts with a record ID and a field name. The index lets the reader find the stored value, then the remote reader can use HTTP byte-range requests to retrieve the relevant bytes. Your host needs to support byte ranges, and your reader needs the companion index. Check the remote setup in the guides before deploying. If you enable encryption on a real dataset, provide its key when reading and keep it separate from public files.

This approach fits prepared, read-heavy collections where your app already knows the record ID. Full-text search is a separate job. For a catalogue, one practical setup is to find an ID in the search layer and use that ID to fetch its display fields from RIDA.

The RIDA repository has a larger public sample and the Python and Node.js guides. I wrote more about the bilingual archive that prompted this example in RIDA by QASRA on Medium.

── more in #developer-tools 4 stories · sorted by recency
── more on @rida 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/read-one-field-from-…] indexed:0 read:2min 2026-12-04 · —