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.6.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.6.0
File Size Uploaded Provenance Actions
xtalforge-1.6.0.tar.gz 764.7 kB Without provenance Details for xtalforge-1.6.0.tar.gz

Built distributions (wheels)

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

Total release size: 28.4 MB

Release files / xtalforge-1.6.0.tar.gz

Download URL xtalforge-1.6.0.tar.gz
Size 764.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9bf0a70ebb08b43c3e70384adff5b6b42be0e256f540532992a7f8b4d017c6f7
BLAKE2b-256 checksum
How to use checksums
0ff44b2540eb20676512d49ef8e2dee59e93fef597ed030319113b364f6f5e1e
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.6.0-cp39-abi3-win_amd64.whl

Download URL xtalforge-1.6.0-cp39-abi3-win_amd64.whl
Size 4.0 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
53ceade263b56584590a1e8e9c72a956423569a327348a8db860467ca57a78a1
BLAKE2b-256 checksum
How to use checksums
79d20e686e8f2615cdfea7a9cc7601c44e774fe72b7b5ba3a7f340ddde9a47d5
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.6.0-cp39-abi3-musllinux_1_1_x86_64.whl

Download URL xtalforge-1.6.0-cp39-abi3-musllinux_1_1_x86_64.whl
Size 4.3 MB
Tags CPython 3.9 Linux musl 1.1+ x86-64 abi3
SHA-256 checksum
How to use checksums
c3cb5ce75eedb521ee6926ab7ddcdf56003b3b1d144feda7acba5d411155e35b
BLAKE2b-256 checksum
How to use checksums
a75b70ca4b49cc60fa74677a3865bd2105f2e23b0015e3edf2d8f9f0758b6598
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.6.0-cp39-abi3-musllinux_1_1_aarch64.whl

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

Download URL xtalforge-1.6.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 4.1 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
5d5073b2dcec8d960988406b9cf313cdc496288714db4b47ecfe5220b9f4f312
BLAKE2b-256 checksum
How to use checksums
cb0c36951c831d65cf25e828520c3214815a4749bcb49871cc7b9401aa0f3efc
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.6.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL xtalforge-1.6.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
82c5d4a1b2825e77bea70a6155b088c8c7ac109cd2a85a8cc5212f30454709a6
BLAKE2b-256 checksum
How to use checksums
6e589b7d855d23d979855f7b1ceb5a1885e9675ffd0dca9d0f9ce3a1c2e65417
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.6.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL xtalforge-1.6.0-cp39-abi3-macosx_11_0_arm64.whl
Size 3.6 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a32753dbf48a128adc0da0421a3d03ed7222a3c7af6cfe14a1740544eae2de46
BLAKE2b-256 checksum
How to use checksums
882bbb8ca43200bba6812425aa81ebed97e71d1adb345d1dcc1a22f7460f8382
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.6.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL xtalforge-1.6.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 3.9 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
47204eeb543c7b5cb1e01f81903f50340c2c51bb16c9a9ae3822da570ffe3807
BLAKE2b-256 checksum
How to use checksums
3778f23cda3917d791f2e5ca3f8ba479dd79a333e7a9761dbb3fbb359d28e60e
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.6.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