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.
Metadata
Release files for xyz2graph 3.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xyz2graph-3.5.1.tar.gz | 1.4 MB | With provenance | Details for xyz2graph-3.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xyz2graph-3.5.1-py3-none-any.whl | Python 3 | none | any | Details for xyz2graph-3.5.1-py3-none-any.whl |
Total release size: 1.4 MB
Release files / xyz2graph-3.5.1.tar.gz
| Download URL | xyz2graph-3.5.1.tar.gz |
|---|---|
| Size | 1.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea49072e7818387a2dfce70030b8a2456954721ef09effb7c720c048d7cb7b71
|
|
BLAKE2b-256 checksum How to use checksums |
9536eb59613b201a75b705417510aa0929ef6b0b2b0c27c32bdf219f38d37b1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 8, 2026.
Transparency logRelease files / xyz2graph-3.5.1-py3-none-any.whl
| Download URL | xyz2graph-3.5.1-py3-none-any.whl |
|---|---|
| Size | 21.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8915083ad7c2a2188f923526d5d6f27e0682b2da7a959936710e7cbe86f9be04
|
|
BLAKE2b-256 checksum How to use checksums |
a0f298eeac2f7a602348cefa2256b98cb8dc8e644fff8c1f639c6b917527e30c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 8, 2026.
Transparency logSecurity for xyz2graph 3.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for xyz2graph-3.5.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.