# thrift API reference

> The `thrift` package, from thrift 0.1.3, as published on mojoshelf (commit 21cdbce67d22), by `mojo doc` from Mojo 1.2.0.

## Modules

- [thrift.parquet_footer](https://magmalake.dev/s/thrift/api/parquet_footer.md): Locating and decoding the Parquet footer and page headers.
- [thrift.parquet_types](https://magmalake.dev/s/thrift/api/parquet_types.md): The Apache Parquet metadata schema as Mojo structs.
- [thrift.protocol](https://magmalake.dev/s/thrift/api/protocol.md): Apache Thrift wire protocols in pure Mojo — serialization only, no RPC.

`thrift.mojo` — Apache Thrift *serialization* in pure Mojo.

Part of magmalake: data lake building blocks in Mojo.

No RPC, no IDL compiler at run time — just the two wire protocols that matter
for reading columnar files, plus hand-checkable Mojo structs for the Apache
Parquet metadata schema.

```mojo
from thrift import TCompactProtocolReader, T_STOP

var r = TCompactProtocolReader(Span(footer_bytes))
r.read_struct_begin()
while True:
    var head = r.read_field_begin()
    if head[0] == T_STOP:
        break
    r.skip(head[0])
    r.read_field_end()
r.read_struct_end()
```

Everything here is dependency-free: the standard library and nothing else.
