<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hamza Chishty</title>
    <description>The latest articles on DEV Community by Hamza Chishty (@hamza_chishty_2c78e3ebc98).</description>
    <link>https://dev.to/hamza_chishty_2c78e3ebc98</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4283503%2F8cf31cf7-fbf8-4cf6-b4d6-801dd4377561.png</url>
      <title>DEV Community: Hamza Chishty</title>
      <link>https://dev.to/hamza_chishty_2c78e3ebc98</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hamza_chishty_2c78e3ebc98"/>
    <language>en</language>
    <item>
      <title>Read one field from a RIDA dataset with Python and Node.js</title>
      <dc:creator>Hamza Chishty</dc:creator>
      <pubDate>Fri, 04 Dec 2026 20:11:04 +0000</pubDate>
      <link>https://dev.to/hamza_chishty_2c78e3ebc98/read-one-field-from-a-rida-dataset-with-python-and-nodejs-11me</link>
      <guid>https://dev.to/hamza_chishty_2c78e3ebc98/read-one-field-from-a-rida-dataset-with-python-and-nodejs-11me</guid>
      <description>&lt;p&gt;I used AI assistance to draft this tutorial. I’m sharing RIDA as its maker.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Build a tiny dataset
&lt;/h2&gt;

&lt;p&gt;Use Python 3.10 or later and Node.js 20 or later. In a fresh directory, save this as &lt;code&gt;records.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"entry-1"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"arabic"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"كتاب"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"urdu"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"کتاب"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"category"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"glossary"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 -m venv .venv
&lt;span class="nb"&gt;source&lt;/span&gt; .venv/bin/activate
python -m pip install rida-format==3.0.2
rida build records.json Demo.rida --yes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep &lt;code&gt;Demo.rida&lt;/code&gt; and its companion index together. The build writes a dataset to disk. Use a fresh output name for another build.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Read just the Urdu value in Python
&lt;/h2&gt;

&lt;p&gt;Save this as &lt;code&gt;read_demo.py&lt;/code&gt; and run &lt;code&gt;python read_demo.py&lt;/code&gt; from the same directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;rida&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;RidaFile&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;RidaFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Demo.rida"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;dataset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dataset&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"entry-1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"urdu"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;h2&gt;
  
  
  3. Open the Python-built file in Node.js
&lt;/h2&gt;

&lt;p&gt;Install the Node reader with &lt;code&gt;npm install rida-format@3.0.2&lt;/code&gt;. Save the following as &lt;code&gt;read_demo.mjs&lt;/code&gt;, then run &lt;code&gt;node read_demo.mjs&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;RidaReader&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"rida-format"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;reader&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;RidaReader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"./Demo.rida"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"entry-1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"urdu"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;finally&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;reader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the same &lt;code&gt;کتاب&lt;/code&gt;. Both programs read the same data and index. There is no second build or intermediate JSON export.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changes when the data is hosted?
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/Qasraf/rida" rel="noopener noreferrer"&gt;RIDA repository&lt;/a&gt; has a larger public sample and the &lt;a href="https://github.com/Qasraf/rida/blob/main/docs/PYTHON.md" rel="noopener noreferrer"&gt;Python&lt;/a&gt; and &lt;a href="https://github.com/Qasraf/rida/blob/main/docs/NODE.md" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; guides. I wrote more about the bilingual archive that prompted this example in &lt;a href="https://medium.com/@chishty_50304/rida-by-qasra-and-the-case-for-reading-one-record-at-a-time-1b2521a175cc" rel="noopener noreferrer"&gt;RIDA by QASRA on Medium&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>node</category>
      <category>programming</category>
      <category>python</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
