arkparse 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- arkparse-0.0.1/.gitignore +173 -0
- arkparse-0.0.1/LICENSE +21 -0
- arkparse-0.0.1/PKG-INFO +193 -0
- arkparse-0.0.1/README.md +182 -0
- arkparse-0.0.1/pyproject.toml +31 -0
- arkparse-0.0.1/src/arkparse/assets/ABERRATION.PNG +0 -0
- arkparse-0.0.1/src/arkparse/assets/__init__.py +0 -0
- arkparse-0.0.1/src/arkparse/assets/heavy_inventory +0 -0
- arkparse-0.0.1/src/arkparse/assets/templates/equipment/armor +0 -0
- arkparse-0.0.1/src/arkparse/assets/templates/equipment/armor_bp +0 -0
- arkparse-0.0.1/src/arkparse/assets/templates/equipment/saddle +0 -0
- arkparse-0.0.1/src/arkparse/assets/templates/equipment/saddle_bp +0 -0
- arkparse-0.0.1/src/arkparse/assets/templates/equipment/shield +0 -0
- arkparse-0.0.1/src/arkparse/assets/templates/equipment/shield_bp +0 -0
- arkparse-0.0.1/src/arkparse/assets/templates/equipment/weapon +0 -0
- arkparse-0.0.1/src/arkparse/assets/templates/equipment/weapon_bp +0 -0
- arkparse-0.0.1/src/arkparse/assets/templates/inventory/with_item +0 -0
- arkparse-0.0.1/src/arkparse/assets/templates/stackable/stackable +0 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# poetry
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
102
|
+
#poetry.lock
|
|
103
|
+
|
|
104
|
+
# pdm
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
106
|
+
#pdm.lock
|
|
107
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
108
|
+
# in version control.
|
|
109
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
110
|
+
.pdm.toml
|
|
111
|
+
.pdm-python
|
|
112
|
+
.pdm-build/
|
|
113
|
+
|
|
114
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
115
|
+
__pypackages__/
|
|
116
|
+
|
|
117
|
+
# Celery stuff
|
|
118
|
+
celerybeat-schedule
|
|
119
|
+
celerybeat.pid
|
|
120
|
+
|
|
121
|
+
# SageMath parsed files
|
|
122
|
+
*.sage.py
|
|
123
|
+
|
|
124
|
+
# Environments
|
|
125
|
+
.env
|
|
126
|
+
.venv
|
|
127
|
+
env/
|
|
128
|
+
venv/
|
|
129
|
+
ENV/
|
|
130
|
+
env.bak/
|
|
131
|
+
venv.bak/
|
|
132
|
+
|
|
133
|
+
# Spyder project settings
|
|
134
|
+
.spyderproject
|
|
135
|
+
.spyproject
|
|
136
|
+
|
|
137
|
+
# Rope project settings
|
|
138
|
+
.ropeproject
|
|
139
|
+
|
|
140
|
+
# mkdocs documentation
|
|
141
|
+
/site
|
|
142
|
+
|
|
143
|
+
# mypy
|
|
144
|
+
.mypy_cache/
|
|
145
|
+
.dmypy.json
|
|
146
|
+
dmypy.json
|
|
147
|
+
|
|
148
|
+
# Pyre type checker
|
|
149
|
+
.pyre/
|
|
150
|
+
|
|
151
|
+
# pytype static type analyzer
|
|
152
|
+
.pytype/
|
|
153
|
+
|
|
154
|
+
# Cython debug symbols
|
|
155
|
+
cython_debug/
|
|
156
|
+
|
|
157
|
+
# PyCharm
|
|
158
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
159
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
160
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
161
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
162
|
+
#.idea/
|
|
163
|
+
|
|
164
|
+
test.py
|
|
165
|
+
out/*
|
|
166
|
+
*.json
|
|
167
|
+
*.bin
|
|
168
|
+
*.arkprofile
|
|
169
|
+
*.ark
|
|
170
|
+
/*.arkprofile
|
|
171
|
+
/*.ark
|
|
172
|
+
test_saves/*
|
|
173
|
+
temp
|
arkparse-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 VincentHenauGithub
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
arkparse-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: arkparse
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: A package to parse and modify ark save files
|
|
5
|
+
Project-URL: Homepage, https://github.com/VincentHenauGithub/ark-save-parser
|
|
6
|
+
Author-email: Vincent Heneau <vincent.henau.github@gmail.com>
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Requires-Python: >=3.9
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# ArkParse: A Python Library for Reading and Modifying ARK Save Files
|
|
13
|
+
|
|
14
|
+
**ArkParse** is a Python library designed for **ARK: Survival Ascended** players, server administrators, and modders. This library enables you to read, analyze, and modify ARK save files with an intuitive API. With ArkParse, you can access detailed information about players, structures, equipment, dinosaurs, and more, enabling powerful tools for automation, analysis, and customization.
|
|
15
|
+
|
|
16
|
+
## Introduction
|
|
17
|
+
Hi everyone,
|
|
18
|
+
|
|
19
|
+
I originally created this package to manage a private ARK server I started with a few friends. What began as a small project quickly grew into something much bigger than I expected!
|
|
20
|
+
|
|
21
|
+
The foundation for this work was built on the awesome efforts of [Kakoen](https://github.com/Kakoen) and their contributors, whose Java-based save file property parsing tools were a fantastic starting point. You can check out their work here: [Kakoen's ark-sa-save-tools](https://github.com/Kakoen/ark-sa-save-tools). However, since I'm more comfortable with Python, I decided to start my own package and expand on it significantly.
|
|
22
|
+
|
|
23
|
+
The package has grown to a pretty expansive set of tools that can be used to retrieve nearly everything in the save files, in a simple object oriented way.
|
|
24
|
+
|
|
25
|
+
I mainly use this package for server management tasks. Some highlights include:
|
|
26
|
+
|
|
27
|
+
- Automatically changing server passwords to control when players can log in.
|
|
28
|
+
- A voting system to reveal dino and base locations.
|
|
29
|
+
- Sending random stats of the server to the chat
|
|
30
|
+
- Monitoring player activity like when people log off and on and such
|
|
31
|
+
- Randomly spawning bases with random loot for my friends to raid; probably my favorite feature (and the most complicated)
|
|
32
|
+
If you're curious or want to explore the features yourself, you can find the project here: [ark-server-manager](https://github.com/VincentHenauGithub/ark-server-manager).
|
|
33
|
+
|
|
34
|
+
Hope you find it useful or inspiring or both! 😊
|
|
35
|
+
|
|
36
|
+
## Disclaimer
|
|
37
|
+
I'm not a professional Python programmer, so if you come across anything that could be done better, please bear with me, or, feel free to contribute! 😉
|
|
38
|
+
|
|
39
|
+
Secondly, the package is not fully complete, with some elements missing, such as blueprints in the Classes section, formulas for calculating coordinates for other maps than Abberation, and more. However, I hope the package is designed in a way that makes it relatively easy for you to add your own needs to it.
|
|
40
|
+
|
|
41
|
+
Last, I've never made an open source package like this so if I'm doing something wrong or don't know some general rules of thumb, feel free to tell me!
|
|
42
|
+
I just hope it's usefull for someone!
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
## Features
|
|
46
|
+
|
|
47
|
+
- **Player API**: Retrieve player and tribe data, including inventory details.
|
|
48
|
+
- **Structure API**: Analyze and filter structures by location, owner, and other criteria, create heatmaps and more...
|
|
49
|
+
- **Equipment API**: Explore equipment, armor, and saddles. Retrieve blueprints or create and insert custom items.
|
|
50
|
+
- **Dino API**: Analyze dino data, generate heatmaps, find specific dinos, or track stats like mutations and levels.
|
|
51
|
+
- **Base API**: Export and import entire bases for custom scenarios.
|
|
52
|
+
- **Stackable API**: Simple API for parsing basic resources, ammo, structure items and such...
|
|
53
|
+
- **General Tools**: Create custom save file content or perform bulk modifications.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
Install via pip (not yet):
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install arkparse
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Or install locally on your PC so you can add modifications
|
|
65
|
+
First clone the repo and then run the following in repo directory:
|
|
66
|
+
```bash
|
|
67
|
+
pip install -e .
|
|
68
|
+
```
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
### 4. **Quickstart**
|
|
72
|
+
|
|
73
|
+
There are quite a few examples under the examples folder, organized by api. These should help you on your way for most of the package functionalities, some of them are listed below already.
|
|
74
|
+
|
|
75
|
+
#### a. **Player API: Retrieve Player and Inventory Information**
|
|
76
|
+
|
|
77
|
+
```markdown
|
|
78
|
+
### Player API: Retrieve Player and Inventory Information
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
from arkparse import AsaSave
|
|
82
|
+
from arkparse.enums import ArkMap
|
|
83
|
+
from arkparse.ftp.ark_ftp_client import ArkFtpClient
|
|
84
|
+
from arkparse.api.player_api import PlayerApi
|
|
85
|
+
from arkparse.object_model.misc.inventory import Inventory
|
|
86
|
+
|
|
87
|
+
player_api = PlayerApi('../../ftp_config.json', ArkMap.ABERRATION)
|
|
88
|
+
save = AsaSave(contents=ArkFtpClient.from_config('../../ftp_config.json', ArkMap.ABERRATION).download_save_file())
|
|
89
|
+
|
|
90
|
+
for player in player_api.players:
|
|
91
|
+
inventory: Inventory = player_api.get_player_inventory(player, save)
|
|
92
|
+
print(player)
|
|
93
|
+
print(f"{player.name}'s inventory:")
|
|
94
|
+
print(inventory)
|
|
95
|
+
print("\n")
|
|
96
|
+
```
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
#### b. **Structure API: Analyze Structures and Generate Heatmaps**
|
|
100
|
+
|
|
101
|
+
```markdown
|
|
102
|
+
### Structure API: Analyze Structures and Generate Heatmaps
|
|
103
|
+
|
|
104
|
+
Retrieve and filter structures by owner, location, or type. Generate heatmaps for visualization and analysis.
|
|
105
|
+
### Equipment API: Manage Equipment and Blueprints
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
from pathlib import Path
|
|
109
|
+
from uuid import UUID
|
|
110
|
+
from typing import Dict
|
|
111
|
+
|
|
112
|
+
from arkparse.object_model.equipment.weapon import Weapon
|
|
113
|
+
from arkparse.saves.asa_save import AsaSave
|
|
114
|
+
from arkparse.ftp.ark_ftp_client import ArkFtpClient, ArkMap
|
|
115
|
+
from arkparse.api.equipment_api import EquipmentApi
|
|
116
|
+
from arkparse.classes.equipment import Weapons
|
|
117
|
+
|
|
118
|
+
# Retrieve save file
|
|
119
|
+
save_path = ArkFtpClient.from_config(Path("../../ftp_config.json"), ArkMap.ABERRATION).download_save_file(Path.cwd())
|
|
120
|
+
save = AsaSave(save_path)
|
|
121
|
+
|
|
122
|
+
equipment_api = EquipmentApi(save)
|
|
123
|
+
|
|
124
|
+
# Get all longneck blueprints
|
|
125
|
+
weapons: Dict[UUID, Weapon] = equipment_api.get_filtered(
|
|
126
|
+
EquipmentApi.Classes.WEAPON,
|
|
127
|
+
classes=[Weapons.advanced.longneck],
|
|
128
|
+
only_blueprints=True
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
highest_dmg_bp = max(weapons.values(), key=lambda x: x.damage)
|
|
132
|
+
print(f"Highest damage on longneck bp: {highest_dmg_bp.damage}")
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
#### d. **Dino API: Analyze and Find Dinosaurs**
|
|
138
|
+
|
|
139
|
+
```markdown
|
|
140
|
+
### Dino API: Analyze and Find Dinosaurs
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
from pathlib import Path
|
|
144
|
+
|
|
145
|
+
from arkparse.api.dino_api import DinoApi
|
|
146
|
+
from arkparse.enums import ArkMap
|
|
147
|
+
from arkparse.saves.asa_save import AsaSave
|
|
148
|
+
from arkparse.object_model.dinos.tamed_dino import TamedDino
|
|
149
|
+
|
|
150
|
+
save_path = Path.cwd() / "Aberration_WP.ark" # Replace with path to your save file
|
|
151
|
+
save = AsaSave(save_path)
|
|
152
|
+
dino_api = DinoApi(save)
|
|
153
|
+
|
|
154
|
+
dinos = dino_api.get_all_tamed()
|
|
155
|
+
|
|
156
|
+
if dinos is None:
|
|
157
|
+
print("No tamed dinos found")
|
|
158
|
+
exit()
|
|
159
|
+
|
|
160
|
+
most_mutations: TamedDino = None
|
|
161
|
+
for dino in dinos.values():
|
|
162
|
+
dino: TamedDino = dino
|
|
163
|
+
curr = 0 if most_mutations is None else most_mutations.stats.get_total_mutations()
|
|
164
|
+
if most_mutations is None or (dino.stats.get_total_mutations() > curr):
|
|
165
|
+
most_mutations = dino
|
|
166
|
+
|
|
167
|
+
print(f"The dino with the most mutations is a {most_mutations.get_short_name()} with {int(most_mutations.stats.get_total_mutations())} mutations")
|
|
168
|
+
print(f"Location: {most_mutations.location.as_map_coords(ArkMap.ABERRATION)}")
|
|
169
|
+
print(f"Level: {most_mutations.stats.current_level}")
|
|
170
|
+
print(f"Owner: {most_mutations.owner}")
|
|
171
|
+
```
|
|
172
|
+
## Contributing
|
|
173
|
+
|
|
174
|
+
I welcome contributions! If you have updates to this library that you would like to share, feel free!
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## License
|
|
179
|
+
|
|
180
|
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
## Feedback & Support
|
|
184
|
+
|
|
185
|
+
- **Issues or Feature Requests**: Open an issue on the repo!
|
|
186
|
+
- **Help**: If you need help for something specific, you can always messageme, I will try to help you out
|
|
187
|
+
|
|
188
|
+
## Donation
|
|
189
|
+
|
|
190
|
+
If you really really love this package you can [donate here](https://www.paypal.com/donate/?hosted_button_id=BV63CTDUW7PKQ)
|
|
191
|
+
There is no need, but I also won't say no 😊
|
|
192
|
+
|
|
193
|
+
|
arkparse-0.0.1/README.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# ArkParse: A Python Library for Reading and Modifying ARK Save Files
|
|
2
|
+
|
|
3
|
+
**ArkParse** is a Python library designed for **ARK: Survival Ascended** players, server administrators, and modders. This library enables you to read, analyze, and modify ARK save files with an intuitive API. With ArkParse, you can access detailed information about players, structures, equipment, dinosaurs, and more, enabling powerful tools for automation, analysis, and customization.
|
|
4
|
+
|
|
5
|
+
## Introduction
|
|
6
|
+
Hi everyone,
|
|
7
|
+
|
|
8
|
+
I originally created this package to manage a private ARK server I started with a few friends. What began as a small project quickly grew into something much bigger than I expected!
|
|
9
|
+
|
|
10
|
+
The foundation for this work was built on the awesome efforts of [Kakoen](https://github.com/Kakoen) and their contributors, whose Java-based save file property parsing tools were a fantastic starting point. You can check out their work here: [Kakoen's ark-sa-save-tools](https://github.com/Kakoen/ark-sa-save-tools). However, since I'm more comfortable with Python, I decided to start my own package and expand on it significantly.
|
|
11
|
+
|
|
12
|
+
The package has grown to a pretty expansive set of tools that can be used to retrieve nearly everything in the save files, in a simple object oriented way.
|
|
13
|
+
|
|
14
|
+
I mainly use this package for server management tasks. Some highlights include:
|
|
15
|
+
|
|
16
|
+
- Automatically changing server passwords to control when players can log in.
|
|
17
|
+
- A voting system to reveal dino and base locations.
|
|
18
|
+
- Sending random stats of the server to the chat
|
|
19
|
+
- Monitoring player activity like when people log off and on and such
|
|
20
|
+
- Randomly spawning bases with random loot for my friends to raid; probably my favorite feature (and the most complicated)
|
|
21
|
+
If you're curious or want to explore the features yourself, you can find the project here: [ark-server-manager](https://github.com/VincentHenauGithub/ark-server-manager).
|
|
22
|
+
|
|
23
|
+
Hope you find it useful or inspiring or both! 😊
|
|
24
|
+
|
|
25
|
+
## Disclaimer
|
|
26
|
+
I'm not a professional Python programmer, so if you come across anything that could be done better, please bear with me, or, feel free to contribute! 😉
|
|
27
|
+
|
|
28
|
+
Secondly, the package is not fully complete, with some elements missing, such as blueprints in the Classes section, formulas for calculating coordinates for other maps than Abberation, and more. However, I hope the package is designed in a way that makes it relatively easy for you to add your own needs to it.
|
|
29
|
+
|
|
30
|
+
Last, I've never made an open source package like this so if I'm doing something wrong or don't know some general rules of thumb, feel free to tell me!
|
|
31
|
+
I just hope it's usefull for someone!
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
## Features
|
|
35
|
+
|
|
36
|
+
- **Player API**: Retrieve player and tribe data, including inventory details.
|
|
37
|
+
- **Structure API**: Analyze and filter structures by location, owner, and other criteria, create heatmaps and more...
|
|
38
|
+
- **Equipment API**: Explore equipment, armor, and saddles. Retrieve blueprints or create and insert custom items.
|
|
39
|
+
- **Dino API**: Analyze dino data, generate heatmaps, find specific dinos, or track stats like mutations and levels.
|
|
40
|
+
- **Base API**: Export and import entire bases for custom scenarios.
|
|
41
|
+
- **Stackable API**: Simple API for parsing basic resources, ammo, structure items and such...
|
|
42
|
+
- **General Tools**: Create custom save file content or perform bulk modifications.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
Install via pip (not yet):
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install arkparse
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or install locally on your PC so you can add modifications
|
|
54
|
+
First clone the repo and then run the following in repo directory:
|
|
55
|
+
```bash
|
|
56
|
+
pip install -e .
|
|
57
|
+
```
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
### 4. **Quickstart**
|
|
61
|
+
|
|
62
|
+
There are quite a few examples under the examples folder, organized by api. These should help you on your way for most of the package functionalities, some of them are listed below already.
|
|
63
|
+
|
|
64
|
+
#### a. **Player API: Retrieve Player and Inventory Information**
|
|
65
|
+
|
|
66
|
+
```markdown
|
|
67
|
+
### Player API: Retrieve Player and Inventory Information
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from arkparse import AsaSave
|
|
71
|
+
from arkparse.enums import ArkMap
|
|
72
|
+
from arkparse.ftp.ark_ftp_client import ArkFtpClient
|
|
73
|
+
from arkparse.api.player_api import PlayerApi
|
|
74
|
+
from arkparse.object_model.misc.inventory import Inventory
|
|
75
|
+
|
|
76
|
+
player_api = PlayerApi('../../ftp_config.json', ArkMap.ABERRATION)
|
|
77
|
+
save = AsaSave(contents=ArkFtpClient.from_config('../../ftp_config.json', ArkMap.ABERRATION).download_save_file())
|
|
78
|
+
|
|
79
|
+
for player in player_api.players:
|
|
80
|
+
inventory: Inventory = player_api.get_player_inventory(player, save)
|
|
81
|
+
print(player)
|
|
82
|
+
print(f"{player.name}'s inventory:")
|
|
83
|
+
print(inventory)
|
|
84
|
+
print("\n")
|
|
85
|
+
```
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
#### b. **Structure API: Analyze Structures and Generate Heatmaps**
|
|
89
|
+
|
|
90
|
+
```markdown
|
|
91
|
+
### Structure API: Analyze Structures and Generate Heatmaps
|
|
92
|
+
|
|
93
|
+
Retrieve and filter structures by owner, location, or type. Generate heatmaps for visualization and analysis.
|
|
94
|
+
### Equipment API: Manage Equipment and Blueprints
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
from pathlib import Path
|
|
98
|
+
from uuid import UUID
|
|
99
|
+
from typing import Dict
|
|
100
|
+
|
|
101
|
+
from arkparse.object_model.equipment.weapon import Weapon
|
|
102
|
+
from arkparse.saves.asa_save import AsaSave
|
|
103
|
+
from arkparse.ftp.ark_ftp_client import ArkFtpClient, ArkMap
|
|
104
|
+
from arkparse.api.equipment_api import EquipmentApi
|
|
105
|
+
from arkparse.classes.equipment import Weapons
|
|
106
|
+
|
|
107
|
+
# Retrieve save file
|
|
108
|
+
save_path = ArkFtpClient.from_config(Path("../../ftp_config.json"), ArkMap.ABERRATION).download_save_file(Path.cwd())
|
|
109
|
+
save = AsaSave(save_path)
|
|
110
|
+
|
|
111
|
+
equipment_api = EquipmentApi(save)
|
|
112
|
+
|
|
113
|
+
# Get all longneck blueprints
|
|
114
|
+
weapons: Dict[UUID, Weapon] = equipment_api.get_filtered(
|
|
115
|
+
EquipmentApi.Classes.WEAPON,
|
|
116
|
+
classes=[Weapons.advanced.longneck],
|
|
117
|
+
only_blueprints=True
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
highest_dmg_bp = max(weapons.values(), key=lambda x: x.damage)
|
|
121
|
+
print(f"Highest damage on longneck bp: {highest_dmg_bp.damage}")
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
#### d. **Dino API: Analyze and Find Dinosaurs**
|
|
127
|
+
|
|
128
|
+
```markdown
|
|
129
|
+
### Dino API: Analyze and Find Dinosaurs
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
from pathlib import Path
|
|
133
|
+
|
|
134
|
+
from arkparse.api.dino_api import DinoApi
|
|
135
|
+
from arkparse.enums import ArkMap
|
|
136
|
+
from arkparse.saves.asa_save import AsaSave
|
|
137
|
+
from arkparse.object_model.dinos.tamed_dino import TamedDino
|
|
138
|
+
|
|
139
|
+
save_path = Path.cwd() / "Aberration_WP.ark" # Replace with path to your save file
|
|
140
|
+
save = AsaSave(save_path)
|
|
141
|
+
dino_api = DinoApi(save)
|
|
142
|
+
|
|
143
|
+
dinos = dino_api.get_all_tamed()
|
|
144
|
+
|
|
145
|
+
if dinos is None:
|
|
146
|
+
print("No tamed dinos found")
|
|
147
|
+
exit()
|
|
148
|
+
|
|
149
|
+
most_mutations: TamedDino = None
|
|
150
|
+
for dino in dinos.values():
|
|
151
|
+
dino: TamedDino = dino
|
|
152
|
+
curr = 0 if most_mutations is None else most_mutations.stats.get_total_mutations()
|
|
153
|
+
if most_mutations is None or (dino.stats.get_total_mutations() > curr):
|
|
154
|
+
most_mutations = dino
|
|
155
|
+
|
|
156
|
+
print(f"The dino with the most mutations is a {most_mutations.get_short_name()} with {int(most_mutations.stats.get_total_mutations())} mutations")
|
|
157
|
+
print(f"Location: {most_mutations.location.as_map_coords(ArkMap.ABERRATION)}")
|
|
158
|
+
print(f"Level: {most_mutations.stats.current_level}")
|
|
159
|
+
print(f"Owner: {most_mutations.owner}")
|
|
160
|
+
```
|
|
161
|
+
## Contributing
|
|
162
|
+
|
|
163
|
+
I welcome contributions! If you have updates to this library that you would like to share, feel free!
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## License
|
|
168
|
+
|
|
169
|
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
## Feedback & Support
|
|
173
|
+
|
|
174
|
+
- **Issues or Feature Requests**: Open an issue on the repo!
|
|
175
|
+
- **Help**: If you need help for something specific, you can always messageme, I will try to help you out
|
|
176
|
+
|
|
177
|
+
## Donation
|
|
178
|
+
|
|
179
|
+
If you really really love this package you can [donate here](https://www.paypal.com/donate/?hosted_button_id=BV63CTDUW7PKQ)
|
|
180
|
+
There is no need, but I also won't say no 😊
|
|
181
|
+
|
|
182
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "arkparse"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
dependencies = [
|
|
9
|
+
# List your dependencies here
|
|
10
|
+
]
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "Vincent Heneau", email = "vincent.henau.github@gmail.com" },
|
|
13
|
+
]
|
|
14
|
+
description = "A package to parse and modify ark save files"
|
|
15
|
+
readme = "README.md"
|
|
16
|
+
requires-python = ">=3.9"
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
# Add additional classifiers as needed
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
[project.urls]
|
|
23
|
+
Homepage = "https://github.com/VincentHenauGithub/ark-save-parser"
|
|
24
|
+
|
|
25
|
+
[tool.hatch.build]
|
|
26
|
+
include = [
|
|
27
|
+
"src/arkparse/assets/**", # Include all assets
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[tool.hatch.build.targets.wheel]
|
|
31
|
+
packages = ["src/arkparse"]
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|