Skip to main content

Package for reading of .xyz files and constructing of molecular graphs from atomic coordinates.

Project description

xyz2graph

PyPI version Python Version License Documentation

PyPI Downloads GitHub Stars GitHub Forks

"Buy Me A Coffee" Stand With Ukraine

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

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation

If you use xyz2graph in your research, please cite:

@misc{xyz2graph,
  author       = {Zotko, Mykola},
  title        = {xyz2graph: Molecular Structure Visualization},
  year         = {2018},
  publisher    = {GitHub},
  url          = {https://github.com/zotko/xyz2graph}
}

Project details


Download files

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

Source Distribution

xyz2graph-3.1.0.tar.gz (668.9 kB view details)

Uploaded Source

Built Distribution

xyz2graph-3.1.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file xyz2graph-3.1.0.tar.gz.

File metadata

  • Download URL: xyz2graph-3.1.0.tar.gz
  • Upload date:
  • Size: 668.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for xyz2graph-3.1.0.tar.gz
Algorithm Hash digest
SHA256 03e0db7a4e0c42c70a4366c505818d722ab2f4504f36517d3a3df632fc8fe73f
MD5 432da95431daac6372da56612da1789b
BLAKE2b-256 95e9dbb7bbf1332f7b407f506af56e18cf4fa7ce4fe6b122d9ae39c1660fd120

See more details on using hashes here.

Provenance

The following attestation bundles were made for xyz2graph-3.1.0.tar.gz:

Publisher: publish.yml on zotko/xyz2graph

Attestations:

File details

Details for the file xyz2graph-3.1.0-py3-none-any.whl.

File metadata

  • Download URL: xyz2graph-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for xyz2graph-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0529a6dac4f90f76365dfadfdab01e460d8e9ee972d476d0a9b68db3236871fa
MD5 3a6d568ed1daebd9438af49fd89e7be3
BLAKE2b-256 ae3859361ab33bc8b5022d4ac9e0c769781f798fce53292acf59e01f032bf6dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for xyz2graph-3.1.0-py3-none-any.whl:

Publisher: publish.yml on zotko/xyz2graph

Attestations:

Supported by

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