Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukasturcani/atomlite
Store your chemical data in a single file!
https://github.com/lukasturcani/atomlite
cheminformatics chemistry database
Last synced: about 2 months ago
JSON representation
Store your chemical data in a single file!
- Host: GitHub
- URL: https://github.com/lukasturcani/atomlite
- Owner: lukasturcani
- License: other
- Created: 2023-05-02T16:37:54.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-25T10:26:24.000Z (8 months ago)
- Last Synced: 2024-05-01T15:31:42.526Z (8 months ago)
- Topics: cheminformatics, chemistry, database
- Language: Python
- Homepage: https://atomlite.readthedocs.io
- Size: 102 KB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
:Author: Lukas Turcani
:Docs: https://atomlite.readthedocs.io========
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_... _SQLite: https://docs.python.org/3/library/sqlite3.html
.. _chemicalite: https://github.com/rvianello/chemicaliteInstallation
============.. code-block:: bash
pip install atomlite
Quickstart
==========You can see a lot more examples in our docs_ but here is a taste of using
AtomLite:.. code-block:: python
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}.. code-block:: python
db.get_property_df(["$.prop1", "$.prop2"])
::
shape: (2, 3)
┌────────┬─────────┬─────────┐
│ key ┆ $.prop1 ┆ $.prop2 │
│ --- ┆ --- ┆ --- │
│ str ┆ str ┆ i64 │
╞════════╪═════════╪═════════╡
│ first ┆ hi ┆ 100 │
│ second ┆ thing ┆ 203 │
└────────┴─────────┴─────────┘.. _docs: https://atomlite.readthedocs.io