Skip to main content

Converts to ASM (Allotrope Simple Model) from various file formats.

Project description

*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).

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

We currently have parser support for the following instruments:

  • Agilent Gen5
  • Applied Bio QuantStudio
  • Applied Bio AbsoluteQ
  • Beckman Vi-Cell BLU
  • Beckman Vi-Cell XR
  • ChemoMetec Nucleoview
  • Luminex xPONENT
  • MolDev SoftMax Pro
  • NovaBio Flex2
  • PerkinElmer Envision
  • Roche Cedex BioHT
  • Thermo Fisher NanoDrop Eight
  • Unchained Labs Lunatic

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_schema = 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_schema = allotrope_from_io(f, Vendor.MOLDEV_SOFTMAX_PRO)

bytes_io = BytesIO(file_stream)
asm_schema = 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.9 or higher. Hatch will install a matching version of Python (defined in pyproject.toml) when it sets up your environment.

Add pre-push checks to your repo:

hatch run scripts:setup-pre-push

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 lint:fmt

Run all tests:

hatch run test:test

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

hatch run test: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

To publish a new version, update the version in src/allotropy/__about__.py and run:

hatch build
hatch publish

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

allotropy-0.1.22.tar.gz (63.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

allotropy-0.1.22-py3-none-any.whl (190.5 kB view details)

Uploaded Python 3

File details

Details for the file allotropy-0.1.22.tar.gz.

File metadata

  • Download URL: allotropy-0.1.22.tar.gz
  • Upload date:
  • Size: 63.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.25.0

File hashes

Hashes for allotropy-0.1.22.tar.gz
Algorithm Hash digest
SHA256 07ef21cd424cc2782e14c9862a72ae909f5e44cdc9d0338fae5530cdebb6b200
MD5 1bd320727f3475b1a72c3e9e0e9cbc4f
BLAKE2b-256 04fe7b21d9e4e778dfe7bf4f26f9923922c915efae1dbe2de282a72a9edcfa6b

See more details on using hashes here.

File details

Details for the file allotropy-0.1.22-py3-none-any.whl.

File metadata

  • Download URL: allotropy-0.1.22-py3-none-any.whl
  • Upload date:
  • Size: 190.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.25.0

File hashes

Hashes for allotropy-0.1.22-py3-none-any.whl
Algorithm Hash digest
SHA256 33183f2747d0011587eab516535a60cd7d270156ff95ffb3fb28d446e091db55
MD5 4710d490a8c0e1597b969ed97855d6a4
BLAKE2b-256 9afafd5b58f6273c6a940ca2927c3fbfe777d989e8241b93d58ba8c2d53d76b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page