Tools for working with the Abstraction & Reasoning Corpus (ARC-AGI)
Project description
arckit
Python and command-line tools for easily working with the ARC, ARC-AGI & ARC-AGI-2 datasets.
pip install -U arckit
Arckit provides tools for loading the data in a friendly format (without a separate download!), visualizing the data with high-quality vector graphics, and evaluating models on the dataset.
โจ NEW in v1.0: Added ARC-AGI-2 & ARC Prize 2025 Data, updated evaluation ruleset.
๐ Python API
Loading the dataset
>>> import arckit
>>> train_set, eval_set = arckit.load_data() # Load ARC-AGI-2 train/eval.
>>> train_set, eval_set = arckit.load_data("kaggle") # Load ARC Prize 2025
>>> train_set, eval_set = arckit.load_data("arcagi") # Load latest ARC-AGI-1
# TaskSets are iterable and indexable
>>> train_set
<TaskSet: 400 tasks>
>>> train_set[0]
<Task-train 007bbfb7 | 5 train | 1 test>
# Indexing can be done by task ID
>>> train_set[0] == train_set['007bbfb7']
True
# You can load specific tasks by ID
>>> task = arckit.load_single('007bbfb7')
Interacting with tasks
>>> task.dataset
'train'
>>> task.id
'007bbfb7'
## Extracting task Grids
>>> task.train # o task.test
=> List[Tuple[ndarray, ndarray]] # of input/output pairs
>>> task.train[0][0] # input of 1st train example
array([[0, 7, 7],
[7, 7, 7],
[0, 7, 7]])
# Tasks can be previewed (with colour!) in Python.
>>> train_set[15].show()
<Task-train 0d3d703e | 4 train | 1 test>
โโโโโโโโโโโโณโโโโโโโโโโโโณโโโโโโโโโโโณโโโโโโโโโโโโณโโโโโโโโโโโณโโโโโโโโโโโโณโโโโโโโโโโโณโโโโโโโโโโโโณโโโณโโโโโโโโโ
โ A-in 3x3 โ A-out 3x3 โ B-in 3x3 โ B-out 3x3 โ C-in 3x3 โ C-out 3x3 โ D-in 3x3 โ D-out 3x3 โ โ TA-in โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ 3 1 2 โ 4 5 6 โ 2 3 8 โ 6 4 9 โ 5 8 6 โ 1 9 2 โ 9 4 2 โ 8 3 6 โ โ 8 1 3 โ
โ 3 1 2 โ 4 5 6 โ 2 3 8 โ 6 4 9 โ 5 8 6 โ 1 9 2 โ 9 4 2 โ 8 3 6 โ โ 8 1 3 โ
โ 3 1 2 โ 4 5 6 โ 2 3 8 โ 6 4 9 โ 5 8 6 โ 1 9 2 โ 9 4 2 โ 8 3 6 โ โ 8 1 3 โ
โโโโโโโโโโโโดโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโโดโโโดโโโโโโโโโ
# Get task in original ARC format following fchollet's repo.
>>> task.to_dict()
=> {
"id": str,
"train": List[{"input": List[List[int]], "output": List[List[int]]}],
"test": List[{"input": List[List[int]], "output": List[List[int]]}]
}
Scoring a submission file:
To evaluate a submission in Kaggle ARC format:
>>> eval_set.score_submission(
'submission.csv', # Submission with two columns output_id,output in Kaggle fomrat
topn=2, # How many predictions to consider (default: 2)
return_correct=False # Whether to return a list of which tasks were solved
)
Note: the default
topnwas changed from 3 to 2 in v1.0 to match changes in the official evaluation.
Loading a specific dataset version
The ARC-AGI datasets have had several bugfixes since original release. Additionally, a new ARC-AGI-2 dataset has been released for competitions starting in 2025. By default, the latest version of ARC-AGI-2 is loaded, but you can specify a version parameter to both load_data and load_single to load other datasets.
The version options are:
latest,arcagi2: The latest version of the ARC-AGI-2 dataset (currently:f3283f7)arcagi: The latest version of the ARC-AGI dataset (currently:aa922be)kaggle,kaggle2025: The data for the 2025 Kaggle competition based on ARC-AGI-2 (currently:kaggle250808)kaggle2024: The data for the 2024 Kaggle competition based on ARC-AGI (pinned)arc,kaggle2019: The original ARC data, as in the 2019 Kaggle competition (pinned)
Note: You may wish to pin your data to a specific version number to avoid underlying data changes during research. To do this, use the most specific name available when loading data, or pin the installed version of
arckitin your environment.
๐ผ๏ธ Creating visualisations
The arckit.vis submodule provides useful functions for creating vector graphics visualisations of tasks, using the drawsvg module. The docstrings for these functions provide more detailed information as well as additional options.
>>> import arckit.vis as vis
>>> grid = vis.draw_grid(task.train['2013d3e2'][0], xmax=3, ymax=3, padding=.5, label='Example')
>>> vis.output_drawing(grid, "images/grid_example.png") # svg/pdf/png
When drawing tasks, arckit will intelligently resize all of the grids such that the total size of the illustration does not exceed the chosen width/height.
>>> task = vis.draw_task(train_set[0], width=10, height=6, label='Example')
>>> vis.output_drawing(task, "images/arcshow_example.png") # svg/pdf/png
Alternatively, the print_grid function outputs a grid directly to the terminal without creating any files.
>>> task = train_set[0] # Get the first task
>>> for i, (input_array, output_array) in enumerate(task.train): # Loop through the training examples
>>> print(f"Training Example {i+1}")
>>> print("Input:")
>>> vis.print_grid(input_array)
>>> print("Output:")
>>> vis.print_grid(output_array)
>>> print()
๐ป Command-line tools
arcshow draws a visualisation of a specific task straight to the console:
arcsave saves a visualisation of a specific task to a file (pdf/svg/png), and is useful for inspecting tasks or producing high quality graphics showing specific tasks (e.g. for a paper). Tasks can be specified by their hex ID or by dataset, e.g. train0.
usage: arcsave [-h] [--output OUTPUT] task_id width height
Save a task to a image file.
positional arguments:
task_id The task id to save. Can either be a task ID or a string e.g. `train0`
width The width of the output image
height The height of the output image
optional arguments:
-h, --help show this help message and exit
--output OUTPUT The output file to save to. Must end in .svg/.pdf/.png. By default, pdf is used.
๐ก Contributions
Any relevant contributions are very welcome! Please feel free to open an issue or pull request, or drop me an email if you want to discuss any possible changes.
๐ Acknowledgements
The ARC and ARC-AGI-2 datasets was graciously released by Francois Chollet under Apache 2.0 and can be found in original format in these repositories. The dataset is reproduced within the arckit package under the same license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arckit-1.0.1.tar.gz.
File metadata
- Download URL: arckit-1.0.1.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ed3e2b0a5b69d8e5202115bf985127914cb2bfe1ee51f5a9893e996ff7f155c
|
|
| MD5 |
1606e3d0b583851fbc0a185012128905
|
|
| BLAKE2b-256 |
6a481018e884a2cfc7f35802c9de1f1e50877cd6528ed810d020cfbfb8b1a30b
|
Provenance
The following attestation bundles were made for arckit-1.0.1.tar.gz:
Publisher:
pypi.yml on mxbi/arckit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arckit-1.0.1.tar.gz -
Subject digest:
2ed3e2b0a5b69d8e5202115bf985127914cb2bfe1ee51f5a9893e996ff7f155c - Sigstore transparency entry: 422248697
- Sigstore integration time:
-
Permalink:
mxbi/arckit@3d50d857b67373953c5c45445ec2141651852123 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mxbi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@3d50d857b67373953c5c45445ec2141651852123 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file arckit-1.0.1-py3-none-any.whl.
File metadata
- Download URL: arckit-1.0.1-py3-none-any.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8b61ad91c09737307f72c1167fb30735b95d3547cd9f36853996fd5072e5dc7
|
|
| MD5 |
74750ab3b2150e886907be53583dab2a
|
|
| BLAKE2b-256 |
9d92b2aff973d38db442929360139cd1d6ae13cf999d6733cc71620498430500
|
Provenance
The following attestation bundles were made for arckit-1.0.1-py3-none-any.whl:
Publisher:
pypi.yml on mxbi/arckit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arckit-1.0.1-py3-none-any.whl -
Subject digest:
f8b61ad91c09737307f72c1167fb30735b95d3547cd9f36853996fd5072e5dc7 - Sigstore transparency entry: 422248727
- Sigstore integration time:
-
Permalink:
mxbi/arckit@3d50d857b67373953c5c45445ec2141651852123 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mxbi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@3d50d857b67373953c5c45445ec2141651852123 -
Trigger Event:
workflow_dispatch
-
Statement type: