Skip to content

Instantly share code, notes, and snippets.

@goraj
Last active September 2, 2019 07:27
Show Gist options
  • Save goraj/dd72a428364ae63cfa35b46fef51bb8f to your computer and use it in GitHub Desktop.
Save goraj/dd72a428364ae63cfa35b46fef51bb8f to your computer and use it in GitHub Desktop.
Using NextMoveSoftware Arthor in SQLAlchemy
def get_matching_buildingblocks(
db: Session,
smarts: str,
limit: int,
) -> List[BuildingBlock]:
r = db.query(BBSelect) \
.filter(func.arthor.matches(column('atdb'), smarts)) \
.limit(limit) \
.all()
return [
BBSelection.BBSelect.from_orm(elem)
for elem in r
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment