UPF to JSON converter
UPF is a file format to describe atomic pseudo-potentials used by (DFT) density functional theory codes. This package provides scripts for converting UPF v1 and UPF v2 (Unified Pseudopotential Format) to json format as required by the SIRIUS DFT library SIRIUS github.
More information about the unified pseudopotential format can be found here: https://www.quantum-espresso.org/pseudopotentials/unified-pseudopotential-format
Installation
From PyPI:
# as a standalone CLI tool
uv tool install upf_to_json
# or run it once without installing
uvx --from upf_to_json upf2json --help
# or as a library in a uv project / with pip
uv add upf_to_json
pip install upf_to_json
From a local checkout:
uv tool install .
CLI interface
The package installs the upf2json command:
Usage: upf2json [OPTIONS] COMMAND [ARGS]...
Convert UPF v1/v2 pseudopotentials to SIRIUS JSON.
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
convert Convert UPF file INFILE to JSON (OUTFILE, default: stdout).
summary Print header, cutoff radius and lmax info of INFILE.
Examples
# convert, writing to a file (omit OUTFILE to write to stdout)
upf2json convert Al.pbe-n-kjpaw_psl.1.0.0.UPF Al.json
# PAW: import core kinetic energy densities from the matching ATOMPAW PAW-XML
upf2json convert C.paw.UPF C.json --paw-core-xml C.atompaw.xml
# US: import generator-supplied kinetic augmentation (JSON keyed by the UPF SHA-256)
upf2json convert C.us.UPF C.json --kinetic-augmentation-json C.kinetic.json
# inspect a pseudopotential: header fields, cutoff radius, lmax
upf2json summary Al.pbe-n-kjpaw_psl.1.0.0.UPF
upf2json --version
Warnings about inconsistent UPF metadata are printed to stderr.
Python API
from upf_to_json import upf_to_json
with open("Al.pbe-n-kjpaw_psl.1.0.0.UPF") as fh:
pp_dict = upf_to_json(fh.read(), fname="Al.pbe-n-kjpaw_psl.1.0.0.UPF")
Metadata
Release files for upf_to_json 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| upf_to_json-1.2.0.tar.gz | 18.2 kB | Without provenance | Details for upf_to_json-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| upf_to_json-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for upf_to_json-1.2.0-py3-none-any.whl |
Total release size: 34.5 kB
Release files / upf_to_json-1.2.0.tar.gz
| Download URL | upf_to_json-1.2.0.tar.gz |
|---|---|
| Size | 18.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5dc55647a78e0e1591638da5b02d5e6cd831081687497d34575f2d76f40299a6
|
|
BLAKE2b-256 checksum How to use checksums |
5ff103df7bc9369e1b182a5a4ff528ce5429f0fa60a44fbaec8ca5ef107a8847
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / upf_to_json-1.2.0-py3-none-any.whl
| Download URL | upf_to_json-1.2.0-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0da5ac7fcd31b65e9c957465f2c63bdba233826640f60d1d5642e46f200c2b60
|
|
BLAKE2b-256 checksum How to use checksums |
fab7146849c3acb019a0fe3f927ecf977535c1131f97ade366d84e76c2347c59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for upf_to_json 1.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.