Skip to main content

TokaMap

TokaMap is a JSON schema-based framework for mapping and structuring experimental data. It provides a standardized way to define how experimental measurements, calculations, and data transformations should be organized and validated.

The Python package contains the following components:

  • tokamap: A module that provides details about the install, such as the schemas directory
  • tokamap.validator: The validation module for ensuring data consistency and correctness

And the following CLI tools:

  • tokamap: Command-line interface for querying details about the install, such as the schemas directory
  • tokamap-validator: Command-line interface for validating TokaMap mappings

Overview

TokaMap defines a set of JSON schemas that allow researchers and engineers to:

  • Map experimental data using structured configuration files
  • Define data sources with standardized parameters and arguments
  • Create expressions and calculations from mapped data
  • Partition and group data based on experimental attributes
  • Validate mappings to ensure data consistency and correctness

Installation

From PyPI

pip install tokamap

From Source

git clone https://github.com/ukaea/tokamap.git
pip install .

TokaMap CLI

Finding the schemas directory:

tokamap --schemas-dir

Checking the installed version:

tokamap --version

TokaMap library

Finding the schemas directory:

from tokamap import schemas_dir

print(schemas_dir())

Checking the installed version:

from tokamap import __version__

print(__version__)

Validation

TokaMap includes a Python validator tool to ensure your mapping files conform to the schemas.

Usage

Validate a TokaMap mapping directory:

tokamap-validator /path/to/mapping/directory

For verbose output:

tokamap-validator -v /path/to/mapping/directory

The validator will:

  1. Check that the configuration file (mappings.cfg.json) exists and is valid
  2. Validate the top-level globals file
  3. Validate each mapping group's globals and mappings files

Validator Requirements

  • Python >= 3.13
  • jsonschema >= 4.25.0

Architecture

The TokaMap system consists of three main schema components:

1. Configuration Schema (mappings.cfg.schema.json)

Defines the top-level configuration structure including:

  • Metadata: Experiment information, author, and version
  • Partitions: Data partitioning rules with selectors (max_below, min_above, exact, closest)
  • Groups: Array of group identifiers

2. Globals Schema (globals.schema.json)

Defines global configuration settings, particularly data source configurations with their associated arguments.

3. Mappings Schema (mappings.schema.json)

Defines the structure for mapping experimental data with five main mapping types:

  • DIMENSION: Maps dimensional probe data
  • VALUE: Maps static values (numbers, strings, arrays, objects)
  • DATA_SOURCE: Maps external data sources with configurable arguments, offsets, scaling, and slicing
  • EXPR: Maps mathematical expressions with parameters
  • CUSTOM: Maps custom functions from external libraries

For more information see the docs.

Contributing

TokaMap is developed to support experimental data mapping workflows. The schemas are designed to be extensible while maintaining validation integrity.

License

See the main project LICENSE file for license information.

Release files for tokamap 0.3.2

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

Source distribution (sdist)

Source distribution for tokamap 0.3.2
File Size Uploaded
tokamap-0.3.2.tar.gz 65.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tokamap 0.3.2
File Interpreter ABI Platform
tokamap-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 75.3 kB

Release files / tokamap-0.3.2.tar.gz

Download URL tokamap-0.3.2.tar.gz
Size 65.2 kB
Tags Source
SHA-256 checksum
How to use checksums
aa4956c40a391b71711d27ae0588867802fafde94c9cfd0360299f36d2401bff
BLAKE2b-256 checksum
How to use checksums
8a82fc10d4562368df94e4bf308d510ffb9cd5484c87a59be7dfe0c8d3eeaa5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 20, 2026.

Transparency log

Release files / tokamap-0.3.2-py3-none-any.whl

Download URL tokamap-0.3.2-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc3edbaf42cc452fbbc7412a198a09d2c8195ec241ff26d28c86e527427b49f1
BLAKE2b-256 checksum
How to use checksums
46b2e45ce6bd76f0dcffce110394a39bb122bf311ecfadc049e350c671fbd77c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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