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

> Source: <https://dev.to/hamza_chishty_2c78e3ebc98/read-one-field-from-a-rida-dataset-with-python-and-nodejs-11me>
> Published: 2026-12-04 20:11:04+00:00

**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 the playbook "Retrieval and RAG": <https://wpnews.pro/playbooks/rag-retrieval>

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.

``` python
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`.

``` js
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](https://github.com/Qasraf/rida) has a larger public sample and the [Python](https://github.com/Qasraf/rida/blob/main/docs/PYTHON.md) and [Node.js](https://github.com/Qasraf/rida/blob/main/docs/NODE.md) guides. I wrote more about the bilingual archive that prompted this example in [RIDA by QASRA on Medium](https://medium.com/@chishty_50304/rida-by-qasra-and-the-case-for-reading-one-record-at-a-time-1b2521a175cc).
