A SQLite chemical database.
Project description
AtomLite
AtomLite is a Python library for simple molecular database on top of SQLite.
For an alternative to AtomLite, which provides stronger integration with RDKit, and a greater focus on cheminformatics, see chemicalite.
Installation
pip install atomlite
Quickstart
You can see a lot more examples in our docs but here is a taste of using AtomLite:
import atomlite
import rdkit.Chem as rdkit
# Create a database.
db = atomlite.Database("molecules.db")
# Create database entries.
entry1 = atomlite.Entry.from_rdkit("first", rdkit.MolFromSmiles("C"), {"prop1": "hi", "prop2": 100})
entry2 = atomlite.Entry.from_rdkit("second", rdkit.MolFromSmiles("CN"), {"prop1": "thing", "prop2": 203})
# Add entries to database.
db.add_entries([entry1, entry2])
# Retrieve entries from database.
for entry in db.get_entries(["first", "second"]):
molecule = atomlite.json_to_rdkit(entry.molecule)
print(entry.properties)
{'prop1': 'hi', 'prop2': 100} {'prop1': 'thing', 'prop2': 203}
db.get_property_df(["$.prop1", "$.prop2"])
shape: (2, 3) ┌────────┬─────────┬─────────┐ │ key ┆ $.prop1 ┆ $.prop2 │ │ --- ┆ --- ┆ --- │ │ str ┆ str ┆ i64 │ ╞════════╪═════════╪═════════╡ │ first ┆ hi ┆ 100 │ │ second ┆ thing ┆ 203 │ └────────┴─────────┴─────────┘
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
atomlite-4.4.5.tar.gz
(37.9 kB
view details)
Built Distribution
File details
Details for the file atomlite-4.4.5.tar.gz
.
File metadata
- Download URL: atomlite-4.4.5.tar.gz
- Upload date:
- Size: 37.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5d75b8d885f7ceda3e16c91ea8503bd1192053e9855fe7c8b610eaef20762d1 |
|
MD5 | 18ad3283971b85419eebd3211b9519fe |
|
BLAKE2b-256 | 010c5b987431040d190f0dc8d6356470b9f6886ebbfe848ff03b45a6461cbdbc |
File details
Details for the file atomlite-4.4.5-py3-none-any.whl
.
File metadata
- Download URL: atomlite-4.4.5-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb071d1e3fec0e333702f319b981f7ffd92bb74b2f9f004f92b757a9cb3cd035 |
|
MD5 | 31049583d0aa7eaff777dbc50b41288b |
|
BLAKE2b-256 | 333eb2022f973a096c54ad3fab4c4173d4a3be88b23376d343dd37c5be0c6a93 |