Repository navigation
Caching and Logins
A Client keeps successful reads in memory for a bit, so ten people checking the same account in a minute is one
request, not ten.
| Method | Kept for |
|---|---|
card(), character(), attendance()
|
1 minute |
monument(), profile()
|
5 minutes |
char_banners(), weapon_banners()
|
10 minutes |
enums() |
1 hour |
- errors are never cached
- the same request already in flight is shared instead of sent twice
-
check_in(), logins andaccount()always go to SKPORT
client = akef.Client(token, cache=False) # off
client.clear_cache() # resetThe cache lives in one Client, so keep the client around to get anything out of it.
A fresh client spends two requests logging in. With a file it saves the login after the first run and skips that next time.
client = akef.Client(token, login_file="skport_login.json")fresh client + card()
|
|
|---|---|
without login_file
|
~1.3 s |
| with it, after the first run | ~0.6 s |
The file only works for the token that wrote it. Keep it as private as the token.
SKPORT ends logins two ways, a stale signing key (http 401) or a dead login after a long idle (code 10001). The
client logs in again and repeats the request either way. If that fails too you get AuthError, the token itself
is dead then.
akef.Enka reuses Enka's answer for as long as Enka's own ttl says, usually a minute. Enka asks API users to
respect that. The game tables sit on disk and refresh after patches.
akef · MIT · not affiliated with Hypergryph or Gryphline
akef
- 🏠 Home
- 🚀 Getting Started
- 🎲 Pull History
- 📅 Daily Check-in
- 🧮 Enka and Final Stats
- 🤖 Bot Recipes
- ⚡ Caching and Logins
- ❓ FAQ
📖 Docs site
📦 PyPI
💻 Repo
🃏 akef-cards