Documentation Index
Fetch the complete documentation index at: https://mintlify.com/open-contracting/cardinal-rs/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Cardinal is distributed as a Rust crate and provides Python bindings through PyO3. You can install it using:- Cargo (Rust’s package manager) for the CLI tool and Rust library
- pip (Python’s package manager) for Python bindings
- Building from source for development or the latest features
Cardinal requires OCDS 1.1 data (the version since 2017) formatted as compiled releases in line-delimited JSON files.
Install via Cargo
The recommended way to install Cardinal is using Cargo, Rust’s package manager.Prerequisites
You need Rust and Cargo installed on your system. If you don’t have them:- Linux / macOS
- Windows
Install using rustup:Follow the on-screen instructions, then restart your terminal or run:
Install Cardinal
Install theocdscardinal crate from crates.io:
ocdscardinal command-line tool to your Cargo bin directory (typically ~/.cargo/bin/).
Verify Installation
Check that Cardinal is installed correctly:View Help
Get an overview of available commands:Output
Output
Install Python Bindings
Cardinal provides Python bindings that allow you to use Cardinal as a Python library.Prerequisites
- Python 3.10 or later
- pip (Python’s package manager)
Install via pip
Once available, install using pip:Using Python Bindings
The Python package provides thecoverage() function for analyzing field coverage in OCDS data:
See the Python API documentation for complete details on the
coverage() function.Build from Source
For development or to use the latest unreleased features, you can build Cardinal from source.Clone the Repository
Build with Cargo
Build the release version:target/release/ocdscardinal.
Run Without Installing
You can run Cardinal directly from the repository:--help with any Cardinal command.
Install Locally
Install the locally built version:Build Python Bindings
To build Python bindings from source, you need maturin:System Requirements
Cardinal has minimal system requirements:- Operating Systems: Linux, macOS, Windows
- Memory: Depends on dataset size, but Cardinal is memory-efficient. For most datasets, 2-4 GB RAM is sufficient
- Disk Space:
- CLI installation: ~10 MB
- Building from source: ~500 MB (includes build dependencies)
- CPU: Multi-core processors benefit from Cardinal’s parallel processing
Upgrading Cardinal
Upgrade Cargo Installation
Reinstall to get the latest version:Upgrade Python Package
Upgrade using pip:Troubleshooting
Command Not Found
If you getcommand not found: ocdscardinal after installation:
-
Ensure
~/.cargo/binis in your PATH: -
Add it to your PATH if missing. Add this to
~/.bashrcor~/.zshrc: -
Restart your terminal or run:
Build Failures
If building from source fails:-
Ensure you have the latest Rust toolchain:
-
Check that you’re using Rust edition 2024 (included in recent versions):
-
Clear the build cache and try again:
Python Import Errors
If importingocdscardinal in Python fails:
-
Verify the package is installed:
-
Ensure you’re using Python 3.10 or later:
- Check for platform compatibility issues - some platforms may require building from source
Next Steps
Quickstart Guide
Run your first analysis with Cardinal
Init Command
Learn about initializing settings files
Configuration
Understand Cardinal’s configuration options
GitHub Repository
View source code and report issues
