Metadata-Version: 2.1
Name: altvmasterlist
Version: 0.8
Summary: A package to use the alt:V Masterlist api
Home-page: https://github.com/Nickwasused/altv-python-masterlist
Author: Nickwasused
Author-email: nickwasused.social@protonmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE

# alt:V Masterlist for Python

You can use this Package to interface with the alt:V master list API.

# Install 

```pip install altvmasterlist``` or ```pip3 install altvmasterlist```

# Examples

```
from altvmasterlist import altvmasterlist as altv

# get the server json
altv.get_server_by_id("ceaac3d1cc22761223beac38386f5ab2").get_json()

# get all servers as server object
altv.get_servers()

# get all server stats
altv.get_server_stats()

# get a server and read stuff
server = altv.get_server_by_id("ceaac3d1cc22761223beac38386f5ab2")
print(server.players) 
This should output something like 200
```

# Usage

## Server Object

| Parameter | Type
| ------- | ------------------ 
| active | boolean
| id | string
| maxPlayers | int
| players | int
| name | string
| locked | boolean
| host | string
| port | int
| gameMode | string
| website | string
| language | string
| description | string
| verified | boolean
| promoted | boolean
| useEarlyAuth | boolean
| earlyAuthUrl | string
| useCdn | boolean
| cdnUrl | string
| useVoiceChat | boolean
| tags | array
| bannerUrl | string
| branch | string
| build | int
| version | string
| lastUpdate | int


Example:<br>
```
server = ...
print(server.players)
```

## Commands

| Option  | Description           | Example Output  | Extra
| ------- | ------------------ | ------------------ | ------------------ 
| get_json() | Use this to get the Server data as Json Output | https://api.altv.mp/server/ceaac3d1cc22761223beac38386f5ab2 | There is no "info" Object
| get_server_stats() | Get the Stats of all alt:V Servers | {'serversCount': 111, 'playersCount': 665} | 
| get_servers() | Get an Array of all alt:V Servers on the Masterlist | [ServerObject1, ServerObject2, ServerObject3] | Array with Server Object
| get_server_by_id(id) | Get a specific Server using the id | ServerObject | Returned as Server Object
| get_server_by_id_avg(id, time) | Get the average Player Numbers of a specific alt:V Server | [{'t': 1638140400, 'c': 521}, {'t': 1638226800, 'c': 527}] |
| get_server_by_id_avg_result(id, time) | Get the average Player Count over a defined time span. | 300 |
| get_server_by_id_max(id, time) | Get the max Player Numbers of a specific alt:V Server | [{'t': 1638140400, 'c': 521}, {'t': 1638226800, 'c': 527}] |
| validate_id(id) | Validate a alt:V Server id | True / False | Example id: ceaac3d1cc22761223beac38386f5ab2



