A validator for SMILE chemical language using SLY LaLR(1) parser. The grammar was based on the LL(1) parser from this article, and from the OpenSMILES Specification.
All the data related to the periodic table was retrived from the Bowserinator/Periodic-Table-JSON repo.
All the documentation is available in the Docs Page.
For installation make sure you have uv installed.
uv venv .venv
source .venv/bin/activate
uv pip install -e .
from validator.yacc import validate_smiles
print(validate_smiles("c1ccccc1"))
pytest