pyinat / pyinaturalist

Python client for iNaturalist
https://pyinaturalist.readthedocs.io
MIT License
130 stars 17 forks source link

Allow setting lockfile path used for multiprocess rate limiting #552

Closed JWCook closed 5 months ago

JWCook commented 5 months ago

Example:

from pyinaturalist import ClientSession, FileLockSQLiteBucket
session = ClientSession(
    bucket_class=FileLockSQLiteBucket,
    lock_path='/tmp/pyinat.lock',
    ratelimit_path='/tmp/pyinat_ratelimit.db',
)

Note that pyinaturalist.FileLockSQLiteBucket is a modified version of pyrate_limiter.FileLockSQLiteBucket that supports setting the lock path.