mirror of
https://github.com/PaiGramTeam/SIMNet.git
synced 2024-11-21 21:58:05 +00:00
b74b9aef33
Added a `cookies` property accessor to the `BaseClient` class, which retrieves cookies from the `httpx` AsyncClient object and returns a `simnet.client.cookies.Cookies` object (which is a custom implementation of the `httpx.Cookies` class). Additionally, the initialization function was refactored to better support using cookies. Now, if `account_id` is not passed in, it will be retrieved from the cookies. |
||
---|---|---|
simnet | ||
tests | ||
.deepsource.toml | ||
.gitignore | ||
LICENSE | ||
pyproject.toml | ||
README.md | ||
requirements.dev.txt | ||
requirements.txt | ||
setup.py |
Semi-Intransient Matrix Network
Modern API wrapper for Genshin Impact & Honkai: Star Rail built on asyncio and pydantic.
Requirements
- Python 3.9+
- httpx
- Pydantic
Example
A very simple example of how simnet would be used:
import asyncio
import simnet
async def main():
cookies = {} # write your cookies
player_id = 123456789
async with simnet.StarRailClient(cookies, player_id=player_id) as client:
data = await client.get_starrail_user()
print(f"Player has a total of {data.stats.avatar_num} characters")
asyncio.run(main())
Credits
- genshin.py: fork source