A Python library for handling versioned metadata schemas for robotic data collection, providing seamless conversion between versions and robust validation.
Currently under active development. Expect changes in API and command line arguments.
AIROA Metadata provides a unified and versioned metadata schema system for robotic data collection. It enables researchers and developers to manage metadata across different versions with automatic conversion capabilities, ensuring backward compatibility and data consistency throughout the robot learning pipeline.
- π Version Management - Support for multiple schema versions (0.0, 1.0, 1.1, 1.2, 1.3)
- π Automatic Conversion - Seamless conversion between different metadata versions
- β JSON Schema Validation - Robust validation against defined JSON schemas
- π Type Safety - Full type hints and dataclass-based implementations
- π Python 3.8+ Compatible - Works with modern Python versions
- π¦ Extensible Architecture - Easy to add new versions and features
- Python 3.8 or higher
- pip or uv package manager
pip install airoa-metadata# Clone the repository
git clone https://github.com/airoa-org/airoa-metadata.git
cd airoa-metadata
# Install with uv (recommended)
uv sync
# Or install with pip
pip install -e .from airoa_metadata import MetadataV1_2, MetadataV1_3, MetadataLoader
# Load metadata from a JSON file
metadata = MetadataLoader.load_from_file("metadata.json")
# Or create from a dictionary
data = {
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"version": "1.3",
"files": [{"type": "rosbag", "name": "data.bag"}],
"context": {"entities": [], "components": []},
"run": {"total_time_s": 10.0, "instructions": [], "segments": []}
}
metadata = MetadataV1_3.from_dict(data)
# Convert from older to newer version
v1_2_data = {
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"version": "1.2",
"files": [{"type": "rosbag", "name": "data.bag"}],
"context": {"entities": [], "components": []},
"run": {"total_time_s": 10.0, "instructions": [], "segments": []}
}
v1_2_metadata = MetadataV1_2.from_dict(v1_2_data)
v1_3_metadata = MetadataV1_3.convert(v1_2_metadata) # Convert to v1.3| Version | Features | Status |
|---|---|---|
| 0.0 | Basic metadata structure | β Stable |
| 1.0 | Enhanced with task templates | β Stable |
| 1.1 | Improved segment tracking | β Stable |
| 1.2 | Unified entity structure with task templates | β Stable |
| 1.3 | Split task entities into task-record and task-template | β Stable |
# Import specific versions
from airoa_metadata.versions import (
MetadataV0_0, MetadataV1_0, MetadataV1_1,
MetadataV1_2, MetadataV1_3
)
# Use the latest version
from airoa_metadata import MetadataLatest, Metadata
# Create metadata with specific version
metadata = MetadataV1_3.from_dict(data)from airoa_metadata import MetadataLoader
# Automatic validation when loading
data = {
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"version": "1.3",
"files": [{"type": "rosbag", "name": "data.bag"}],
"context": {"entities": [], "components": []},
"run": {"total_time_s": 10.0, "instructions": [], "segments": []}
}
try:
metadata = MetadataLoader.load_from_dict(data)
print(f"Loaded valid {metadata.version} metadata")
except Exception as e:
print(f"Validation failed: {e}")# Clone the repository
git clone https://github.com/airoa-org/airoa-metadata.git
cd airoa-metadata
# Initialize submodules and install dependencies
git submodule update --init --recursive
GIT_LFS_SKIP_SMUDGE=1 uv sync# Format code
make format
# Run linting (ruff + mypy)
make lint
# Run tests
make test
# Run tests with coverage
make test-coveragemake format- Format code with ruffmake lint- Run linting checks (ruff + mypy)make test- Run all unit testsmake test-coverage- Run tests with coverage report
# Run specific test
uv run pytest airoa_metadata/tests/test_versions.py -v
# Run with coverage
make test-coverageairoa_metadata/
βββ __init__.py # Main package exports
βββ core/ # Core functionality
β βββ base.py # MetadataBase class
β βββ loader.py # MetadataLoader class
βββ versions/ # Version-specific implementations
β βββ v0_0.py # MetadataV0_0
β βββ v1_0.py # MetadataV1_0
β βββ v1_1.py # MetadataV1_1
β βββ v1_2.py # MetadataV1_2
β βββ v1_3.py # MetadataV1_3
βββ schemas/ # JSON schema files
βββ tests/ # Test suite
- Import errors: Ensure you've installed the package correctly with
uv syncorpip install -e . - Validation errors: Check that your metadata follows the correct schema for the version
- Version conversion errors: Some conversions may lose data when going to older versions
- π Report issues on GitHub Issues
We welcome contributions! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.
Quick start:
- Fork the repository
- Create a feature branch
- Make your changes and add tests
- Run quality checks:
make format && make lint && make test - Open a Pull Request
π For detailed instructions, development setup, and guidelines, please see our Contributing Guide.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Made with β€οΈ by the AIRoA Team