Package for reading of .xyz files and constructing of molecular graphs from atomic coordinates.
Project description
xyz2graph
A Python package to convert XYZ molecular files into NetworkX graphs with interactive 3D visualization using Plotly.
Features
- Interactive 3D molecular visualization using Plotly
- NetworkX graph conversion for analysis
- Command-line interface
Installation
pip install xyz2graph
Requirements
- Python 3.9+
- Dependencies: NumPy, Plotly, NetworkX
Quick Start
import numpy as np
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()
G.nodes[0]
# Output: {'element': 'C', 'xyz': (0.1718396797, 1.4440789224, 0.2473852864)}
G.edges[(0, 1)]
# Output: {'length': np.float64(1.49623)}
Command Line
# Save visualization as HTML
xyz2graph molecule.xyz
# Specify output file
xyz2graph molecule.xyz --output viz.html
# Open directly in browser
xyz2graph molecule.xyz --browser
Documentation
Read the documentation for guides, API reference, and examples.
Help & Discussion
🪲 Report a bug
✨ Request a feature
Contributing
Contributions are welcome! Please see the Contributing Guide for guidelines.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xyz2graph-3.5.1.tar.gz.
File metadata
- Download URL: xyz2graph-3.5.1.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea49072e7818387a2dfce70030b8a2456954721ef09effb7c720c048d7cb7b71
|
|
| MD5 |
b5a3cb448737986a5479941d20f43bbd
|
|
| BLAKE2b-256 |
9536eb59613b201a75b705417510aa0929ef6b0b2b0c27c32bdf219f38d37b1c
|
Provenance
The following attestation bundles were made for xyz2graph-3.5.1.tar.gz:
Publisher:
publish.yml on zotko/xyz2graph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xyz2graph-3.5.1.tar.gz -
Subject digest:
ea49072e7818387a2dfce70030b8a2456954721ef09effb7c720c048d7cb7b71 - Sigstore transparency entry: 1477890829
- Sigstore integration time:
-
Permalink:
zotko/xyz2graph@13459e49e807a983980428c125e7b506dc8e8241 -
Branch / Tag:
refs/tags/v3.5.1 - Owner: https://github.com/zotko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@13459e49e807a983980428c125e7b506dc8e8241 -
Trigger Event:
push
-
Statement type:
File details
Details for the file xyz2graph-3.5.1-py3-none-any.whl.
File metadata
- Download URL: xyz2graph-3.5.1-py3-none-any.whl
- Upload date:
- Size: 21.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8915083ad7c2a2188f923526d5d6f27e0682b2da7a959936710e7cbe86f9be04
|
|
| MD5 |
6e51121cb438ed38c7520b9907ac4a5a
|
|
| BLAKE2b-256 |
a0f298eeac2f7a602348cefa2256b98cb8dc8e644fff8c1f639c6b917527e30c
|
Provenance
The following attestation bundles were made for xyz2graph-3.5.1-py3-none-any.whl:
Publisher:
publish.yml on zotko/xyz2graph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xyz2graph-3.5.1-py3-none-any.whl -
Subject digest:
8915083ad7c2a2188f923526d5d6f27e0682b2da7a959936710e7cbe86f9be04 - Sigstore transparency entry: 1477890922
- Sigstore integration time:
-
Permalink:
zotko/xyz2graph@13459e49e807a983980428c125e7b506dc8e8241 -
Branch / Tag:
refs/tags/v3.5.1 - Owner: https://github.com/zotko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@13459e49e807a983980428c125e7b506dc8e8241 -
Trigger Event:
push
-
Statement type: