Skip to main content

cifmi

Crates.io PyPI npm

cifmi reads CIF 1.1 and 2.0 files into crystal structures, with the cell, the space group, the sites, the symmetry operations and every atom of the unit cell, and writes crystal structures as standard CIF 1.1. It is written in Rust, with Python and Node.js bindings.

Quick start

Python

import cifmi

structure = cifmi.read_cif("sample.cif")
for atom in structure.atoms:
    print(structure.sites[atom.site].label, atom.fractional)

cifmi.write_cif("copy.cif", structure)

Rust

use cifmi::{read_cif, write_cif, CifOptions};

fn main() -> Result<(), cifmi::Error> {
    let structure = read_cif("sample.cif", &CifOptions::default())?;
    for atom in &structure.atoms {
        println!("{} {:?}", structure.sites[atom.site].label, atom.position);
    }
    write_cif("copy.cif", &structure)
}

Node.js

const cifmi = require('cifmi')

cifmi.readCifFile('sample.cif').then((structure) => {
  for (const atom of structure.atoms) {
    console.log(structure.sites[atom.site].label, atom.fractional)
  }
  return cifmi.writeCifFile('copy.cif', structure)
})

A structure from another crystal model is written the same way: build it from its cell, operations and sites with Structure::new in Rust or cifmi.Structure in Python; in Node.js, writeCifStr and writeCifFile take any object of the shape readCifStr returns.

Every file is read one way, by crystallographic rules, and a file cifmi cannot read is an error with the reason. A structure is written as it is, in its own setting with the standard names. One cifmi reads writes as a CIF that reads back as the same structure, with repeated labels made unique; the design's §7 lists the few that read back otherwise or are refused. See the design for the rules and the evidence behind them, and CONTRIBUTING.md for development and releases.

Metadata

Release files for cifmi 0.2.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 cifmi 0.2.0
File Size Uploaded Provenance Actions
cifmi-0.2.0.tar.gz 147.9 kB With provenance Details for cifmi-0.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for cifmi 0.2.0
File Interpreter ABI Platform Actions
cifmi-0.2.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for cifmi-0.2.0-cp310-abi3-win_amd64.whl
cifmi-0.2.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for cifmi-0.2.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
cifmi-0.2.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for cifmi-0.2.0-cp310-abi3-macosx_11_0_arm64.whl

Total release size: 1.9 MB

Release files / cifmi-0.2.0.tar.gz

Download URL cifmi-0.2.0.tar.gz
Size 147.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6145a507424a01b459bc220f2132f76c570e4bd43468d193e360adf9db01ba76
BLAKE2b-256 checksum
How to use checksums
41f9ae096c545d6e744a5d6cbb4cd67a943e14100eef504b62642a9a7389e350
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / cifmi-0.2.0-cp310-abi3-win_amd64.whl

Download URL cifmi-0.2.0-cp310-abi3-win_amd64.whl
Size 385.5 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8d58887a037c477f5e397e77069a87748b72290d4b690d7eb66035950d3d84a5
BLAKE2b-256 checksum
How to use checksums
779869e6c9c5579639d93677746527b48259b3f67b7aa265fe548e15e3f54b5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / cifmi-0.2.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL cifmi-0.2.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 918.7 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
03500b41ef15dc187da4008e85c2ac95bd2abb3f55b306e274b7ea32f3397ba1
BLAKE2b-256 checksum
How to use checksums
543c2549cb963d74f062ce04d9a11540b520f668d94c5aecf44a426e379709d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / cifmi-0.2.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL cifmi-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
Size 467.1 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6ce2ef504ac91eb4f7318f9945db38ad9e5289002df88806fb5af7bd51a84567
BLAKE2b-256 checksum
How to use checksums
82f4a015575254a4528cd68589cb1fb33b9cd6dce0283cc2791a46a17d5ed90e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for cifmi 0.2.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.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for cifmi-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

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