Package for reading of .xyz files and constructing of molecular graphs from atomic coordinates.
Project description
xyz2graph
A lightweight Python package for reading XYZ files and creating interactive molecular visualizations. Convert molecular structures into 3D visualizations using Plotly or analyze them as NetworkX graphs.
Features
- Read and parse XYZ molecular structure files
- Generate interactive 3D molecular visualizations using Plotly
- Convert molecular structures to NetworkX graphs for analysis
- Command-line interface for quick visualizations
Documentation
Full documentation is available at https://zotko.github.io/xyz2graph
Installation
pip install xyz2graph
Requirements
- Python 3.8+
- NumPy
- Plotly
- NetworkX
Usage
Basic Usage
from xyz2graph import MolGraph
# Create molecular graph and read XYZ file
mg = MolGraph()
mg.read_xyz('molecule.xyz')
# Generate interactive 3D visualization
fig = mg.to_plotly()
fig.show()
# Convert to NetworkX graph
G = mg.to_networkx()
Command Line
# Save visualization as HTML
xyz2graph molecule.xyz
# Specify output file
xyz2graph molecule.xyz --output visualization.html
# Open directly in browser
xyz2graph molecule.xyz --browser
Examples
Example XYZ files can be found in the examples
directory.
Contributing
I welcome contributions! Please see the CONTRIBUTING.md file for guidelines on how to make contributions to this project.
License
This project is licensed under the ISC License - see the LICENSE file for details.
Citation
If you use xyz2graph in your research, please cite:
@misc{zotko2018xyz2graph,
author = {Zotko, Mykola},
title = {xyz2graph: Molecular Structure Visualization},
year = {2018},
publisher = {GitHub},
url = {https://github.com/zotko/xyz2graph}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file xyz2graph-3.2.0.tar.gz
.
File metadata
- Download URL: xyz2graph-3.2.0.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8eda1e7fe126c2a805b46292a15c46cc7b9f064fdc6bc9dffd2fbc120698c71 |
|
MD5 | 08e25f1a0c7b6ebd02517ea001713a8e |
|
BLAKE2b-256 | 58abdf9c8d03425216df5b8b1632ea5014da7edf2aa632bbdfa1551a86adb1b9 |
Provenance
The following attestation bundles were made for xyz2graph-3.2.0.tar.gz
:
Publisher:
publish.yml
on zotko/xyz2graph
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
xyz2graph-3.2.0.tar.gz
- Subject digest:
e8eda1e7fe126c2a805b46292a15c46cc7b9f064fdc6bc9dffd2fbc120698c71
- Sigstore transparency entry: 148713480
- Sigstore integration time:
- Predicate type:
File details
Details for the file xyz2graph-3.2.0-py3-none-any.whl
.
File metadata
- Download URL: xyz2graph-3.2.0-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c3edd53a0e3ce80db62fecc77b2b6033bdef81a05f1ca20a7cd6488baf7c3ad |
|
MD5 | 5407990b45ee0c6e8dd5cbf3e6e55f93 |
|
BLAKE2b-256 | a7aad0b32b25cb8a1fedc8e5b8489d6591e38055a1e74395249523e96ffc3ecd |
Provenance
The following attestation bundles were made for xyz2graph-3.2.0-py3-none-any.whl
:
Publisher:
publish.yml
on zotko/xyz2graph
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
xyz2graph-3.2.0-py3-none-any.whl
- Subject digest:
7c3edd53a0e3ce80db62fecc77b2b6033bdef81a05f1ca20a7cd6488baf7c3ad
- Sigstore transparency entry: 148713483
- Sigstore integration time:
- Predicate type: