title: How to random access avro records in python?
body: <p>I have a set of index/avro file (kb/gb), I use the following program to read it </p>
  
  <pre><code>import avro.schema
  from avro.datafile import DataFileReader
  from avro.io import DatumReader, DatumWriter
  
  schema = avro.schema.Parse(open(r"hmd.avsc", "rb").read())
  reader = DataFileReader(open(r"data", "rb"), DatumReader())
  reader_index = DataFileReader(open(r"index", "rb"), DatumReader())
  </code></pre>
  
  <p>The problem is the reader is very slow, when data is as large as 5gb, it takes around 1 hour to iterate every line into memory, then I want to use multi-thread to speed up the process, the idea is to read the index which is small, and as I have the keys in my hand, I can divide them into 10 parts, then I can speed up the process by doing it concurrently, so is there any python api that can support random access with avro reader?</p>
  
  <p>Edit1:</p>
  
  <p>I do see there is a seek method at 1.2 api version, <a href="https://avro.apache.org/docs/1.2.0/api/py/avro.io.html" rel="nofollow noreferrer">https://avro.apache.org/docs/1.2.0/api/py/avro.io.html</a>, but it seems that it's gone at 1.8.2, is there any other alternative?</p>