akef
Async Python wrapper for Arknights: Endfield. Your SKPORT account card, operators with gear, pull history, endgame records, daily check-in and the wiki. Also public Enka profiles by UID, and final stats like the ones on the in-game stat screen for any operator.
Install
pip install akef
Python 3.10+. Full docs in docs/, a script for every feature in
examples/.
Usage
import asyncio
import akef
async def main():
async with akef.Client("your account token") as client:
card = await client.card()
print(card.name, card.base.level, card.base.world_level)
print(f"sanity {card.stamina.current}/{card.stamina.max}")
for op in card.chars:
print(op.rarity, op.name, op.level, op.weapon.name)
asyncio.run(main())
Login, request signing and logging back in when the session runs out, all handled for you.
Methods
Everything comes back as a pydantic model. Fields SKPORT adds later still show up in model_extra. Pass
raw=True to any of them to get the plain API dict instead.
| Method | Gives you |
|---|---|
card(uid=None) |
profile, operators with gear, sanity, dailies, battle pass, regions, dijiang, contracts, war echoes |
character(who, uid=None) |
one operator or a list, by name (any case or spacing) or SKPORT id |
monument(uid=None) |
endgame events: stages, rules, enemies, best clear team and time, medals |
contract(uid=None) |
current Contingency Contract: every run with its team, all indicators with their effect text, enemies |
pulls(uid=None, after=None, since=None) |
whole pull history with pity per banner |
inventory(uid=None) |
every owned operator, weapon, gear piece and tactical, with counts |
attendance(uid=None) |
this month's check-in calendar and rewards |
check_in(uid=None) |
claims today's check-in, raises AlreadyCheckedIn if its done |
news() |
the in-game notice board |
wiki(kind) / wiki_item(id) |
SKPORT's official database |
wiki_index() |
every wiki item by id, for naming the materials a page links to |
char_banners() / weapon_banners() |
current banners |
roles() / role(uid=None) |
Endfield accounts on the login |
enums() |
game enums: professions, elements, rarities... |
profile() |
SKPORT user profile |
account() |
Gryphline account info |
uid=None means the default account on the login.
Housekeeping
| Method | |
|---|---|
login() |
log in now instead of on the first request |
refresh() |
get a new signing key, akef does this by itself when it goes stale |
clear_cache() |
forget cached reads |
close() |
close the session, or just use async with |
Wiki kinds and readable pages
operators, weapons, threats, gear, facilities, items, essence, valuables
ops = await client.wiki("operators")
arcane = await client.wiki_item(next(o for o in ops if o.name == "Arcane").id)
print(arcane.description)
page = akef.wiki_page(arcane, await client.wiki_index()) # quote, bio, skills, talents, lore...
print(page.quote, [s.name for s in page.skills])
The raw page is a deep tree of blocks, wiki_page() turns it into plain fields so you dont dig through it.
Enka and final stats
SKPORT only says what an operator has equipped, not the numbers on their stat screen. akef.Enka works them
out same way enka.network does, from Enka's public game data. We checked them against the site and the game,
they match.
async with akef.Enka() as enka:
profile = await enka.profile(4727743200) # any public UID, no token needed
si = profile.build("Si")
print(si.stats.hp, si.stats.atk, si.stats.crit_rate)
Enka only sees the 4 operators in the showcase. With a SKPORT card you get anyone on the account:
async with akef.Client(token) as client, akef.Enka() as enka:
card = await client.card()
build = await enka.build(card, "Arcane")
print(build.stats.atk, build.gear[0].lines)
| Method | Gives you |
|---|---|
profile(uid) |
showcased operators with final stats, plus the player's profile |
build(card, name) |
final stats for any operator on a SKPORT card |
player(card) |
the whole roster as a profile |
update() |
pull new game tables after a patch |
clear_cache() |
forget cached Enka answers |
First call downloads Enka's game tables (few MB) and keeps them on disk. After a patch they refresh by themselves when something new shows up. More in docs/enka.md, and how the numbers got checked in docs/stats.md.
Pull history
pulls = await client.pulls()
for p in pulls.pity():
print(p.name, f"{p.since_six}/{p.hard}")
pulls.save("pulls.json") # or pulls.csv
old = akef.Pulls.load("pulls.json")
newer = await client.pulls(since=old) # only fetches whats new and merges it in
recent = await client.pulls(after=date(2026, 11, 1))
SKPORT hands out pulls 5 a page, so first full grab of a big account takes a while. Save it and pass since=
next time. Passing another UID's saved pulls raises a ValueError, so two accounts never get mixed.
pulls.operators, pulls.weapons and pulls.gifts hold the pulls. pulls.banner("standard") and
pulls.weapon_banner(pool_id) filter one banner, pulls.to_csv() and pulls.to_json() give the text without
saving.
How pity is counted
| Banner | Hard pity | Featured |
|---|---|---|
| Limited operators | 80, shared across limited banners | 120, per banner |
| Standard | 80 | 300 |
| Beginner | 50 | |
| Weapons | 40 | 80 |
Free urgent recruitment pulls dont move pity.
Getting a token
While signed in to skport.com, open
https://web-api.skport.com/cookie_store/account_token. You get back something like
{"code":0,"data":{"content":"..."}}, the content string is your token.
That token is a full login for your account, dont share it with anyone.
Caching and logins
Reads stay in memory for a short while, so a bot where ten people check the same account sends one request, not ten. If the same request is already on its way, other callers wait for it instead of sending their own.
| What | Kept for |
|---|---|
card(), character(), attendance(), inventory() |
1 minute |
monument(), contract(), profile() |
5 minutes |
Enka.profile() |
as long as Enka's own ttl says, about a minute |
| banners | 10 minutes |
enums(), wiki |
1 hour |
Errors are never cached and check_in() clears the cached calendar.
client = akef.Client(token, cache=False) # no cache
client.clear_cache() # fresh data next call
client = akef.Client(token, login_file="skport_login.json") # keep the login between runs
client = akef.Client(token, debug=True) # log every request
Every new Client logs in first, thats two requests. With login_file it saves the login and your account list,
so a restart only pays for what you ask. If SKPORT expires it, akef logs in again by itself and updates the file.
Keep that file private, it works like the token. Debug logs only show the path, never tokens or query strings.
Errors
try:
card = await client.card()
except akef.AuthError:
... # token is dead, get a new one
except akef.NoRoleError:
... # no Endfield account on this login
except akef.AkefError as e:
print(e.code, e.message)
All errors
| Error | When |
|---|---|
AkefError |
base of all of them, has .code and .message |
AuthError |
token rejected or expired |
NoRoleError |
no Endfield account bound to the login |
NetworkError |
couldnt reach SKPORT or Enka |
APIError |
SKPORT said no for some other reason |
AlreadyCheckedIn |
check_in() when today is already claimed |
UnknownCharacter |
character() or Enka.build() with a name that doesnt match anyone |
PlayerNotFound |
Enka doesnt know the UID |
ShowcaseEmpty |
Enka player has nothing in their showcase |
MissingGameData |
something from a new patch isnt in Enka's data yet |
GameDataError |
saved game tables are broken, await enka.update() |
Examples
| Script | Shows |
|---|---|
card.py |
the basics off your account card |
operators.py |
every operator with skills, weapon and gear |
character.py |
look up operators by name |
pulls.py |
pull history, pity, save, load, csv |
monument.py |
monument events and clear teams |
contract.py |
contract runs, teams and indicators |
endgame.py |
contracts and war echoes off the card |
inventory.py |
everything you own |
attendance.py, check_in.py |
daily check-in |
banners.py |
current banners |
news.py |
notice board |
wiki.py |
the official wiki, and pages made readable |
enka.py |
a public profile by UID with final stats |
final_stats.py |
final stats and gear lines for your whole roster |
world.py |
regions and dijiang |
caching.py |
cache, login file and debug logs |
errors.py |
catching errors |
raw.py |
plain API dicts |
roles.py, account.py, profile.py, enums.py |
account side stuff |
They read the token from SKPORT_TOKEN or ~/.skport_token, except enka.py which only needs a UID.
Image cards
Want all this as pictures? akef-cards draws it: operator builds, profiles, pull history, endgame and more. akef gets the data, akef-cards only draws.
License
MIT. Game data for the stat math comes from Enka.Network, thanks enka. Not affiliated with Hypergryph or Gryphline.
Metadata
Release files for akef 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| akef-0.3.0.tar.gz | 54.5 kB | Without provenance | Details for akef-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| akef-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for akef-0.3.0-py3-none-any.whl |
Total release size: 102.6 kB
Release files / akef-0.3.0.tar.gz
| Download URL | akef-0.3.0.tar.gz |
|---|---|
| Size | 54.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
00a7d4978728c09df615ea92ca20f3eb2d4bc02af8a94b6bdf27a48f23458b71
|
|
BLAKE2b-256 checksum How to use checksums |
784f494acdfa0189a3fe78ce13e8c51e5bfaf3e90222fd1ca884ebc5b1b64275
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / akef-0.3.0-py3-none-any.whl
| Download URL | akef-0.3.0-py3-none-any.whl |
|---|---|
| Size | 48.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
843074047a695c1aa6a005016456426959a8a28bee80b86a8b2a32a6090464d1
|
|
BLAKE2b-256 checksum How to use checksums |
b263ddc270de4b80d53ca56b3564b0f4e30db082b09124aa3046448fd4d9c3e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Security for akef 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.