maxmind / MaxMind-DB-Reader-python

Python MaxMind DB reader extension
https://maxminddb.readthedocs.org/
Apache License 2.0
176 stars 37 forks source link

Iterating over the whole database is broken #122

Closed malopez16 closed 10 months ago

malopez16 commented 10 months ago

You may also iterate over the whole database. The Reader class implements the iter method that returns an iterator. This iterator yields a tuple containing the network and the record.

This doesn't work. The Reader class doesn't have __iter__.

Simple test:

import maxminddb

with maxminddb.open_database('GeoLite2-City.mmdb') as reader:
    for network, record in reader:
        print(network, record)

python3 maxmind_processor.py Traceback (most recent call last): File "/Users/mlopez/bin/utils/maxmind_processor.py", line 4, in <module> for network, record in reader: TypeError: 'Reader' object is not iterable

Version: pip freeze > maxminddb==2.4.0

Is the pip package correctly compiled?

oschwald commented 10 months ago

We have not done a release with this feature yet.

malopez16 commented 10 months ago

Shouldn't main be up to date with the current release?

oschwald commented 10 months ago

No, main is where we merge changes to. When we are ready to do a release, we will do it from main and tag it. If you want to see the code for the latest release, please look at the v2.4.0 tag.