Serialize and deserialize molecular structure .xyz files.
Project description
serde_xyz
Serialize and deserialize molecular structure .xyz files.
pip install serde_xyz
(or uv add serde_xyz).
from serde_xyz import Atom, XYZ
atoms = [
Atom("O", 0, 0, 0),
Atom("H", 1, 0, 0),
Atom("H", 0, 1, 0),
]
xyz = XYZ(atoms, "this is a comment")
xyz
>>> XYZ(atoms=[
Atom { element: "O", x: 0.0, y: 0.0, z: 0.0 },
Atom { element: "H", x: 1.0, y: 0.0, z: 0.0 },
Atom { element: "H", x: 0.0, y: 1.0, z: 0.0 }
],
comment='this is a commment'
)
print(xyz)
>>> "3\n\nO 0.000000 0.000000 0.000000\nH 1.000000 0.000000 0.000000\nH 0.000000 1.000000 0.000000\n"
str(xyz)
>>> '"3\\n\\nO 0.000000 0.000000 0.000000\\nH 1.000000 0.000000 0.000000\\nH 0.000000 1.000000 0.000000\\n"'
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
serde_xyz-0.2.0.tar.gz
(12.2 kB
view details)
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 serde_xyz-0.2.0.tar.gz.
File metadata
- Download URL: serde_xyz-0.2.0.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1de27e4409896d8656eccea5755763e511b8af7a2dd0aa59a5a7215a070b0f3
|
|
| MD5 |
671261b7e3a1dbe1c4f3dfea705becab
|
|
| BLAKE2b-256 |
23ea3fc5b97f27a424e7a06af571f88b6248eafb3c858f7b5965c9f8cc58c36a
|
File details
Details for the file serde_xyz-0.2.0-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: serde_xyz-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 256.9 kB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08c63b6ac3cfd4a6eb2f7d60843ff186e9fcfaab315275b1929e10da970d1384
|
|
| MD5 |
a44ef065c4766028da542852800d7825
|
|
| BLAKE2b-256 |
ba93dc221de1a0ee552a1f2c69d0933afdcf0e658408b4fd96358c85df985fde
|