Python client for the FFLogs v2 API
Project description
fflogsapi
fflogsapi is a lazy Python 3 client for fflogs' v2 API with query caching functionality.
Features
- Retrieve information from fflogs' v2 GraphQL API
- Lazy evaluation
- Queries for data are not executed until it is explicitly needed
- Query caching
- Requesting the same data twice will instead fetch the result from cache
- Customizable cache lifetime and options to ignore cached results
Example usage
from config import CLIENT_ID, CLIENT_SECRET
from fflogsapi.client import FFLogsClient
client = FFLogsClient(CLIENT_ID, CLIENT_SECRET)
report = client.get_report('rGARYmQwTKbahXz9')
for fight in report:
print(f'Fight #{fight.fight_id}:', fight.name(), f'- Kill: {fight.is_kill()}')
pot_table = fight.fight_table(filters={'sourceAurasPresent': 'Medicated'})
potted_damage = 0
for damage in pot_table['damageDone']:
potted_damage += damage['total']
print(f'Damage done under pots: {potted_damage}')
if not fight.is_kill():
print(f'Percentage reached: {fight.percentage()}')
client.close()
client.save_cache()
from config import CLIENT_ID, CLIENT_SECRET
from fflogsapi.client import FFLogsClient
client = FFLogsClient(CLIENT_ID, CLIENT_SECRET)
for page in client.report_pages(filters={ 'guildID': 80551 }):
print(f'Reports in page: {page.count()}')
for report in page:
print(report.title(), f'Duration: {report.duration()}')
client.close()
client.save_cache()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fflogsapi-0.3.3.tar.gz
(29.5 kB
view hashes)
Built Distribution
fflogsapi-0.3.3-py3-none-any.whl
(35.8 kB
view hashes)
Close
Hashes for fflogsapi-0.3.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90311a78d2e8be1fea27612e909fd1f5545d8a73cb9fc6b3cf0b052e682e1122 |
|
MD5 | ad1a070d76f0c1073f61831407c28782 |
|
BLAKE2b-256 | 917952b994d9eff358cd358a8332c7c7ed88298c7e6915f1e33e4a11ecb00562 |