Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Convert an xyz file into a molecular graph and create a 3D visualisation of the graph.

License

NotificationsYou must be signed in to change notification settings

zotko/xyz2graph

Repository files navigation

PyPI versionPython VersionLicenseDocumentationDOIBinder

PyPI DownloadsGitHub StarsGitHub Forks

Stand With Ukraine

A Python package to convert XYZ molecular files into NetworkX graphs with interactive 3D visualization using Plotly.

Try it live 🚀

Features

Installation

pip install xyz2graph

Requirements

  • Python 3.8+
  • Dependencies: NumPy, Plotly, NetworkX

Quick Start

importnumpyasnpfromxyz2graphimportMolGraph# Create molecular graph and read XYZ filemg=MolGraph()mg.read_xyz('molecule.xyz')# Generate interactive 3D visualizationfig=mg.to_plotly()fig.show()# Convert to NetworkX graphG=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 HTMLxyz2graph molecule.xyz# Specify output filexyz2graph molecule.xyz --output viz.html# Open directly in browserxyz2graph molecule.xyz --browser

Documentation

Read thedocumentation for guides, API reference, and examples.

Help & Discussion

🪲Report a bug
Request a feature

Contributing

Contributions are welcome! Please see theContributing Guide for guidelines.


[8]ページ先頭

©2009-2025 Movatter.jp