https://github.com/sachaa-thanasius/ao3.py
An asynchronous scraper of Archive Of Our Own, made in Python.
https://github.com/sachaa-thanasius/ao3.py
Last synced: 3 months ago
JSON representation
An asynchronous scraper of Archive Of Our Own, made in Python.
- Host: GitHub
- URL: https://github.com/sachaa-thanasius/ao3.py
- Owner: Sachaa-Thanasius
- License: mit
- Created: 2023-08-06T20:17:44.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-17T18:06:25.000Z (4 months ago)
- Last Synced: 2025-03-17T19:25:12.707Z (4 months ago)
- Language: Python
- Homepage: https://ao3py.readthedocs.io
- Size: 131 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ao3.py
[](https://opensource.org/licenses/MIT)
[](https://github.com/microsoft/pyright/)
[](https://github.com/astral-sh/ruff)
[](https://github.com/ambv/black)
[](https://ao3py.readthedocs.io/en/latest/?badge=latest)An asynchronous scraper of Archive Of Our Own, made in Python.
## Features
- Uses Python's `async`/`await` syntax
- Fully type annotated## Documentation
[Official Documentation](https://ao3py.readthedocs.io/en/latest)
# Installation
**ao3.py currently requires Python 3.8 or higher.**
To install the library, run one of the following commands:
```sh
# Linux/macOS
python3 -m pip install -U "ao3.py @ git+https://github.com/Sachaa-Thanasius/ao3.py@main"# Windows
py -3 -m pip install -U "ao3.py @ git+https://github.com/Sachaa-Thanasius/ao3.py@main"
```## Quick Example
```python
import asyncio
import ao3async def main():
test_url = "https://archiveofourown.org/works/48637876"async with ao3.Client() as client:
work_id = ao3.utils.get_id_from_url(test_url)
work = await client.get_work(work_id)
print(work)
print(work.stats)asyncio.run(main)
```# To Do
- [ ] Properly implement and test user-based actions
- [ ] Logging in
- [ ] Giving kudos
- [ ] (Un)bookmarking
- [ ] (Un)subscribing
- [ ] Adding/Deleting comments
- [ ] (Un)collecting## Motivation
Honestly, I just wanted a fully typed Python AO3 scraper that I could use in asynchronous contexts. That's it.
# Acknowledgements
Thank you to:
- other AO3 scrapers like Armindo Flores's [ao3_api](https://github.com/ArmindoFlores/ao3_api),
- large projects like [discord.py](https://github.com/Rapptz/discord.py/) and [steam.py](https://github.com/Gobot1234/steam.py) for heavily inspiring the overall structure of this repo,
- and of course, aeroali, for everything.