LMDB-based storage for ASE.
Project description
asebytes
Efficient serialization and storage for ASE Atoms objects using LMDB.
API
encode(atoms)- Encode an ASE Atoms object to a dict of bytesdecode(data)- Decode bytes back into an ASE Atoms objectBytesIO(file, prefix)- LMDB-backed list-like storage for bytes dictionariesASEIO(file, prefix)- LMDB-backed list-like storage for ASE Atoms objects
Examples
from asebytes import ASEIO, BytesIO, encode, decode
import molify
# Generate conformers from SMILES
ethanol = molify.smiles2conformers("CCO", numConfs=100)
# Serialize/deserialize single molecule
data = encode(ethanol[0])
atoms_restored = decode(data)
# High-level: Store Atoms objects directly
db = ASEIO("conformers.lmdb")
db.extend(ethanol) # Add all conformers
mol = db[0] # Returns ase.Atoms
# Low-level: BytesIO stores serialized data
bytes_db = BytesIO("conformers.lmdb")
bytes_db.append(encode(ethanol[0])) # Manual serialization
data = bytes_db[0] # Returns dict[bytes, bytes]
mol = decode(data) # Manual deserialization
# ASEIO = BytesIO + automatic encode/decode
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
asebytes-0.1.5.tar.gz
(8.7 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
asebytes-0.1.5-py3-none-any.whl
(10.4 kB
view details)
File details
Details for the file asebytes-0.1.5.tar.gz.
File metadata
- Download URL: asebytes-0.1.5.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da62d22f4c37c6b1280edc8f9c8599241f49672212185db8b689ed8e87921edd
|
|
| MD5 |
7a38228944125584f906a316311b3d2e
|
|
| BLAKE2b-256 |
b5ad8b733ce43d08d74ca05758b347259a63a996a5c2dc8a55fe3ec59ad8c182
|
File details
Details for the file asebytes-0.1.5-py3-none-any.whl.
File metadata
- Download URL: asebytes-0.1.5-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ab335b59264bdc2375f24cec28d8c3f2c90f81419a11034066fad27129c5cd0
|
|
| MD5 |
93296965ac6a39f9562e0278392f6b0a
|
|
| BLAKE2b-256 |
958087149a17d0a5e32704f3b8e313ac2883a0dda80e61c65bdedd7611a5535d
|