Skip to main content

pynmr

pyNMR is a set of python modules to parse, process, and analyze NMR data.

There is a basic graphical user interface for phasing and baseline correctino, but after that pyNMR is best used together with Jupyter Lab.

Currently supported NMR formats are Bruker TopSpin (with GUI support) and Tecmag NTNMR and RS2D.

There is some code for parsing files from Magritek, and Varian under pynmr/model/parser, but at this point these formats are not officially supported.

Installation

pynmr is available at pip. It may be installed with

::

pip install pynmr

For the most recent version, download the version from GitHub.

Usage

To import a Bruker dataset instantiate an nmr Data object:

..code:: python

 import pynmr
 path = "pathToTopSpin/"
 
 import pynmr.model.parser.topSpin as T
 import pynmr.model.processor as P
 import pynmr.model.operations as O
 
 import matplotlib.pyplot as plt
 import numpy as np
 
 data = T.TopSpin("./data/bruker/dnp_210316_1_solids/1/")
 
 Processor = P.Processor([O.LeftShift(21),
                     O.LineBroadening(0.2),
                     O.FourierTransform(),
                     O.Phase0D(190)])
 Processor.runStack(data)

Notes

To install this package locally and install for development, use this command

pip install -e ./

More info available here: https://packaging.python.org/tutorials/installing-packages/

To make the pynmr GUI available via the command line on Mac OS or Linux systems, create a file

pynmr in /usr/local/bin

with the content

python /your/path/to/pynmr/pynmr/viewer/gui.py $1

save it, and

sudo chmod +x /usr/local/bin/pynmr

Open the last dataset via the terminal using the command pynmr -1

MIT License

Copyright (c) 2025 Benno Meier

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for pynmr 0.37

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

Built distribution (wheel)

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

Release files / pynmr-0.37-py3-none-any.whl

Download URL pynmr-0.37-py3-none-any.whl
Size 45.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92ed99d6cb9247de3ac26e205776335f076e39f898fc6ccfa170f338cee4b20c
BLAKE2b-256 checksum
How to use checksums
ba8563a4495934f9255609e688f1ea4f75c4b5f33c407dd9097fd2e95f8674e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.37 This release

1 release file

0.32

1 release file

0.30

1 release file

0.29

1 release file

0.28

1 release file

0.27

1 release file

0.26

1 release file

0.24

1 release file

0.23

1 release file

0.22

1 release file

0.21

2 release files

0.2

2 release files

0.1

2 release files

0.0

1 release file

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