mozilla-services / crashstats-tools

Command line tools and library for interacting with Crash Stats (https://crash-stats.mozilla.org/)
Mozilla Public License 2.0
9 stars 0 forks source link

Move API functions to libcrashstats library (#67) #129

Closed willkg closed 6 months ago

willkg commented 6 months ago

With crashstats-tools installed, you can write scripts using a (slightly) more convenient libcrashstats library:

$ python
Python 3.10.12 (main, Jul  3 2023, 09:21:40) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> for hit in supersearch({"_columns": "uuid"}, num_results=10):
...     print(hit)
... 
{'uuid': '1c37da97-43c3-4685-bfe2-56b230240405'}
{'uuid': 'adda4189-9317-4bcb-a76f-e0d3e0240405'}
{'uuid': '53ea01ac-f50c-4f29-a13c-a74730240405'}
{'uuid': 'cd8354c1-7277-47e3-9689-79aa30240405'}
{'uuid': '22f3fa10-14b5-4933-a759-e11980240405'}
{'uuid': '7a1bfaf4-6121-465a-82d6-747c50240405'}
{'uuid': '823d09b9-d552-4b07-8f1d-90f4d0240405'}
{'uuid': '545b9a88-0052-4d44-8dac-37f470240405'}
{'uuid': '59eaf882-6552-4c78-858e-962ad0240405'}
{'uuid': 'cb1c36d2-7265-45d4-8947-960bb0240405'}
>>>

They all handle retrying, rate-limiting, etc.

Fixes #67.