Skip to main content

Add your description here

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 bytes
  • decode(data) - Decode bytes back into an ASE Atoms object
  • BytesIO(file, prefix) - LMDB-backed list-like storage for bytes dictionaries
  • ASEIO(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


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.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asebytes-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file asebytes-0.1.0.tar.gz.

File metadata

  • Download URL: asebytes-0.1.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for asebytes-0.1.0.tar.gz
Algorithm Hash digest
SHA256 01c2930299c63e84eb457438a353d3b3ce829a8db002c23ccd57786741cf5f8c
MD5 159ee80091e058f21d93215d4ac92971
BLAKE2b-256 d8a39a5e03e86a5310331c0b969a2ac130e2a9ef2e34d76d378012d2f1344fb3

See more details on using hashes here.

File details

Details for the file asebytes-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: asebytes-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for asebytes-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f5a2d64d1a6a6f632f1cf3247de147f36f5224a90a1395bd196f3e0b61a7380
MD5 92736b12cba0be2729b22bb92ff9ec86
BLAKE2b-256 4061396149c31b0e08714d7306bb0ef9944c12f39649b5226058520fc57ee7ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page