An async Python client for the arXiv API with enhanced performance and flexible configuration options.
⚠️ Warning: This project is currently in beta. Not recommended for production use.
- Asynchronous API calls for better performance
- Flexible search and download capabilities
- Customizable rate limiting and concurrent requests
- Simple error handling
pip install aioarxiv
import asyncio
from aioarxiv import ArxivClient
async def main():
async with ArxivClient() as client:
async for paper in client.search("quantum computing", max_results=1):
print(f"Title: {paper.title}")
print(f"Authors: {', '.join(a.name for a in paper.authors)}")
print(f"Summary: {paper.summary[:200]}...")
# Download PDF
file_path = await client.download_paper(paper)
print(f"Downloaded to: {file_path}")
if __name__ == "__main__":
asyncio.run(main())
from aioarxiv import ArxivConfig, ArxivClient
config = ArxivConfig(
rate_limit_calls=3, # Rate limit per window
rate_limit_period=1.0, # Window period in seconds
max_concurrent_requests=3 # Max concurrent requests
)
client = ArxivClient(config=config)
try:
async for paper in client.search("quantum computing"):
print(paper.title)
except SearchCompleteException:
print("Search complete")
- Python 3.9 or higher
MIT License (c) 2024 BalconyJH
- Documentation for aioarxiv is WIP
- ArXiv API