Skip to main content

fairmat-readers-transmission

A package developed by FAIRmat and collaborators that contains file readers for various transmission spectrophotometry file formats.

Install and use

To use the readers, install the package using pip and import the read_file function. It will check the file extension and, using an appropriate file reader, return a Python dictionary containing the data.

pip install fairmat-readers-transmission
from fairmat_readers_transmission import read_file

file_path = "<filepath>.asc"
data_dict =  read_file(file_path)

You can also import individual file readers.

from fairmat_readers_transmission import read_perkin_elmers_asc

file_path = "<filepath>.asc"
data_dict =  read_perkin_elmers_asc(file_path)

Currently, the following file extensions are supported:

Vendor File Extension Corresponding Reader Function
Perkin Elmers .asc read_perkin_elmers_asc

Development

The package is still under development. To contribute, start with simply raising an issue on the repo.

Contributing code

In case you want to contribute a piece of code, or a whole new reader, clone the repo in your local and start a virtual Python environment inside the directory.

git clone git@github.com:FAIRmat-NFDI/readers-transmission.git
cd readers-transmission
python3 -m venv .pyenv
source .pyenv/bin/activate

Then install the package in editable mode (-e flag), with dev dependencies. You can also run the pytest to confirm all went well. As a recommended practice, you can also install the pre-commit hook for linting (more on this here).

python -m pip install --upgrade pip
pip install -e .[dev]
pytest
pre-commit install

Now you can start tinkering around on a new branch (or a fork). If you want to contribute the code back to the upstream, simply create a Pull Request (PR), and we will get back to you. As a good practice, add tests for new readers and make sure existing tests (pytest) are passing before creating PR.

Ruff

We have placed GitHub actions for checking the linting. This can lead to your PR failing the CI tests in case your code is not correctly linted or formatted. Best way to avoid this is to use Ruff for automatic linting and formatting. This is already part of the dev environment and you can run Ruff before committing:

ruff check --fix
ruff format

Ruff pre-commit hook

Additionally, we also provide pre-commit hook for Ruff. This will run Ruff every time you try to commit and raise errors (and provide fixes) in case your code needs linting or formatting. You simply have to add these fixes and commit again.

To use this pre-commit hook, make sure to run the following in the terminal after you clone the repo:

pre-commit install

Metadata

Release files for fairmat-readers-transmission 0.0.3

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

Source distribution (sdist)

Source distribution for fairmat-readers-transmission 0.0.3
File Size Uploaded
fairmat_readers_transmission-0.0.3.tar.gz 47.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fairmat-readers-transmission 0.0.3
File Interpreter ABI Platform
fairmat_readers_transmission-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 64.9 kB

Release files / fairmat_readers_transmission-0.0.3.tar.gz

Download URL fairmat_readers_transmission-0.0.3.tar.gz
Size 47.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bf08ae57d7fe5ad2b00b9ff9653798a3e98c63f4662567dfdb3400235343ff85
BLAKE2b-256 checksum
How to use checksums
df7d86c33bbbd9fce8c57951e2aa903b07a8dfcddb0c8e4919e3e4572657a940
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / fairmat_readers_transmission-0.0.3-py3-none-any.whl

Download URL fairmat_readers_transmission-0.0.3-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a75a162c5eb23ebc95411ec83b20b8a90202a5454f5f24f3e0b22a3808d4fcbb
BLAKE2b-256 checksum
How to use checksums
fa648fbc374f8253fcb1d0f1c3d367b895fe4f67fe55e04de51fc96c3a89a23e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

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