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.8.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.8.0
File Size Uploaded Provenance Actions
xtalforge-1.8.0.tar.gz 904.0 kB Without provenance Details for xtalforge-1.8.0.tar.gz

Built distributions (wheels)

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

Total release size: 29.0 MB

Release files / xtalforge-1.8.0.tar.gz

Download URL xtalforge-1.8.0.tar.gz
Size 904.0 kB
Tags Source
SHA-256 checksum
How to use checksums
82c14164090749c220d62a4d7e4632e390b6466f3e5e55b0d0fdd630811e0ea3
BLAKE2b-256 checksum
How to use checksums
360dfca2519e8f5f21130741be8cd512156ba09693ff5e3d7d7e32d333dac7f9
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.8.0-cp39-abi3-win_amd64.whl

Download URL xtalforge-1.8.0-cp39-abi3-win_amd64.whl
Size 4.1 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
36ac1657ccf58ceeac09c443b1807c98544904d03902bd4ad6f9213a7e7a1a1e
BLAKE2b-256 checksum
How to use checksums
cfcb180f7c95a2613d01788d35a2750b92309cfe2cdfc2fb2970ccd5ce01c5e4
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.8.0-cp39-abi3-musllinux_1_1_x86_64.whl

Download URL xtalforge-1.8.0-cp39-abi3-musllinux_1_1_x86_64.whl
Size 4.4 MB
Tags CPython 3.9 Linux musl 1.1+ x86-64 abi3
SHA-256 checksum
How to use checksums
89d1a85b6cdb323db7a40f1a466f32049c5774cb07163231acf7e5d7b99a1a1d
BLAKE2b-256 checksum
How to use checksums
e7084e160086596139ab1d2cb3aa574fb6212d9bfa31eab8eb4d060b6372725c
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.8.0-cp39-abi3-musllinux_1_1_aarch64.whl

Download URL xtalforge-1.8.0-cp39-abi3-musllinux_1_1_aarch64.whl
Size 4.0 MB
Tags CPython 3.9 Linux musl 1.1+ ARM64 abi3
SHA-256 checksum
How to use checksums
6487145574c2083e928726c113804ad8a0d846351dbfca8187cefd2735b25f5f
BLAKE2b-256 checksum
How to use checksums
a40deb9084e44888da629d74a9142bd76daed5fd4eb23330ffa6f0c0905aba79
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.8.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL xtalforge-1.8.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 4.2 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
bb4da6c29e2dc1c633f8706023b3db22f47444e48b68946845599dc331da2cec
BLAKE2b-256 checksum
How to use checksums
39be8c312d86b83757017aa22bd866c0ba1c1aa54e5392780365030c601b747b
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.8.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL xtalforge-1.8.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 3.8 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
535c3599a01224908b24cb75e7e7cd602be5ec82aa861abc6928b1ac4f2d9596
BLAKE2b-256 checksum
How to use checksums
5b3ced0a77cf1adfb6cceace70c5f299269a0f9090ac441a15350cf2e9e5693f
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.8.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL xtalforge-1.8.0-cp39-abi3-macosx_11_0_arm64.whl
Size 3.7 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9b028be03d0ae695508dee9e2e6a7a7b1381ec070b4166331330f29143711e8f
BLAKE2b-256 checksum
How to use checksums
40f98d4f071835edb4b7ac134ca6ebda3a49cbe2b4e0266210fef60d8d587b36
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.8.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL xtalforge-1.8.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 4.0 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
61b4ce3f499b2d868b121e28991575983995b54dce7b79f31abf99e37e36b172
BLAKE2b-256 checksum
How to use checksums
bf25165690bb5044e8078b5d8f6da321dabd20b5d537979a31031330731f7464
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.8.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