Skip to main content

xtalforge

xtalforge (Python)

Python bindings for xtalforge, the pure Rust library for building, manipulating, analysing and exporting crystal structures. The same engine powers the Rust API, the CLI and the WebAssembly package.

Install

pip install xtalforge

The wheel is abi3 (CPython 3.9+) and ships NumPy arrays for positions, fractional positions, the cell matrix and atomic numbers.

Quick start

import xtalforge

structure = xtalforge.Structure.from_cif(cif_text)
print(structure.formula, structure.n_sites)
print(structure.positions)          # NumPy (n, 3), Angstrom
print(structure.cell)               # NumPy (3, 3), rows a, b, c

slab = structure.supercell(2, 2, 1).slab(0, 0, 1, layers=2, vacuum=10.0)
slab.write("slab.cif")

dataset = xtalforge.detect_symmetry(structure)
pattern = xtalforge.pxrd(structure)
print(dataset["hm_symbol"], pattern["points"][:3])

Structure also accepts the free-function wrappers: functions whose first argument is structure text accept a Structure handle and avoid reparsing. The 1.x text/dict API remains available; typed results (SymmetryDataset, PxrdPattern, PorosityReport, OptimizeResult) are dict-compatible.

Batch helpers

import xtalforge.batch

structures = xtalforge.batch.read(["a.cif", "b.cif"])
texts = [structure.to_json() for structure in structures]
datasets = xtalforge.batch.detect_symmetry(texts)
patterns = xtalforge.batch.pxrd(texts)

Results keep input order. See the object API guide for the full list of methods, arrays and batch helpers.

License

MIT OR Apache-2.0.

Metadata

Release files for xtalforge 1.13.0

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

Source distribution (sdist)

Source distribution for xtalforge 1.13.0
File Size Uploaded Provenance Actions
xtalforge-1.13.0.tar.gz 2.1 MB Without provenance Details for xtalforge-1.13.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for xtalforge 1.13.0
File Actions
xtalforge-1.13.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for xtalforge-1.13.0-cp39-abi3-win_amd64.whl
xtalforge-1.13.0-cp39-abi3-musllinux_1_1_x86_64.whl CPython 3.9 abi3 Linux musl 1.1+ x86-64 Details for xtalforge-1.13.0-cp39-abi3-musllinux_1_1_x86_64.whl
xtalforge-1.13.0-cp39-abi3-musllinux_1_1_aarch64.whl CPython 3.9 abi3 Linux musl 1.1+ ARM64 Details for xtalforge-1.13.0-cp39-abi3-musllinux_1_1_aarch64.whl
xtalforge-1.13.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for xtalforge-1.13.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
xtalforge-1.13.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for xtalforge-1.13.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
xtalforge-1.13.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for xtalforge-1.13.0-cp39-abi3-macosx_11_0_arm64.whl
xtalforge-1.13.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for xtalforge-1.13.0-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 37.5 MB

Release files / xtalforge-1.13.0.tar.gz

Download URL xtalforge-1.13.0.tar.gz
Size 2.1 MB
Tags Source
SHA-256 checksum
How to use checksums
dfdf0d53f79281a5c3911fac24bbf6cb3519211ad4e8b393fa18aa439c4dfdfc
BLAKE2b-256 checksum
How to use checksums
aae3da6f27060a37325964d024e9809c1559afc0c6f7991ce6e6dc0779fc51ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / xtalforge-1.13.0-cp39-abi3-win_amd64.whl

Download URL xtalforge-1.13.0-cp39-abi3-win_amd64.whl
Size 5.2 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f5c0d5cd9c9075e9c916711da35feac7f772d155df27a8eb1b2075ccc3e9ce94
BLAKE2b-256 checksum
How to use checksums
edad3f400fb9741545863fedd3202d25d844b1d63bfdee98f88e1002bc75bd6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / xtalforge-1.13.0-cp39-abi3-musllinux_1_1_x86_64.whl

Download URL xtalforge-1.13.0-cp39-abi3-musllinux_1_1_x86_64.whl
Size 5.5 MB
Tags CPython 3.9 Linux musl 1.1+ x86-64 abi3
SHA-256 checksum
How to use checksums
48e9093a6938acad5dcdcdc1ab49acc8ce36fbadad20409eb93d1edce6a08c4f
BLAKE2b-256 checksum
How to use checksums
22824addc420965a6876fb989f4b71cec315b6df7a07c8849c3afa2168ad4ae0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / xtalforge-1.13.0-cp39-abi3-musllinux_1_1_aarch64.whl

Download URL xtalforge-1.13.0-cp39-abi3-musllinux_1_1_aarch64.whl
Size 5.0 MB
Tags CPython 3.9 Linux musl 1.1+ ARM64 abi3
SHA-256 checksum
How to use checksums
d197d8c1c919402f30940a4034ac8a8f818d01c03dd13447facdc1a05c420569
BLAKE2b-256 checksum
How to use checksums
460399866be7262ccb85a973bb27a891c48c90d5088c40f408211181b0569eab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / xtalforge-1.13.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL xtalforge-1.13.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 5.3 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
5f4f8f6d4e74213fbb89d97e402cdee799677237d39b6155367895897de7b9b9
BLAKE2b-256 checksum
How to use checksums
216e2c615c431dbb930cb69066a422afa9242c08d3d82d7b493a5d8d111253d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / xtalforge-1.13.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL xtalforge-1.13.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 4.8 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
90b99aee7d740f148162cb234007963b4d5e2094902d689644dd76e050202522
BLAKE2b-256 checksum
How to use checksums
7db477155977cdb61c737632536d20ff4b0625bae9241b5c40632a53e4e8a56d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / xtalforge-1.13.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL xtalforge-1.13.0-cp39-abi3-macosx_11_0_arm64.whl
Size 4.7 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7f07d5c15cab64327a11d6ad5899ebd1acacb23a0e2d20237c9ebd20842264a6
BLAKE2b-256 checksum
How to use checksums
c5abd384080424866208657e0a5e5b0bd904ed997ae46013caa4e6da554a1160
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / xtalforge-1.13.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL xtalforge-1.13.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 5.0 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ea43e7f4c2ab77c55a717f8c683728d87aaacf643fe1cd20065b8e6b5135c806
BLAKE2b-256 checksum
How to use checksums
36f666ba99f55b8d912b523e22ec1db7e2fe1b3271654434a795b13ab586b51f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for xtalforge 1.13.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.

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