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.9.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.9.0
File Size Uploaded Provenance Actions
xtalforge-1.9.0.tar.gz 942.8 kB Without provenance Details for xtalforge-1.9.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for xtalforge 1.9.0
File Actions
xtalforge-1.9.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for xtalforge-1.9.0-cp39-abi3-win_amd64.whl
xtalforge-1.9.0-cp39-abi3-musllinux_1_1_x86_64.whl CPython 3.9 abi3 Linux musl 1.1+ x86-64 Details for xtalforge-1.9.0-cp39-abi3-musllinux_1_1_x86_64.whl
xtalforge-1.9.0-cp39-abi3-musllinux_1_1_aarch64.whl CPython 3.9 abi3 Linux musl 1.1+ ARM64 Details for xtalforge-1.9.0-cp39-abi3-musllinux_1_1_aarch64.whl
xtalforge-1.9.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.9.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
xtalforge-1.9.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for xtalforge-1.9.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
xtalforge-1.9.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for xtalforge-1.9.0-cp39-abi3-macosx_11_0_arm64.whl
xtalforge-1.9.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for xtalforge-1.9.0-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 30.6 MB

Release files / xtalforge-1.9.0.tar.gz

Download URL xtalforge-1.9.0.tar.gz
Size 942.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e298650fddd121166006a52feb65782556e3ee4ecbf78196abf893a0e3ff6d77
BLAKE2b-256 checksum
How to use checksums
cd2d269a7caaa41aae52b7fb7c0857869f7447561268d32b25e40bc2fe2e6660
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.9.0-cp39-abi3-win_amd64.whl

Download URL xtalforge-1.9.0-cp39-abi3-win_amd64.whl
Size 4.3 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
28e6d397c258bf1de607d9c61a2f07552b7ce7aa3f5b7285c4c6c4336f7f5928
BLAKE2b-256 checksum
How to use checksums
ea90250e660d2f24bc2d87eb2703ef1f58bf55147cc5fccff8015724f62fc6d3
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.9.0-cp39-abi3-musllinux_1_1_x86_64.whl

Download URL xtalforge-1.9.0-cp39-abi3-musllinux_1_1_x86_64.whl
Size 4.6 MB
Tags CPython 3.9 Linux musl 1.1+ x86-64 abi3
SHA-256 checksum
How to use checksums
7e21152bd629a9ed7784f3e6ceb54dfabf7fc1352d29f92a56934e9bd26c0861
BLAKE2b-256 checksum
How to use checksums
27f6c88d066d67b233e61b62faa044102b5c675cc22882984ed0aa621bb3742e
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.9.0-cp39-abi3-musllinux_1_1_aarch64.whl

Download URL xtalforge-1.9.0-cp39-abi3-musllinux_1_1_aarch64.whl
Size 4.2 MB
Tags CPython 3.9 Linux musl 1.1+ ARM64 abi3
SHA-256 checksum
How to use checksums
964d4ac36042c4a788d014098dfb8f41eb39c652d8648c6e16043b69a783ad8b
BLAKE2b-256 checksum
How to use checksums
cb01ea9e74b472f4330ca7e4d331c63654e53d2d23218ba71f8deb721f3765a8
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.9.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL xtalforge-1.9.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 4.4 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
21b45aa0fde5ceee421bcb5d6e4af444ac91a7eecadec72eb117640228c84a21
BLAKE2b-256 checksum
How to use checksums
0e81bc5ad1988ccab9d94534c598b294e2b2c53e661e234bfa0c6f9092033429
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.9.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL xtalforge-1.9.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 4.0 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
e08a54254f9eab93e2730d938a35cb6be095ec8efe338f33dc87c57ded3a8428
BLAKE2b-256 checksum
How to use checksums
edf2a596c95c578f078eacd8e8002ff6bce4690e068d28c36a2d0e72969a6bfb
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.9.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL xtalforge-1.9.0-cp39-abi3-macosx_11_0_arm64.whl
Size 3.9 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
da4ba688a35a5f2ecf389426daa4b5646cb1290c40ec90084268b72974cae0c1
BLAKE2b-256 checksum
How to use checksums
a1c321e69b73a4c8d5c31c2190fc84f2ea845adb4c88cd35840bd252ada09ab8
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.9.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL xtalforge-1.9.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 4.2 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
08cdeda571024dd0d729c1c94bc421f69ed67ff343e3f3084a2d7be4920674ba
BLAKE2b-256 checksum
How to use checksums
32d5d515c2b11121533b5f7f321761a936069768dc704aa67ed852b50dfc0954
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.9.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