aleph-im / aleph-sdk-python

Python SDK library for the Aleph.im network
MIT License
3 stars 4 forks source link

Refactor: Filters were messy with duplication #58

Closed hoh closed 10 months ago

hoh commented 1 year ago

The management of query filters on API requests was coded inside other functions, hard to read and difficult to read.

Solution: Rely on a MessageQueryFilter object that manages the filters.

A new MessageQuery interface allows an easier handling of pagination, including iterating transparently iterating over messages with async for message in MessageQuery(query_filter=filter).

The interface of AlephClient.get_messages has been kept unchanged for now for compatibility reasons.

Inspired by #54 from @MHHukiewitz

hoh commented 10 months ago

@MHHukiewitz is this PR deprecated by #65 ?

MHHukiewitz commented 10 months ago

@hoh yes, it is. I am making an issue out of my last comment, so we can close this