Skip to main content

CIF/STAR file support for Python

Project description

Introduction

PyCIFRW provides support for reading and writing CIF (Crystallographic Information Format) files using Python. It was developed at the Australian National Beamline Facility (ANBF), run by the Australian Synchrotron Research Program (ASRP), as part of a larger project to provide CIF input/output capabilities for data collection. It is currently (Mar 2016) maintained and developed by James Hester with support from the Australian Nuclear Science and Technology Organisation (ANSTO).

Conformance

The CIF 1.1 and 2.0 working specifications were used as a reference.

PyCifRW has been tested on the IUCr sample CIF trip files located at http://www.iucr.org/iucr-top/cif/developers/trip and fails or successfully reads as it is supposed to (note that ciftest5 contains characters now forbidden in CIFs).

Supported Platforms

PyCIFRW is written entirely in Python. While this makes parsing of large CIF files rather slow, it should run wherever Python runs. The latest version has been tested on Linux and Windows 7.

The source code of a C extension module is also included in the distribution. This module accelerates CIF file reading. From time to time system-dependent installation packages are generated containing precompiled versions of this module.

Installation

See file INSTALLATION

Use

See the various files in the docs directory for details of the interface. Essentially, CIF files look like python dictionaries, with each entry in the dictionary corresponding to a data block. The blocks themselves are also dictionaries, with each data name being a single entry in the dictionary, so for example, cf[‘si_std’][‘_diffrn_meas_wavelength’] will return the value of _diffrn_meas_wavelength in the data block named si_std of the Cif file object cf.

Example

To read in a CIF:

from CifFile import CifFile cf = CifFile.ReadCif(‘jun_01_2.cif’)

to access information in a CIF

wav = cf[‘si_std’][‘_diffrn_meas_wavelength’]

to set a value

cf[‘si_std’][‘_diffrn_meas_wavelength’] = 1.54

Extra programs

The “Programs” directory contains program “validate_cif.py” which validates a data files against data dictionaries. Execute this file without arguments for a help message.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

PyCifRW-4.2.1.tar.gz (500.4 kB view details)

Uploaded Source

PyCifRW-4.2.1-py3.tar.gz (495.2 kB view details)

Uploaded Source

Built Distributions

PyCifRW-4.2.1-py3.5-linux-x86_64.egg (302.2 kB view details)

Uploaded Egg

PyCifRW-4.2.1-py2.7-linux-x86_64.egg (309.1 kB view details)

Uploaded Egg

PyCifRW-4.2.1-cp35-cp35m-manylinux1_x86_64.whl (154.1 kB view details)

Uploaded CPython 3.5m

File details

Details for the file PyCifRW-4.2.1.tar.gz.

File metadata

  • Download URL: PyCifRW-4.2.1.tar.gz
  • Upload date:
  • Size: 500.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyCifRW-4.2.1.tar.gz
Algorithm Hash digest
SHA256 8020b9a10ff11c7a564718908cdf38ea41135ac0ed45c95b36cc5ab86e2388c1
MD5 7a0f9ff93186f75ea0793c5c389ab5b5
BLAKE2b-256 c77b0dd9313b022067dfd270ced6c7d3e228499ca91d90f056ecb84afd8fe33b

See more details on using hashes here.

File details

Details for the file PyCifRW-4.2.1-py3.tar.gz.

File metadata

  • Download URL: PyCifRW-4.2.1-py3.tar.gz
  • Upload date:
  • Size: 495.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyCifRW-4.2.1-py3.tar.gz
Algorithm Hash digest
SHA256 619135f9056911e54489f9dce5fd8b2a6d5f7bc03c3faf9b01da7dcf134ed773
MD5 3bc6b0d2f23b170546dc7c194bc2991c
BLAKE2b-256 0168b75a924883f1b1b7b3c2d0c1fdc2cede03d255ce5287c4d9d8d17f6d517e

See more details on using hashes here.

File details

Details for the file PyCifRW-4.2.1-py3.5-linux-x86_64.egg.

File metadata

File hashes

Hashes for PyCifRW-4.2.1-py3.5-linux-x86_64.egg
Algorithm Hash digest
SHA256 26b30b68cf93cb3cbacffc077d79ac4f4ad4467ed9988d6085d0c30439b7eee2
MD5 396112e88ce2a1ded3e8ff10ab1d1629
BLAKE2b-256 afdc9149d83b145fd2b3989632a344cd24fa3204d48a470c10ebfa45830ae42f

See more details on using hashes here.

File details

Details for the file PyCifRW-4.2.1-py2.7-linux-x86_64.egg.

File metadata

File hashes

Hashes for PyCifRW-4.2.1-py2.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 1ba171f3862c457ba07e1443742b82957a6ea5da61d72eedf121c8d92e611c72
MD5 8a14d5c60195da776b2b720aeff72ab2
BLAKE2b-256 ff7f537dd03926f59a3cd65eb8c016bdf86fb68223be946bffce9deab1a075f6

See more details on using hashes here.

File details

Details for the file PyCifRW-4.2.1-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for PyCifRW-4.2.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6e9c8b2c90cf2d1e39508f5882a53274d8148b0a5efa49c79fb80a9635ba3c70
MD5 da78aae1145b34812c7eb266276a8d4a
BLAKE2b-256 675eddf1a7017f2fd6b04ef5a3a8ffd1cb838fb00cd2895f3ffb30802781d45f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page