SQLAlchemy query to return only n results?

for sqlalchemy >= 1.0.13 Use the limit method.

query(Model).filter(something).limit(5).all()

Alternative syntax

query.(Model).filter(something)[:5].all()