diff --git a/README.md b/README.md index 417166f..66cd613 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,42 @@ # StarRailRes-Python A python library for StarRailRes. + +## Installation + +```bash +pip install starrailres +``` + +## Usage + +```python +from pathlib import Path +from starrailres import CharacterBasicInfo, Index, LevelInfo + +# replace with index folder +index = Index(Path("index") / "en") + +basic = CharacterBasicInfo( + id="1102", + rank=0, + level=70, + promotion=5, + skill_tree_levels=[ + LevelInfo(id="1102001", level=2), + LevelInfo(id="1102002", level=5), + LevelInfo(id="1102003", level=6), + LevelInfo(id="1102004", level=5), + LevelInfo(id="1102007", level=1), + LevelInfo(id="1102101", level=1), + LevelInfo(id="1102102", level=1), + LevelInfo(id="1102201", level=1), + LevelInfo(id="1102202", level=1), + ], +) + +character = index.get_character_info(basic) +print(character) +``` + +For more examples, see `examples`. diff --git a/poetry.lock b/poetry.lock index 1c22ac0..d78952b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -189,14 +189,14 @@ files = [ [[package]] name = "typing-extensions" -version = "4.6.0" +version = "4.6.2" description = "Backported and Experimental Type Hints for Python 3.7+" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "typing_extensions-4.6.0-py3-none-any.whl", hash = "sha256:6ad00b63f849b7dcc313b70b6b304ed67b2b2963b3098a33efe18056b1a9a223"}, - {file = "typing_extensions-4.6.0.tar.gz", hash = "sha256:ff6b238610c747e44c268aa4bb23c8c735d665a63726df3f9431ce707f2aa768"}, + {file = "typing_extensions-4.6.2-py3-none-any.whl", hash = "sha256:3a8b36f13dd5fdc5d1b16fe317f5668545de77fa0b8e02006381fd49d731ab98"}, + {file = "typing_extensions-4.6.2.tar.gz", hash = "sha256:06006244c70ac8ee83fa8282cb188f697b8db25bc8b4df07be1873c43897060c"}, ] [metadata] diff --git a/pyproject.toml b/pyproject.toml index 5b3373b..7500e53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "starrailres" -version = "0.0.1" +version = "1.0.0" description = "StarRailRes index package." authors = ["mobyw "] license = "MIT" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1abde55 Binary files /dev/null and b/requirements.txt differ