Metadata-Version: 2.4
Name: ifpen.allotrope_models
Version: 2026.9.0b4
Summary: Shared Allotrope Simple Model (ASM) REC/2026/09 models for Python: quantity values, data cubes and core documents used by the IFPEN ASM technique packages.
Home-page: https://github.com/ifpen/AllotropeSimpleModelsClassGeneration
Author: Maxime Visconte
Author-email: Maxime Visconte <maxime.visconte@ifpen.fr>
Project-URL: Repository, https://github.com/ifpen/AllotropeSimpleModelsClassGeneration
Keywords: allotrope,asm,allotrope-simple-model,laboratory-data,chemistry
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: urllib3<3.0.0,>=2.1.0
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: pydantic>=2.11
Requires-Dist: typing-extensions>=4.7.1
Dynamic: author
Dynamic: home-page

# Allotrope Simple Model commons (Python)

A project from [IFP Energies Nouvelles][ifpen], a public research, innovation and
training organization in the fields of energy, transport and the environment.

Shared Python models of the
[Allotrope Simple Model (ASM)](https://www.allotrope.org/asm) release
**REC/2026/09**, used by the IFPEN ASM technique packages: quantity values and
their unit-specific variants, date-time and integer values, data cubes, the
core documents common to every technique (data system, device, processed data,
diagnostic traces, statistics, …), and the documents shared by the gas and
liquid chromatography packages (device control, peak list, peak, …).

You normally do not install this package directly: install the package of
your technique (see [Packages](#packages)), which depends on it.

| | |
|---|---|
| ASM release | REC/2026/09 |
| Package | `ifpen-allotrope-models` 2026.9.0b4 |
| Requires | Python 3.9+ |

## Installation

```sh
pip install ifpen-allotrope-models==2026.9.0b4
```

## Usage

```python
from ifpen.allotrope_models import QuantityValue

retention_time = QuantityValue(value=12.5, unit="s")
print(retention_time.to_json())  # {"value": 12.5, "unit": "s"}
```

## ASM conventions

- An unavailable number, written `"NaN"` in ASM JSON, is read as `math.nan` and
  written back as `"NaN"`.
- `DateTimeValue`, `DateTimeStampValue` and `IntegerValue` are written by ASM
  either as a primitive or as a typed object (`{"@type": …, "value": …}`);
  both forms are read and keep their form when written.

## Versioning

Version 2026.9.0b4 implements ASM REC/2026/09. The last version number is a
patch level of these packages, not of ASM. The technique packages depend on
exactly the same version of this package.

## Packages

| | Java | C# | Python | TypeScript |
|---|---|---|---|---|
| Commons | [Maven Central](https://central.sonatype.com/artifact/fr.ifpen.allotropeconverters/allotrope-models-commons) | [NuGet](https://www.nuget.org/packages/IFPEN.AllotropeConverters.AllotropeModels.Commons) | **[PyPI](https://pypi.org/project/ifpen-allotrope-models/)** | [npm](https://www.npmjs.com/package/@ifpen/allotrope-models-commons) |
| Gas Chromatography | [Maven Central](https://central.sonatype.com/artifact/fr.ifpen.allotropeconverters/allotrope-models-gc) | [NuGet](https://www.nuget.org/packages/IFPEN.AllotropeConverters.AllotropeModels.Gc) | [PyPI](https://pypi.org/project/ifpen-allotrope-models-gc/) | [npm](https://www.npmjs.com/package/@ifpen/allotrope-models-gc) |
| Differential Scanning Calorimetry | [Maven Central](https://central.sonatype.com/artifact/fr.ifpen.allotropeconverters/allotrope-models-dsc) | [NuGet](https://www.nuget.org/packages/IFPEN.AllotropeConverters.AllotropeModels.Dsc) | [PyPI](https://pypi.org/project/ifpen-allotrope-models-dsc/) | [npm](https://www.npmjs.com/package/@ifpen/allotrope-models-dsc) |
| Liquid Chromatography | [Maven Central](https://central.sonatype.com/artifact/fr.ifpen.allotropeconverters/allotrope-models-hplc) | [NuGet](https://www.nuget.org/packages/IFPEN.AllotropeConverters.AllotropeModels.Hplc) | [PyPI](https://pypi.org/project/ifpen-allotrope-models-hplc/) | [npm](https://www.npmjs.com/package/@ifpen/allotrope-models-hplc) |

## License

The source code is licensed under [CeCILL 2.1](https://opensource.org/license/cecill-2-1).
The models are derived from the ASM JSON schemas of the Allotrope Foundation,
licensed under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/).

Source code and issues: <https://github.com/ifpen/AllotropeSimpleModelsClassGeneration>.

[ifpen]: https://www.ifpenergiesnouvelles.com/
