Converts to ASM (Allotrope Simple Model) from various file formats.
Project description
Introduction
Welcome to allotropy
-- a Python library for converting instrument data into 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
- Beckman Vi-Cell BLU
- Beckman Vi-Cell XR
- MolDev SoftMax Pro
- NovaBio Flex2
- PerkinElmer Envision
- Roche Cedex BioHT
This code is published under the permissive MIT license because we believe that standardized instrument data is a benefit for everyone in science.
Usage
Convert a file to an ASM dictionary:
from allotropy.parser_factory import VendorType
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 VendorType
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/
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
hatch env show
Run all lint:
hatch run lint:all
Auto-fix all possible lint issues:
hatch run lint:fix
Run all tests:
hatch run test:test
Run all tests with coverage:
hatch run test:cov
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
Built Distribution
Hashes for allotropy-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5faaeb34ab72f904dbd6c389538511bdae045710bc1bb0e14a60a3187f580bd9 |
|
MD5 | 9807bed48f0e0489cc243ece4c62189d |
|
BLAKE2b-256 | b835cbe807d7fd73071609de6663d86f565775d95164e171cff211f5a6add757 |