Read and write Gwyddion Simple Field files
gsffile is a Python module to:
- read image and metadata from Gwyddion Simple Field (.gsf) files, and
- store NumPy arrays in Gwyddion Simple Field files.
It features type annotations, minimal logging, and an overgrown test suite.
Setup
Install with pip
python -m pip install gsffile
or with conda
conda install gsffile
Quickstart
>>> from gsffile import read_gsf, write_gsf
>>> import numpy as np
# The Gwyddion Simple Field format supports only 32-bit floating point data.
>>> data = np.eye(100, dtype=np.float32)
# Optional metadata.
>>> metadata = {
... "XReal": 5e-05,
... "YReal": 5e-05,
... "XYUnits": "m",
... "ZUnits": "V",
... "CustomKey": 33,
... }
>>> write_gsf("example.gsf", data, metadata)
>>> data, metadata = read_gsf("example.gsf")
Documentation
gsffile is documented via docstrings:
python -c "import gsffile; help(gsffile)"
How to cite
Cite gsffile in your published work using the version-specific metadata in CITATION.cff, or this general BibTeX entry:
@misc{Dri_gsffile_2024,
title = {gsffile},
author = {Dri, Carlo and Peronio, Angelo},
url = {https://github.com/angelo-peronio/gsffile},
doi = {10.5281/zenodo.16998022},
year = {2024},
month = {7}
}
Specific DOIs for each released version are listed on Zenodo, but are not included in CITATION.cff
due to a limitation of Zenodo itself.
Metadata
Release files for gsffile 0.5.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gsffile-0.5.4.tar.gz | 11.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gsffile-0.5.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.4 kB
Release files / gsffile-0.5.4.tar.gz
| Download URL | gsffile-0.5.4.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
851a20d64cbeda3310d32d2cf7bce28955523dc45f31d7d4e1c292ac32e41469
|
|
BLAKE2b-256 checksum How to use checksums |
4b30f76941d0d285f5467f33d5dbd78ce087d80262c46ec5cd79bd9d8cdc4480
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 1, 2025.
Transparency logRelease files / gsffile-0.5.4-py3-none-any.whl
| Download URL | gsffile-0.5.4-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f55a0566108c8da621c63d49c529c454c89bf218f16bc264e6bb81c2308025ff
|
|
BLAKE2b-256 checksum How to use checksums |
3fe8332fdb0de925533fc737b31b6e11adc442936864c1492e05ee7b3c53ad6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 1, 2025.
Transparency log