Skip to main content

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 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.1.tar.gz (7.2 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.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for asebytes-0.1.1.tar.gz
Algorithm Hash digest
SHA256 90ca1fe3d3094843620960ff7d666df3ecd6b45628fb551c5eb05341fe1794c2
MD5 1c367e9b26eb33feaf1c7ef970234e9c
BLAKE2b-256 bca41e7a224c02dcd065876c8878aa3b10c9b207448d9e67be854634222b9cfd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for asebytes-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ac3feaed153285180166c32a15c3ea180024ef032cde366c96ba5cc3f2eb9072
MD5 11b4a19f40ac9cff196bf21cc702f23a
BLAKE2b-256 9980b07ed66302e5122506781a1e860d5211f1c233254cee34f7bbaa00ee7771

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