-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from AJXD2/feature/docs
Feature/docs
- Loading branch information
Showing
16 changed files
with
571 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# .github/workflows/documentation.yml | ||
name: documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Set this to your default branch | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4.2.2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5.3.0 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install mkdocs-material mkdocstrings[python] # Add any other dependencies you need | ||
- name: Deploy documentation | ||
run: mkdocs gh-deploy --force | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Constants | ||
|
||
::: helldivepy.constants | ||
options: | ||
show_source: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Enums | ||
|
||
::: helldivepy.enums | ||
options: | ||
show_source: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# API Reference | ||
|
||
::: helldivepy | ||
options: | ||
show_source: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Models | ||
|
||
::: helldivepy.models | ||
options: | ||
show_source: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Routes | ||
|
||
::: helldivepy.api | ||
options: | ||
show_source: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Utils | ||
|
||
::: helldivepy.utils | ||
options: | ||
show_source: false |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
icon: material/human-greeting | ||
--- | ||
# Helldive.py | ||
|
||
[![PyPI](https://img.shields.io/pypi/v/helldivepy.svg?label=PyPI&color=blue)](https://pypi.org/project/helldivepy/) | ||
![PyPI - Downloads](https://img.shields.io/pypi/dm/helldivepy?color=brightgreen) | ||
![GitHub License](https://img.shields.io/github/license/ajxd2/helldive.py?color=yellow) | ||
[![Python Versions](https://img.shields.io/pypi/pyversions/helldivepy.svg?color=orange)](https://pypi.org/project/helldivepy/) | ||
![GitHub contributors](https://img.shields.io/github/contributors/ajxd2/helldive.py?color=ff69b4) | ||
|
||
> A simple Python library for diving deep into the [Helldivers Community API](https://github.com/helldivers-2/api) and [Diveharder API](https://github.com/helldivers-2/diveharder_api.py). | ||
--- | ||
|
||
## 🌟 Features | ||
|
||
- **Easy API Access**: Communicate with the Helldivers Community API and Diveharder API without breaking a sweat. | ||
- **Typed Data**: Get structured, easily readable data like dispatches, planets, and more! | ||
- **Perfect for Projects**: Ideal for projects, bots, or just exploring Helldivers data. | ||
|
||
--- | ||
|
||
## 🔗 Links | ||
- [Get Started](installation.md) | ||
- [DiveHarder](https://github.com/helldivers-2/diveharder_api.py) | ||
- [Community API](https://github.com/helldivers-2/api) | ||
- [API discussion Discord](https://discord.gg/MThYGMCqgp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
--- | ||
icon: material/download | ||
--- | ||
# 🚀 Get Started | ||
|
||
## ⚙️ Installation | ||
|
||
=== "Pip" | ||
|
||
```sh | ||
pip install helldivepy | ||
``` | ||
=== "Poetry" | ||
??? note "Poetry" | ||
Install poetry [here](https://python-poetry.org/docs/#installation). | ||
```sh | ||
poetry add helldivepy | ||
``` | ||
|
||
=== "UV" | ||
??? note "UV" | ||
Install UV [here](https://docs.astral.sh/uv/getting-started/installation/). | ||
|
||
```sh | ||
uv add helldivepy | ||
``` | ||
|
||
Example code | ||
|
||
=== "Without Rich" | ||
|
||
```py | ||
from helldivepy import ApiClient | ||
client = ApiClient( | ||
user_agent="Hello-World", | ||
user_contact="example@example.com | discord:exampleuser123", | ||
) | ||
|
||
print(client.get_war_info().model_dump()) | ||
>>> | ||
{ | ||
'started': datetime.datetime(2024, 1, 23, 20, 5, 13, tzinfo=TzInfo(UTC)), | ||
'ended': datetime.datetime(2028, 2, 8, 20, 4, 55, tzinfo=TzInfo(UTC)), | ||
'now': datetime.datetime(1970, 11, 6, 14, 59, 50, tzinfo=TzInfo(UTC)), | ||
'client_version': '0.3.0', | ||
'factions': ['Humans', 'Terminids', 'Automaton', 'Illuminate'], | ||
'impact_multiplier': 0.034382936, | ||
'statistics': { | ||
'missions_won': 370390368, | ||
'missions_lost': 37224925, | ||
'mission_time': 1047433682627, | ||
'terminid_kills': 79906866134, | ||
'automaton_kills': 31552895947, | ||
'illuminate_kills': 3705435035, | ||
'bullets_fired': 571067857117, | ||
'bullets_hit': 645369797775, | ||
'time_played': 1047433682627, | ||
'deaths': 2564546790, | ||
'revives': 2, | ||
'friendlies': 361359530, | ||
'mission_success_rate': 90.0, | ||
'accuracy': 100, | ||
'player_count': 111316 | ||
} | ||
} | ||
|
||
``` | ||
|
||
=== "With rich" | ||
|
||
```py | ||
from helldivepy import ApiClient | ||
from rich import print | ||
|
||
client = ApiClient( | ||
user_agent="Hello-World", | ||
user_contact="example@example.com | discord:exampleuser123", | ||
) | ||
|
||
print(client.get_war_info()) | ||
>>> WarInfo( | ||
started=datetime.datetime(2024, 1, 23, 20, 5, 13, tzinfo=TzInfo(UTC)), | ||
ended=datetime.datetime(2028, 2, 8, 20, 4, 55, tzinfo=TzInfo(UTC)), | ||
now=datetime.datetime(1970, 11, 6, 14, 24, 40, tzinfo=TzInfo(UTC)), | ||
client_version='0.3.0', | ||
factions=['Humans', 'Terminids', 'Automaton', 'Illuminate'], | ||
impact_multiplier=0.03595309, | ||
statistics=Statistics( | ||
missions_won=370353637, | ||
missions_lost=37219878, | ||
mission_time=1047300170684, | ||
terminid_kills=79904593412, | ||
automaton_kills=31551843355, | ||
illuminate_kills=3687632552, | ||
bullets_fired=570972530827, | ||
bullets_hit=645273266867, | ||
time_played=1047300170684, | ||
deaths=2564288334, | ||
revives=2, | ||
friendlies=361317130, | ||
mission_success_rate=90.0, | ||
accuracy=100, | ||
player_count=102995 | ||
) | ||
) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
icon: material/link | ||
--- | ||
|
||
# 🔗 Links | ||
|
||
A list of links that may come in handy when using this lib or other parts of the community API. | ||
|
||
- [PyPi project](https://pypi.org/project/helldivepy/) | ||
- [DiveHarder](https://github.com/helldivers-2/diveharder_api.py) | ||
- [Community API](https://github.com/helldivers-2/api) | ||
- [Comuunity Github](https://github.com/helldivers-2/) | ||
- [API discussion Discord](https://discord.gg/MThYGMCqgp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.