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.7.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.7.0
File Size Uploaded Provenance Actions
xtalforge-1.7.0.tar.gz 889.1 kB Without provenance Details for xtalforge-1.7.0.tar.gz

Built distributions (wheels)

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

Total release size: 28.8 MB

Release files / xtalforge-1.7.0.tar.gz

Download URL xtalforge-1.7.0.tar.gz
Size 889.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9eedc6b584ac3bebcc3b8a9fba0dacd96ef6a8cb3b9befde818c65b5014b2115
BLAKE2b-256 checksum
How to use checksums
a62edf19765df7e0589e932aeb8cd3dc2c2985ff477f33bf31211d4887930a1c
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.7.0-cp39-abi3-win_amd64.whl

Download URL xtalforge-1.7.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
54a31a351d3d2247de8be3cd753dcf096ae197dbf172b215790d595de7916602
BLAKE2b-256 checksum
How to use checksums
162844564d657715db60a65c23c1ec99b2a24c697c260713ddd2a1cbb00d7413
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.7.0-cp39-abi3-musllinux_1_1_x86_64.whl

Download URL xtalforge-1.7.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
833a3777a5bd13db0cc0f438bc04b633ce6094bdde29604de54dec06f1fd25d2
BLAKE2b-256 checksum
How to use checksums
6fc34d3660aa81e21e781d923ad4f34394ff4df8a6011d9b99d4f1c9441a25e2
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.7.0-cp39-abi3-musllinux_1_1_aarch64.whl

Download URL xtalforge-1.7.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
ba251e035533a75473fb9cf2c25b25f85a5be318b2512ea291a452f958ba9223
BLAKE2b-256 checksum
How to use checksums
0fa102de7c844541b493919612cce1a2befc5f38d25f6ce9dc273f3bb155b2ff
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.7.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL xtalforge-1.7.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
c063b6402730f246e052c787b10bdf2db19bad7fc791e4c906bab13ecc482fef
BLAKE2b-256 checksum
How to use checksums
8c44c4f05477bb6f435b39b00a069e1f45ed169d9b8a5b6d41d45dfdecc2ece4
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.7.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL xtalforge-1.7.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
5971c87cfacfbf8e19e0a96e0c79414fc97a193c07e8434a7fb61e3b1ae4c863
BLAKE2b-256 checksum
How to use checksums
41c4e99e6d1cb3b4acb2ac226109d64f1386b9e38be71b6344b14db542a9c1b2
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.7.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL xtalforge-1.7.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
6e3ecd07db0695e836ab212a99687dd8331c9f0646caf4b6ca42fb7396f2760b
BLAKE2b-256 checksum
How to use checksums
097186184447968e2ceacabce617ae20dd8c86a98571cbc78007da52e3669f52
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.7.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL xtalforge-1.7.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
3dfead8aeda61f052f1a15b5072a71f5076321d6265d5b4784489405269a95cf
BLAKE2b-256 checksum
How to use checksums
c5e7a48088204e1117139256095d8196f2ef7396f6cf4b9a3c051df0079e7089
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.7.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