cadilib
cadilib is a high-performance Python and Rust library designed for parsing, processing, and analyzing Canadian Advanced Digital Ionosonde (CADI) binary data (.md1, .md2, .md3, .md4) and SAMEER ionogram ASCII data (.iono) in India.
Originally a part of CADI Ionogram Tools, the CADI parsing library is now separate from the GUI.
Features
- High-Performance Rust Reader (
MDreader_rs): Accelerated binary parser compiled as a native PyO3 extension module for maximum throughput. - Pure-Python Fallback Reader (
MDreader): Complete pure-Python reader for CADI MDx binary formats without requiring native compilation. - SAMEER ASCII Reader (
SameerReader): Robust parser for SAMEER.ionoASCII format ionograms. - DataFrame Interoperability: First-class conversion to both Pandas and Polars DataFrames with structured time partitioning.
- Ionogram Signal Processing & Filtering: Built-in noise reduction, Doppler filtering, O/X mode separation, and k-vector estimation.
- Site Metadata & Timezone Support: Configurable site parameters and local/universal time (UT/LT) coordinate calculations via
sites.json.
Todo
- MacOS builds in PyPI
Installation
From PyPI
pip install cadilib
Or using uv:
uv add cadilib
From Source
git clone https://github.com/Rally0078/cadilib.git
cd cadilib
uv sync
Manually generate stubs (warning: overwrites the handwritten Rust module stub)
uv run stubgen --include-docstrings -p cadilib -o stubs
Quick Start
1. Parsing CADI Binary Files (.mdX)
You can read CADI binary files using either the Rust-accelerated parser or the pure-Python reader:
from pathlib import Path
from cadilib import MDreader, MDreader_rs
file_path = Path("data/sample.md4")
# Fast Rust reader (recommended)
if MDreader_rs is not None:
cadi_data = MDreader_rs.read_raw_data(file_path)
else:
# Fallback to pure Python reader
cadi_data = MDreader.read_raw_data(file_path)
# Access metadata and data structures
print(f"Site: {cadi_data.metadata.station_name}")
print(f"Number of frequencies: {cadi_data.metadata.nfreqs}")
print(f"Height array shape: {cadi_data.dopbins.height.shape}")
2. Exporting to Pandas or Polars DataFrames
Convert raw CADI or SAMEER ionogram data into structured DataFrames:
from cadilib import MDreader, PandasUtils, PolarsUtils
from pathlib import Path
raw_data = MDreader.read_raw_data(Path("data/sample.md4"))
# Convert to Pandas DataFrames
df_pandas_dop, df_pandas_freq = PandasUtils.create_pandas_from_arrays(
raw_data, radar_type="cadi"
)
# Convert to Polars DataFrames
df_polars_dop, df_polars_freq = PolarsUtils.create_polars_from_arrays(
raw_data, radar_type="cadi"
)
3. Parsing SAMEER ASCII Files (.iono)
from pathlib import Path
from cadilib.ionogramparser import SameerReader
sameer_data = SameerReader.read_raw_data(Path("data/sample.iono"))
print(f"Frequencies scanned: {len(sameer_data.freq_list)}")
Development & Building
Prerequisites
- Python
>= 3.12 - uv
- Rust toolchain (Cargo)
Build Wheel
uv build --wheel
Run Tests
uv run pytest
Metadata
Release files for cadilib 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| cadilib-0.1.1-cp314-cp314-win_amd64.whl | CPython 3.14 | CPython 3.14 | Windows x86-64 | Details for cadilib-0.1.1-cp314-cp314-win_amd64.whl |
| cadilib-0.1.1-cp314-cp314-manylinux_2_28_x86_64.whl | CPython 3.14 | CPython 3.14 | Linux glibc 2.28+ x86-64 | Details for cadilib-0.1.1-cp314-cp314-manylinux_2_28_x86_64.whl |
| cadilib-0.1.1-cp313-cp313-win_amd64.whl | CPython 3.13 | CPython 3.13 | Windows x86-64 | Details for cadilib-0.1.1-cp313-cp313-win_amd64.whl |
| cadilib-0.1.1-cp313-cp313-manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.28+ x86-64 | Details for cadilib-0.1.1-cp313-cp313-manylinux_2_28_x86_64.whl |
| cadilib-0.1.1-cp312-cp312-win_amd64.whl | CPython 3.12 | CPython 3.12 | Windows x86-64 | Details for cadilib-0.1.1-cp312-cp312-win_amd64.whl |
| cadilib-0.1.1-cp312-cp312-manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.28+ x86-64 | Details for cadilib-0.1.1-cp312-cp312-manylinux_2_28_x86_64.whl |
Total release size: 16.6 MB
Release files / cadilib-0.1.1-cp314-cp314-win_amd64.whl
| Download URL | cadilib-0.1.1-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 942.3 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
80d68ed3ff06b7ba8c75a553ee75ee25ba03a2abc8495f8c839bbb08cd027875
|
|
BLAKE2b-256 checksum How to use checksums |
3250aa3acd0a10508af4acf9716a227077a1189ec7ea950f05a0d872a8de3e2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logRelease files / cadilib-0.1.1-cp314-cp314-manylinux_2_28_x86_64.whl
| Download URL | cadilib-0.1.1-cp314-cp314-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.5 MB |
| Tags | CPython 3.14 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
08114f22132b8ed88a4f33fb59fa2c71329e2f661dc33d5a5655310b9f412194
|
|
BLAKE2b-256 checksum How to use checksums |
92f69d75a1c3c997485e4c9708e5581e179e63e0e7e573700e78f34efdf71366
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logRelease files / cadilib-0.1.1-cp313-cp313-win_amd64.whl
| Download URL | cadilib-0.1.1-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 919.4 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f0c7374e909acbd17acbd6c60d07414320d446ca8870bf9f01a886b5e4007d58
|
|
BLAKE2b-256 checksum How to use checksums |
d9a62505c9eeb4ce21cf118e781c521b4af7315afde66018f05748880773c493
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logRelease files / cadilib-0.1.1-cp313-cp313-manylinux_2_28_x86_64.whl
| Download URL | cadilib-0.1.1-cp313-cp313-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.6 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
bc485d940db29de53d4808da4b54cb47515556bc3c830cd7ab9e46703417b381
|
|
BLAKE2b-256 checksum How to use checksums |
aff8b1b2ecbc448298c459a6e57636881c6669fd3b72840450d8ab208b06a30c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logRelease files / cadilib-0.1.1-cp312-cp312-win_amd64.whl
| Download URL | cadilib-0.1.1-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 929.2 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
76d8bdd6a974bfe3f82240182cb19c7c4588a5ae38b1dbc48f36126f881ad483
|
|
BLAKE2b-256 checksum How to use checksums |
cefae6599c56b40b3ed39b301934b5d1f52e34758286744fdd0e3cf21577c78b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logRelease files / cadilib-0.1.1-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | cadilib-0.1.1-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.7 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
ec5332b0e670de097d3048db665ddcf0b6c8f94b47c1afd54f019121006b972f
|
|
BLAKE2b-256 checksum How to use checksums |
3e77bc6d1bebbb61652f3cf3eeca2342c2253399904a8603b12f7a55733cdfde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logSecurity for cadilib 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 6 files in this release have been uploaded with provenance metadata.
Attestation for cadilib-0.1.1-cp314-cp314-win_amd64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.