SELFIES (SELF-referencIng Embedded Strings) is a general-purpose, sequence-based, robust representation of semantically constrained graphs, primarily used for molecular structures in cheminformatics and ML. Current version 2.2.0, releases every few months.
pip install selfiesVerified import paths — ran on the pinned version, not inferred.
Basic encode/decode a SMILES string.
Use encoder(smiles, strict=False) to mimic old behavior, or ensure input SMILES are valid.
Upgrade to Python >=3.7.
Use from selfies import encoder, decoder directly.
Either fix the SMILES or pass strict=False to encoder.
Upgrade selfies: pip install --upgrade selfies