A lightweight Python package for NMR research.
Project description
nmrkit
nmrkit is a Python library for nuclear magnetic resonance (NMR) data processing and analysis.
This is an early-stage project under active development. Contributions are welcome to help expand its capabilities!
Features
- Data Import/Export: Support for common NMR formats including TopSpin and Delta
- Basic Processing: Fourier transform, apodization (exponential multiplication), zero filling, phase correction
- Visualization: Interactive plotting with customizable parameters
- Simple API: Intuitive functions for data processing workflows
Requirements
- Python >= 3.12
- NumPy
- SciPy
- Matplotlib (optional, for visualization)
Installation
From PyPI (Recommended)
pip install nmrkit
With visualization support:
pip install nmrkit[visualization]
Quick Start
Automatic Processing
Use the auto_process function for automated application of common processing steps:
import nmrkit as nk
# Load NMR data
data = nk.read('path/to/data')
# Automatically process the spectrum
data = nk.auto_process(data)
# Save the plot to a PDF file
nk.plot(data, output_path="spectrum.pdf")
Manual Processing
For more control, use individual processing functions:
import nmrkit as nk
# Load data with explicit format specification
data = nk.read('path/to/data.jdf', format='delta')
# Apply exponential multiplication (apodization) with 1.0 Hz line broadening
data = nk.em(data, lb=1.0)
# Zero fill to 2048 points for improved resolution
data = nk.zf(data, size=2048)
# Perform Fourier transform
data = nk.ft(data)
# Apply phase correction
data = nk.phase(data, ph0=10.0, ph1=25.0)
# Plot the manually processed spectrum
nk.plot(data)
License
nmrkit is released under the Apache License 2.0. See the LICENSE file for more information.
Contributing
The nmrkit project welcomes your expertise and enthusiasm!
Reporting Issues
If you encounter a bug or have an idea for a new feature, please open an issue on GitHub. When reporting bugs, please include:
- A clear description of the issue
- Steps to reproduce (if applicable)
- Expected vs actual behavior
- Your Python version and operating system
Contributing Code
To contribute code to nmrkit:
- Fork and Clone: Fork the repository and clone it locally
- Set up Development Environment:
poetry install - Create a Branch: Create a new branch for your feature or bug fix
git checkout -b feature/your-feature-name
- Make Changes: Implement your changes following the existing code style
- Run Tests: Ensure all tests pass
poetry run pytest
- Commit: Commit your changes with clear, descriptive messages
- Push and Submit PR: Push to your fork and submit a pull request
Development Guidelines
- Follow PEP 8 style guidelines
- Add type hints for new functions
- Include docstrings following the existing format
- Add tests for new functionality
- Ensure all tests pass before submitting PR
Small improvements or fixes are always appreciated. Even minor contributions can make a significant difference!
Contact
- GitHub Repository: https://github.com/nmrtist/nmrkit
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nmrkit-1.0.0.tar.gz.
File metadata
- Download URL: nmrkit-1.0.0.tar.gz
- Upload date:
- Size: 36.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccf446069deea30f657aead9ed7408159624ee71b4da404386f1a3ced8e65cc4
|
|
| MD5 |
ecf5547bd64c0267a14a22159d2a2f27
|
|
| BLAKE2b-256 |
c54044c01161503c754325a377a5096e73705deda13974b5382a75a0437ad659
|
Provenance
The following attestation bundles were made for nmrkit-1.0.0.tar.gz:
Publisher:
publish-pypi.yml on nmrtist/nmrkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nmrkit-1.0.0.tar.gz -
Subject digest:
ccf446069deea30f657aead9ed7408159624ee71b4da404386f1a3ced8e65cc4 - Sigstore transparency entry: 1461526826
- Sigstore integration time:
-
Permalink:
nmrtist/nmrkit@88b25366b99cdc7c35d1bc1a87ced511161765a7 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/nmrtist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@88b25366b99cdc7c35d1bc1a87ced511161765a7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file nmrkit-1.0.0-py3-none-any.whl.
File metadata
- Download URL: nmrkit-1.0.0-py3-none-any.whl
- Upload date:
- Size: 44.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd1381f0e698c57185d6e36ea20ac6245f45bf7a7a096f272fcfb5bff9ab20c2
|
|
| MD5 |
5b682fe8ae5b48931dc86982506d796e
|
|
| BLAKE2b-256 |
95f345f379fea8801dfd27ba4530cfab23985da0f9d8d69a9cf07b4b61799887
|
Provenance
The following attestation bundles were made for nmrkit-1.0.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on nmrtist/nmrkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nmrkit-1.0.0-py3-none-any.whl -
Subject digest:
fd1381f0e698c57185d6e36ea20ac6245f45bf7a7a096f272fcfb5bff9ab20c2 - Sigstore transparency entry: 1461526879
- Sigstore integration time:
-
Permalink:
nmrtist/nmrkit@88b25366b99cdc7c35d1bc1a87ced511161765a7 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/nmrtist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@88b25366b99cdc7c35d1bc1a87ced511161765a7 -
Trigger Event:
push
-
Statement type: