Skip to main content

*Allotrope® is a registered trademark of the Allotrope Foundation; no affiliation with the Allotrope Foundation is claimed or implied.

Introduction

Welcome to allotropy -- a Python library by Benchling for converting instrument data into the Allotrope Simple Model (ASM).

View the list of instrument software currently supported in SUPPORTED_INSTRUMENT_SOFTWARE.

The objective of this library is to read text or Excel based instrument software output and return a JSON representation that conforms to the published ASM schema. Note that some schemas do not yet match the published ASM schema, in these cases the CHANGE_NOTES.md file included alongside the schema details the differences and proposed changes to ASM or the library schema. The code in this library does not convert from proprietary/binary output formats and so has no need to interact with any of the specific vendor softwares.

If you aren't familiar with Allotrope, we suggest you start by reading the Allotrope Product Overview.

We have chosen to have this library output ASM since JSON is easy to read and consume in most modern systems and can be checked by humans without any special tools needed. All of the published open source ASMs can be found in the ASM Gitlab repository.

This code is published under the permissive MIT license because we believe that standardized instrument data is a benefit for everyone in science.

Contributing

We welcome community contributions to this library and we hope that together we can expand the coverage of ASM-ready data for everyone. If you are interested, please read our contribution guidelines.

Usage

Convert a file to an ASM dictionary:

from allotropy.parser_factory import Vendor
from allotropy.to_allotrope import allotrope_from_file

asm_dict = allotrope_from_file("filepath.txt", Vendor.MOLDEV_SOFTMAX_PRO)

or, convert any IO:

from allotropy.parser_factory import Vendor
from allotropy.to_allotrope import allotrope_from_io

with open("filename.txt") as f:
    asm_dict = allotrope_from_io(f, Vendor.MOLDEV_SOFTMAX_PRO)

bytes_io = BytesIO(file_stream)
asm_dict = allotrope_from_io(bytes_io, Vendor.MOLDEV_SOFTMAX_PRO)

Specific setup and build instructions

.gitignore: used standard GitHub Python template and added their recommended JetBrains lines

Setup

Install Hatch: https://hatch.pypa.io/latest/ Install Python: https://www.python.org/downloads/ This library supports Python 3.10 or higher. Hatch will install a matching version of Python (defined in pyproject.toml) when it sets up your environment.

Tell git to use .githooks:

git config core.hooksPath .githooks

Dependencies

To add requirements used by the library, update dependencies in pyproject.toml:

  • For project dependencies, update dependencies under [project].
  • For script dependencies, update dependencies under [tool.hatch.envs.default].
  • For lint dependencies, update dependencies under [tool.hatch.envs.lint].
  • For test dependencies, update dependencies under [tool.hatch.envs.test].

Useful Hatch commands

List all environments:

hatch env show

Run all lint:

hatch run lint:all

Auto-fix all possible lint issues:

hatch run fix

Run all tests in the default python enviroment (currently: 3.11)

hatch run test

Run all tests against all supported python versions (currently 3.10-3.12) Note: this is checked against in CI - your change must pass this to merge.

hatch run test_all:test

Run against a specific python version (useful for debugging if a test is failing in one environment)

hatch run test_all.py3.12:test

Run a specific test file (replace the filepath with your own):

hatch run test tests/allotrope/allotrope_test.py

Run all tests with coverage:

hatch run test:cov

Spawn a shell within an environment for development:

hatch shell

Publish

NOTE: only package admins can publish allotropy.

To publish a new version:

hatch run scripts:update-version

Merge the resulting PR, and then run on main:

hatch build
hatch publish

Metadata

Release files for allotropy 0.1.152

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

Source distribution (sdist)

Source distribution for allotropy 0.1.152
File Size Uploaded Provenance Actions
allotropy-0.1.152.tar.gz 1.5 MB Without provenance Details for allotropy-0.1.152.tar.gz

Built distribution (wheel)

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

Total release size: 3.4 MB

Release files / allotropy-0.1.152.tar.gz

Download URL allotropy-0.1.152.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
5bd384b8b951a9a9aaae27360fcc01176e08b884bbd055f814cce95f73f9438d
BLAKE2b-256 checksum
How to use checksums
1214aa100bfade384e612766495252353ddf2625ff6d01cad1b8513a4ce7818b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release files / allotropy-0.1.152-py3-none-any.whl

Download URL allotropy-0.1.152-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
0ea39b4fbaad9b09b3fea8c6830907e13e999bd2dcbbc84a5b0b3e989283917e
BLAKE2b-256 checksum
How to use checksums
219998a8f56bac529d91e7b0bd8a9f037c4a993deafe2136330d29fd9475eedd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Security for allotropy 0.1.152

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.

Release history Release notifications | RSS feed

This release

0.1.152 This release

2 release files No provenance

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