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.14.2

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.14.2
File Size Uploaded Provenance Actions
xtalforge-1.14.2.tar.gz 2.2 MB Without provenance Details for xtalforge-1.14.2.tar.gz

Built distributions (wheels)

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

Total release size: 104.7 MB

Release files / xtalforge-1.14.2.tar.gz

Download URL xtalforge-1.14.2.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
b721e8b676e42c362e20f9303c2ef3e53c1d1f6fe409d5bc52a06298a40c0873
BLAKE2b-256 checksum
How to use checksums
3aabc2516936b351c8b55cf48e6a6ea7de781c5308068bcc7d622bc0a8a8e11b
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.14.2-cp39-abi3-win_amd64.whl

Download URL xtalforge-1.14.2-cp39-abi3-win_amd64.whl
Size 15.2 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
5be941df4a0e228cbc2897a7c94b15d28478b7b6809fe9c4e98960e15b22ac27
BLAKE2b-256 checksum
How to use checksums
2f684223f9070a81d43223efbfd4defbd5a489c3075e2cb67f0676cc0eae7fda
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.14.2-cp39-abi3-musllinux_1_1_x86_64.whl

Download URL xtalforge-1.14.2-cp39-abi3-musllinux_1_1_x86_64.whl
Size 15.7 MB
Tags CPython 3.9 Linux musl 1.1+ x86-64 abi3
SHA-256 checksum
How to use checksums
34faa2b94aa7e9f5cac6fe8f550892a11ba1dfaaa21b7f3748ba59ac6d662b4d
BLAKE2b-256 checksum
How to use checksums
43b924ef565fbf023ab53dc669944dfc1e7b2e2c0a793d4f83e1b58097036e35
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.14.2-cp39-abi3-musllinux_1_1_aarch64.whl

Download URL xtalforge-1.14.2-cp39-abi3-musllinux_1_1_aarch64.whl
Size 14.2 MB
Tags CPython 3.9 Linux musl 1.1+ ARM64 abi3
SHA-256 checksum
How to use checksums
0bb96d79536b6b1dcfad5f6f1d7aac0b8bdcf26abb64aa88e75f58354b84ac79
BLAKE2b-256 checksum
How to use checksums
bbb690aaf9e032624b87a6431e219b6e3fbcea4e28ca0cacf1f73a9749b73395
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.14.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL xtalforge-1.14.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 15.5 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
8a0b0b15e9af54d594825bc4b73f613c02af4878a79dce043f05ac1c63dc757c
BLAKE2b-256 checksum
How to use checksums
7d2de2654f2fe6ed714a2c8ebfd8912061d90a32c412fc7355016229a6d93dde
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.14.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL xtalforge-1.14.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 14.0 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
4accc5238cd48328e64393a58c8f3a11c46356668ad4543c172c1ed0dfeb5d37
BLAKE2b-256 checksum
How to use checksums
6e2adae1c8456f200cbdcc50df0a8971e8defee7c83413372988cfe7ece66d19
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.14.2-cp39-abi3-macosx_11_0_arm64.whl

Download URL xtalforge-1.14.2-cp39-abi3-macosx_11_0_arm64.whl
Size 13.3 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d46fe964dd04a3734ad8d6cc4d2e2f015fef4f19a6e8cbed294775840258e5ce
BLAKE2b-256 checksum
How to use checksums
2d1567b83cb1a94d11b9d972cb75d95722c3707c67baf772f821f65155ea741e
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.14.2-cp39-abi3-macosx_10_12_x86_64.whl

Download URL xtalforge-1.14.2-cp39-abi3-macosx_10_12_x86_64.whl
Size 14.6 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
09589008621f303cba3549e1dddd9f659b0316c4b769b4172bb4459e0a2d7860
BLAKE2b-256 checksum
How to use checksums
cf8e3e967ed7040957afa55df30109c61ff86e39762c4635ff4e420710a1d2b5
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.14.2

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