Skip to main content

Async API for FiveM endpoints

Project description

async-fivem

Asynchronous FiveM package for retrieving Player and Server infos utilizing the aiohttp package.

Installation

async-fivem can be installed via pip.

pip install async-fivem

Usage

import asyncio
from fivem import FiveM

ip = "127.0.0.1"
port = 30120

async def main():
    fivem = FiveM(ip=ip, port=port)
    # raw list of players like you get from /players.json
    players = await fivem.get_players_raw()
    # raw json of server-info like you get from /info.json
    info = await fivem.get_info_raw()
    # raw json of server-info like you get from /dynamic.json
    dynamic = await fivem.get_dynamic_raw()
    # parsed list of Player objects 
    players = await fivem.get_players()
    # parsed Server object
    server = await fivem.get_server_info()

loop = asyncio.get_event_loop()
loop.run_until_complete(main())

Api Reference

FiveM

class FiveM(ip: str, port: int):

  • await get_players_raw() -> list: /players.json endpoint - raw list of players
  • await get_info_raw() -> dict: /info.json endpoint - raw dict with server-info
  • await get_dynamic_raw() -> dict: /dynamic.json endpoint - raw dict with server-info
  • await get_players() -> [Player]: returns parsed list of Player objects
  • await get_server_info() -> Server: returns parsed server info Server

Player

class Player:

  • name: player username
  • id: player id
  • ping: current player ping
  • xbl_id: xbl id, None if not available
  • steam_id: steam id, None if not available
  • discord_id: discord id, None if not available
  • live_id: live id, None if not available
  • license_id: license id, None if not available

Server

class Server:

  • hostname: servers hostname
  • clients: current number of clients
  • max_clients: max clients allowed on server
  • game_type: servers game type
  • map_name: servers map name

Requirements

Issues and Features

If you're having any issues or want additional features please create an Issue on github.

ko-fi

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

async_fivem-1.1.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

async_fivem-1.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file async_fivem-1.1.0.tar.gz.

File metadata

  • Download URL: async_fivem-1.1.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for async_fivem-1.1.0.tar.gz
Algorithm Hash digest
SHA256 a2dad51c77425f81be6c614364d7ed5a8884057209044ece6bd2a5928151e0a6
MD5 025e5f03d91de13bcf28216c66d839b9
BLAKE2b-256 cd98cd243390d8b7427940ee1cc2bb4d56e928111be6538cb2cea5f7f4dcbb3d

See more details on using hashes here.

File details

Details for the file async_fivem-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: async_fivem-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for async_fivem-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 573577ed14ad74869037768b6aab16712e9e8577f76da502ddb8adc36cd1e7f0
MD5 ff84936af66a0a8b6333f5954b8942a7
BLAKE2b-256 3b0617a1a8606b2226bd6e8e771685b8501845b181b16752a07fb55004e19afe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page