Skip to main content

align-utils

Utilities for parsing and processing align-system experiment data.

Installation

pip install align-utils

Usage

Working with Models

from align_utils.models import AlignExperiment, AlignDataset

experiment = AlignExperiment(
    name="test_experiment",
    version="1.0.0",
    description="A test experiment",
    parameters={"learning_rate": 0.001},
    results={"accuracy": 0.95}
)

dataset = AlignDataset(
    name="training_data",
    path="/data/train.csv",
    format="csv",
    metadata={"size": 10000}
)

Parsing Files

from align_utils.discovery import load_yaml, load_json, save_yaml, save_json

# Load configuration
config = load_yaml("config.yaml")
data = load_json("data.json")

# Save data
save_yaml(config, "output.yaml")
save_json(data, "output.json")

Exporting Data

from align_utils.exporters import export_to_csv, export_to_tsv

data = [
    {"name": "exp1", "accuracy": 0.95},
    {"name": "exp2", "accuracy": 0.97}
]

export_to_csv(data, "results.csv")
export_to_tsv(data, "results.tsv")

Open-World Runs

align_utils.open_world loads run directories written by align-system's open-world drivers, including runs still in progress.

from pathlib import Path
from align_utils.open_world import find_open_world_runs, load_run

for run_dir in find_open_world_runs(Path("outputs")):
    run = load_run(run_dir)
    for episode in run.episodes:
        score = episode.outcome.session_alignment_score if episode.outcome else None
        print(episode.scenario_id, episode.alignment_target_id, len(episode.records), score)
        for record in episode.records:
            action = record.output.action
            print("  ", action.action_type, action.character_id, action.parameters)
  • Every record is kept in order; repeated actions are not collapsed.
  • record.source retains the complete original JSON values, including unknown fields and explicit nulls, separately from the validated fields. It is excluded from model dumps.
  • A new episode starts when the scenario or target changes or when TA3's clock (elapsed_time) restarts, which separates the repeated sessions of unaligned ADMs that record no target.
  • Episode outcomes are the completion lines in raw_align_system.log, paired with episodes in order. EpisodeOutcome.alignment_target_id is the target TA3 scored against, known even for unaligned runs.
  • record.chosen_by_driver marks actions the driver took itself; their choice_info may belong to the previous step.

Development

This package is part of the align-tools monorepo. See the main repository for development instructions.

Metadata

Release files for align-utils 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for align-utils 1.6.0
File Size Uploaded Provenance Actions
align_utils-1.6.0.tar.gz 26.6 kB Without provenance Details for align_utils-1.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for align-utils 1.6.0
File Interpreter ABI Platform Actions
align_utils-1.6.0-py3-none-any.whl Python 3 none any Details for align_utils-1.6.0-py3-none-any.whl

Total release size: 45.3 kB

Release files / align_utils-1.6.0.tar.gz

Download URL align_utils-1.6.0.tar.gz
Size 26.6 kB
Tags Source
SHA-256 checksum
How to use checksums
99c7bfe907ece4795921cc7c6b5e13c18ccccba52d13b60fcfe6366cae7406d6
BLAKE2b-256 checksum
How to use checksums
78f42ec39aa608face10ede16d6901d9e882b97b283a049ea59551aeb7fb179c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / align_utils-1.6.0-py3-none-any.whl

Download URL align_utils-1.6.0-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5793ff50a7f3a6eef59178ac7205d6878211b87fb1ab4b47848d02acd1d59a5
BLAKE2b-256 checksum
How to use checksums
d552544368ff1c5d30c406ad555cfe3247fdbf3be87d68dd5b149015e3c28ced
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for align-utils 1.6.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page