cifkit


Namecifkit JSON
Version 1.0.6 PyPI version JSON
download
home_pageNone
SummaryA Python package for coordination geometry and atomic site analysis
upload_time2024-11-11 19:38:13
maintainerNone
docs_urlNone
authorNone
requires_python<3.13,>=3.10
licenseCopyright 2024 Sangjoon Lee Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords cif solid-state high-throughput crystallography
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # cifkit

[![CI](https://github.com/bobleesj/cifkit/actions/workflows/tests-on-pr.yml/badge.svg?branch=main)](https://github.com/bobleesj/cifkit/actions/workflows/tests-on-pr.yml)
[![codecov](https://codecov.io/gh/bobleesj/cifkit/graph/badge.svg?token=AN2YAC337A)](https://codecov.io/gh/bobleesj/cifkit)
![Python - Version](https://img.shields.io/pypi/pyversions/cifkit)
[![PyPi version](https://img.shields.io/pypi/v/cifkit.svg)](https://pypi.python.org/pypi/cifkit)

<a href="https://joss.theoj.org/papers/9016ae27b8c6fddffaae5aeb8be18d19"><img src="https://joss.theoj.org/papers/9016ae27b8c6fddffaae5aeb8be18d19/status.svg"></a>

![Logo light mode](docs/assets/img/logo-black.png#gh-light-mode-only "cifkit logo light")
![Logo dark mode](docs/assets/img/logo-color.png#gh-dark-mode-only "cifkit logo dark")

`cifkit` is designed to provide a set of fully-tested utility functions and
variables for handling large datasets, on the order of tens of thousands, of
`.cif` files.

## Features:

`cifkit` provides higher-level functions in just a few lines of code.

- **Coordination geometry** - `cifkit` provides functions for visualing
  coordination geometry from each site and extracts physics-based features like
  volume and packing efficiency in each polyhedron.
- **Atomic mixing** - `cifkit` extracts atomic mixing information at the bond
  pair level—tasks that would otherwise require extensive manual effort using
  GUI-based tools like VESTA, Diamond, and CrystalMaker.
- **Filter** - `cifkit` offers features for preprocessing. It systematically
  addresses common issues in CIF files from databases, such as incorrect loop
  values and missing fractional coordinates, by standardizing and filtering out
  ill-formatted files. It also preprocesses atomic site labels, transforming
  labels such as 'M1' to 'Fe1' in files with atomic mixing.
- **Sort** - `cifkit` allows you to copy, move, and sort `.cif` files based on
  attributes such as coordination numbers, space groups, unit cells, shortest
  distances, elements, and more.

### Example usage 1 - coordination geometry

The example below uses `cifkit` to visualize the polyhedron generated from each
atomic site based on the coordination number geometry.

```python
from cifkit import Cif

cif = Cif("your_cif_file_path")
site_labels = cif.site_labels

# Loop through each site label
for label in site_labels:
    # Dipslay each polyhedron, .png saved for each label
    cif.plot_polyhedron(label, is_displayed=True)
```

![Polyhedron generation](docs/assets/img/ErCoIn-polyhedron.png)

### Example Usage 2 - sort

The following example generates a distribution of structure.

```python
from cifkit import CifEnsemble

ensemble = CifEnsemble("your_folder_path_containing_cif_files")
ensemble.generate_structure_histogram()
```

![structure distribution](docs/assets/img/histogram-structure.png)

Basde on your visual histogram above, you can copy and move .cif files based on
specific attributes:

```python
# Return file paths matching structures either Co1.75Ge or CoIn2
ensemble.filter_by_structures(["Co1.75Ge", "CoIn2"])

# Return file path matching CeAl2Ga2
ensemble.filter_by_structures("CeAl2Ga2")
```

To learn more, please read the official documentation here:
https://bobleesj.github.io/cifkit.

## Quotes

Here is a quote illustrating how `cifkit` addresses one of the challenges
mentioned above.

> "I am building an X-Ray diffraction analysis (XRD) pattern visualization
> script for my lab using `pymatgen`. I feel like `cifkit` integrated really
> well into my existing stable of libraries, while surpassing some alternatives
> in preprocessing and parsing. For example, it was often unclear at what stage
> an error occurred—whether during pre-processing with `CifParser`, or XRD plot
> generation with `diffraction.core` in `pymatgen`. The pre-processing logic in
> `cifkit` was communicated clearly, both in documentation and in actual
> outputs, allowing me to catch errors in my data before it was used in my
> visualizations. I now use `cifkit` by default for processing CIFs before they
> pass through the rest of my pipeline." - Alex Vtorov `

## Documentation

- [Official documentation](https://bobleesj.github.io/cifkit)
- [Contribution guide](https://github.com/bobleesj/cifkit/blob/main/CONTRIBUTING.md)
- [MIT license](https://github.com/bobleesj/cifkit/blob/main/LICENSE)

## How to contribute

Here is how you can contribute to the `cifkit` project if you found it helpful:

- Star the repository on GitHub and recommend it to your colleagues who might
  find `cifkit` helpful as well.
  [![Star GitHub repository](https://img.shields.io/github/stars/bobleesj/cifkit.svg?style=social)](https://github.com/bobleesj/cifkit/stargazers)
- Create a new issue for any bugs or feature requests
  [here](https://github.com/bobleesj/cifkit/issues)
- Fork the repository and consider contributing changes via a pull request.
  [![Fork GitHub repository](https://img.shields.io/github/forks/bobleesj/cifkit?style=social)](https://github.com/bobleesj/cifkit/fork).
  Check out
  [CONTRIBUTING.md](https://github.com/bobleesj/cifkit/blob/main/CONTRIBUTING.md)
  for instructions.
- If you have any suggestions or need further clarification on how to use
  `cifkit`, please reach out to Bob Lee
  ([@bobleesj](https://github.com/bobleesj)).

## To render documentation

```bash
pip install -r requirements/docs.txt
mkdocs serve
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cifkit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.10",
    "maintainer_email": null,
    "keywords": "cif, solid-state, high-throughput, crystallography",
    "author": null,
    "author_email": "Sangjoon Lee <bobleesj@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/32/a9/a5b12d4b195f5de8e2f4f9c4a44d3b5f0e68a65e6a4feb6c48ba830e9be7/cifkit-1.0.6.tar.gz",
    "platform": null,
    "description": "# cifkit\n\n[![CI](https://github.com/bobleesj/cifkit/actions/workflows/tests-on-pr.yml/badge.svg?branch=main)](https://github.com/bobleesj/cifkit/actions/workflows/tests-on-pr.yml)\n[![codecov](https://codecov.io/gh/bobleesj/cifkit/graph/badge.svg?token=AN2YAC337A)](https://codecov.io/gh/bobleesj/cifkit)\n![Python - Version](https://img.shields.io/pypi/pyversions/cifkit)\n[![PyPi version](https://img.shields.io/pypi/v/cifkit.svg)](https://pypi.python.org/pypi/cifkit)\n\n<a href=\"https://joss.theoj.org/papers/9016ae27b8c6fddffaae5aeb8be18d19\"><img src=\"https://joss.theoj.org/papers/9016ae27b8c6fddffaae5aeb8be18d19/status.svg\"></a>\n\n![Logo light mode](docs/assets/img/logo-black.png#gh-light-mode-only \"cifkit logo light\")\n![Logo dark mode](docs/assets/img/logo-color.png#gh-dark-mode-only \"cifkit logo dark\")\n\n`cifkit` is designed to provide a set of fully-tested utility functions and\nvariables for handling large datasets, on the order of tens of thousands, of\n`.cif` files.\n\n## Features:\n\n`cifkit` provides higher-level functions in just a few lines of code.\n\n- **Coordination geometry** - `cifkit` provides functions for visualing\n  coordination geometry from each site and extracts physics-based features like\n  volume and packing efficiency in each polyhedron.\n- **Atomic mixing** - `cifkit` extracts atomic mixing information at the bond\n  pair level\u2014tasks that would otherwise require extensive manual effort using\n  GUI-based tools like VESTA, Diamond, and CrystalMaker.\n- **Filter** - `cifkit` offers features for preprocessing. It systematically\n  addresses common issues in CIF files from databases, such as incorrect loop\n  values and missing fractional coordinates, by standardizing and filtering out\n  ill-formatted files. It also preprocesses atomic site labels, transforming\n  labels such as 'M1' to 'Fe1' in files with atomic mixing.\n- **Sort** - `cifkit` allows you to copy, move, and sort `.cif` files based on\n  attributes such as coordination numbers, space groups, unit cells, shortest\n  distances, elements, and more.\n\n### Example usage 1 - coordination geometry\n\nThe example below uses `cifkit` to visualize the polyhedron generated from each\natomic site based on the coordination number geometry.\n\n```python\nfrom cifkit import Cif\n\ncif = Cif(\"your_cif_file_path\")\nsite_labels = cif.site_labels\n\n# Loop through each site label\nfor label in site_labels:\n    # Dipslay each polyhedron, .png saved for each label\n    cif.plot_polyhedron(label, is_displayed=True)\n```\n\n![Polyhedron generation](docs/assets/img/ErCoIn-polyhedron.png)\n\n### Example Usage 2 - sort\n\nThe following example generates a distribution of structure.\n\n```python\nfrom cifkit import CifEnsemble\n\nensemble = CifEnsemble(\"your_folder_path_containing_cif_files\")\nensemble.generate_structure_histogram()\n```\n\n![structure distribution](docs/assets/img/histogram-structure.png)\n\nBasde on your visual histogram above, you can copy and move .cif files based on\nspecific attributes:\n\n```python\n# Return file paths matching structures either Co1.75Ge or CoIn2\nensemble.filter_by_structures([\"Co1.75Ge\", \"CoIn2\"])\n\n# Return file path matching CeAl2Ga2\nensemble.filter_by_structures(\"CeAl2Ga2\")\n```\n\nTo learn more, please read the official documentation here:\nhttps://bobleesj.github.io/cifkit.\n\n## Quotes\n\nHere is a quote illustrating how `cifkit` addresses one of the challenges\nmentioned above.\n\n> \"I am building an X-Ray diffraction analysis (XRD) pattern visualization\n> script for my lab using `pymatgen`. I feel like `cifkit` integrated really\n> well into my existing stable of libraries, while surpassing some alternatives\n> in preprocessing and parsing. For example, it was often unclear at what stage\n> an error occurred\u2014whether during pre-processing with `CifParser`, or XRD plot\n> generation with `diffraction.core` in `pymatgen`. The pre-processing logic in\n> `cifkit` was communicated clearly, both in documentation and in actual\n> outputs, allowing me to catch errors in my data before it was used in my\n> visualizations. I now use `cifkit` by default for processing CIFs before they\n> pass through the rest of my pipeline.\" - Alex Vtorov `\n\n## Documentation\n\n- [Official documentation](https://bobleesj.github.io/cifkit)\n- [Contribution guide](https://github.com/bobleesj/cifkit/blob/main/CONTRIBUTING.md)\n- [MIT license](https://github.com/bobleesj/cifkit/blob/main/LICENSE)\n\n## How to contribute\n\nHere is how you can contribute to the `cifkit` project if you found it helpful:\n\n- Star the repository on GitHub and recommend it to your colleagues who might\n  find `cifkit` helpful as well.\n  [![Star GitHub repository](https://img.shields.io/github/stars/bobleesj/cifkit.svg?style=social)](https://github.com/bobleesj/cifkit/stargazers)\n- Create a new issue for any bugs or feature requests\n  [here](https://github.com/bobleesj/cifkit/issues)\n- Fork the repository and consider contributing changes via a pull request.\n  [![Fork GitHub repository](https://img.shields.io/github/forks/bobleesj/cifkit?style=social)](https://github.com/bobleesj/cifkit/fork).\n  Check out\n  [CONTRIBUTING.md](https://github.com/bobleesj/cifkit/blob/main/CONTRIBUTING.md)\n  for instructions.\n- If you have any suggestions or need further clarification on how to use\n  `cifkit`, please reach out to Bob Lee\n  ([@bobleesj](https://github.com/bobleesj)).\n\n## To render documentation\n\n```bash\npip install -r requirements/docs.txt\nmkdocs serve\n```\n",
    "bugtrack_url": null,
    "license": "Copyright 2024 Sangjoon Lee  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A Python package for coordination geometry and atomic site analysis",
    "version": "1.0.6",
    "project_urls": {
        "Changelog": "https://github.com/bobleesj/cifkit/blob/main/CHANGELOG",
        "Documentation": "https://bobleesj.github.io/cifkit",
        "Issues": "https://github.com/bobleesj/cifkit/issues",
        "Repository": "https://github.com/bobleesj/cifkit"
    },
    "split_keywords": [
        "cif",
        " solid-state",
        " high-throughput",
        " crystallography"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5fd41c467301712c5be630446b86c65b3f7a4abc0bdff42715d29ecd4bdd008f",
                "md5": "57754c601c1cabd2a21990073db05356",
                "sha256": "557300602fb287f9a2273f0ab2c2f11a5bdbda9771062cc6ce761188c7eaf59b"
            },
            "downloads": -1,
            "filename": "cifkit-1.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "57754c601c1cabd2a21990073db05356",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.10",
            "size": 1999521,
            "upload_time": "2024-11-11T19:38:11",
            "upload_time_iso_8601": "2024-11-11T19:38:11.007149Z",
            "url": "https://files.pythonhosted.org/packages/5f/d4/1c467301712c5be630446b86c65b3f7a4abc0bdff42715d29ecd4bdd008f/cifkit-1.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "32a9a5b12d4b195f5de8e2f4f9c4a44d3b5f0e68a65e6a4feb6c48ba830e9be7",
                "md5": "ed65e4939c2bbd624da89399d26fad54",
                "sha256": "93015ffcf523323e5bdc2e785005912affbd54cdeea60e23a70d81cde1ea0e22"
            },
            "downloads": -1,
            "filename": "cifkit-1.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "ed65e4939c2bbd624da89399d26fad54",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.10",
            "size": 4009285,
            "upload_time": "2024-11-11T19:38:13",
            "upload_time_iso_8601": "2024-11-11T19:38:13.078176Z",
            "url": "https://files.pythonhosted.org/packages/32/a9/a5b12d4b195f5de8e2f4f9c4a44d3b5f0e68a65e6a4feb6c48ba830e9be7/cifkit-1.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-11 19:38:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bobleesj",
    "github_project": "cifkit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cifkit"
}
        
Elapsed time: 0.39362s