Pyalex is a Python wrapper for the OpenAlex API, providing convenient access to scholarly data (authors, works, institutions, etc.) from the OpenAlex database. Current version is 0.21, requiring Python >=3.8. It follows the OpenAlex API versioning and is actively maintained.
pip install pyalexVerified import paths — ran on the pinned version, not inferred.
Basic usage: fetch a single work by ID and perform a search query.
Add `.get()` to the end of your query chain, e.g., `Works().search('AI').get()`.Set `Config.email = 'your@email.com'` at the start of your script to get a higher rate limit and polite usage.
Replace `from pyalex import works; works()...` with `from pyalex import Works; Works()...`.
For combined filters, use `.filter()` with a single dict, e.g., `Works().filter({'year': 2020, 'is_oa': True}).get()`.Use `from pyalex import Works` instead of `from pyalex.Works import Works`.
Do not instantiate Config. Use `Config.email = '...'` directly.
Call `.get()` on the query object before iterating, e.g., `for work in Works().get():`.