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

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.5.1
File Size Uploaded Provenance Actions
xtalforge-1.5.1.tar.gz 707.0 kB Without provenance Details for xtalforge-1.5.1.tar.gz

Built distributions (wheels)

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

Total release size: 26.9 MB

Release files / xtalforge-1.5.1.tar.gz

Download URL xtalforge-1.5.1.tar.gz
Size 707.0 kB
Tags Source
SHA-256 checksum
How to use checksums
521b622a001997f4eb65669ea91849d4a9c1e4b845c2c4a30d18879ad28620df
BLAKE2b-256 checksum
How to use checksums
a4040e9130d2967c5d31741257cee4a5735e9de6c74841a5699b420600760e07
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.5.1-cp39-abi3-win_amd64.whl

Download URL xtalforge-1.5.1-cp39-abi3-win_amd64.whl
Size 3.8 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
d580c4761fcb6d962a2a3b999ccfbfcd8d48d936b91f8847c08424bc12912372
BLAKE2b-256 checksum
How to use checksums
1e947a0f665c48645fa99049f97d4b55a88a12ec01b86f8b3a1b16d8f9564601
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.5.1-cp39-abi3-musllinux_1_1_x86_64.whl

Download URL xtalforge-1.5.1-cp39-abi3-musllinux_1_1_x86_64.whl
Size 4.1 MB
Tags CPython 3.9 Linux musl 1.1+ x86-64 abi3
SHA-256 checksum
How to use checksums
3afe8dc2de911b5c84d7f2eced09332fab1bafdac2072b4912246df3b154484b
BLAKE2b-256 checksum
How to use checksums
e6ba5ea9cce55cb58ceeaf6782769c2f90397d072739e69d3fb402c1593ce375
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.5.1-cp39-abi3-musllinux_1_1_aarch64.whl

Download URL xtalforge-1.5.1-cp39-abi3-musllinux_1_1_aarch64.whl
Size 3.7 MB
Tags CPython 3.9 Linux musl 1.1+ ARM64 abi3
SHA-256 checksum
How to use checksums
438d2d694ff0299b5b80280eb89e90346479f9511fb35cff3c0b02741f731d28
BLAKE2b-256 checksum
How to use checksums
7cff67900959919d876e60d60014aa390a8119d89fad2a7b4df11cf048eebcd1
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.5.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL xtalforge-1.5.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 3.9 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c5a078f51c5675c8ef085321e3b834bcfa924f9eb8cbddae07b7553cff59e258
BLAKE2b-256 checksum
How to use checksums
4d9cef0bbfd7a7eb077b788868cb47bc2aef8dbab9bda3ece55a76f86cf62f28
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.5.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL xtalforge-1.5.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 3.6 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
4fdd8544d22560fa3db2ad03ea8c10b03cf296b428689ed11b65e0f8e541ba18
BLAKE2b-256 checksum
How to use checksums
f9fe4d45c7dc8602a09929a7a3b674c325839ee9cfefbc8ca0d389c5fae0525d
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.5.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL xtalforge-1.5.1-cp39-abi3-macosx_11_0_arm64.whl
Size 3.4 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
07ace71465f4df7606fc86c5c018ebf941d0753a8b7e0b84c59719adc90c7f42
BLAKE2b-256 checksum
How to use checksums
14ca6b3a7381b95d1763b87bd2b49e252d65c8ed4ce1bf81805cd8c8cf8c782f
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.5.1-cp39-abi3-macosx_10_12_x86_64.whl

Download URL xtalforge-1.5.1-cp39-abi3-macosx_10_12_x86_64.whl
Size 3.7 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
c2b20935d28a09cdb9f829946cfd1e3864fb1a6305198d674e8aafdf1e5e8722
BLAKE2b-256 checksum
How to use checksums
5e2d771ca9ab68d216e0f131d23cbd68bd9d7f00e53dbc76d841d74eb666699b
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.5.1

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