Skip to main content

pyloaderv

Developer kit for PyloaderV, the mod that lets you write GTA V mods in real Python (CPython 3.12 embedded in the game through ScriptHookV).

pip install pyloaderv

That one command gives you:

  • Autocomplete and type checking for import gta in VS Code (Pylance), PyCharm, mypy... The whole API is covered: gta.player, gta.world, gta.ped, gta.vehicle, gta.entity, gta.ui, gta.math, and all 6649 natives in gta.natives.<namespace>. Nothing to configure: no stubs folder to copy, no pyrightconfig.json.
  • The pyloaderv command to create, pack and install mods.

This package is for writing mods. Players do not need it: they only install the PyloaderV mod in their game folder. The real gta module exists only inside the game.

Quick start

pyloaderv new MyMod

Open the MyMod folder in VS Code (select the Python interpreter where you installed pyloaderv), edit main.py, then try it in game:

pyloaderv install MyMod/main.py --game "C:\Program Files\Rockstar Games\Grand Theft Auto V"

Press F9 in game to reload scripts after a change.

Commands

Command What it does
pyloaderv new <folder> Create a mod folder with a starter main.py (and a pyrightconfig.json that hides the "stub found but no source" warning: the real gta only exists in game)
pyloaderv pack <folder> [-o Mod.pyv] [--bytecode] Pack a mod folder (with main.py) into one .pyv file. --bytecode ships .pyc only and needs Python 3.12
pyloaderv install <file.py/.pyv> --game <GTA V folder> Copy scripts into <GTA V>/pyscript/
pyloaderv pip <packages> --game <GTA V folder> Install pip packages (numpy, requests...) for the game's embedded Python 3.12, into shvpy_runtime/Lib/site-packages

Set the PYLOADERV_GAME environment variable to your GTA V folder to skip --game. pyloaderv pip downloads Windows x64 wheels for CPython 3.12 whatever Python you run it with; packages that only exist as source archives cannot be installed this way.

Writing a script

import gta
from gta import player, world, ui

INTERVAL_MS = 500  # on_tick cadence in ms (0 = every frame)

def on_start():
    ui.notify("~g~hello ~w~from python")

def on_tick():
    me = player.current()
    gta.log("info", f"wanted={me.wanted_level}")

def on_key_down(vk, down, shift, ctrl, alt):
    if down and vk == 0x74:  # F5
        ui.notify(f"peds: {len(world.get_all_peds())}")

def on_aborted():
    pass

In a .pyv mod, use relative imports for your own modules (from . import mylib): each .pyv gets a private namespace, so two mods can ship modules with the same name.

Versions

The package version follows the PyloaderV release whose API it describes (pyloaderv 0.9.x = PyloaderV 0.9). Story mode only: PyloaderV and its mods are not for GTA Online.

Metadata

Release files for pyloaderv 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyloaderv 0.9.0
File Size Uploaded
pyloaderv-0.9.0.tar.gz 103.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyloaderv 0.9.0
File Interpreter ABI Platform
pyloaderv-0.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 227.2 kB

Release files / pyloaderv-0.9.0.tar.gz

Download URL pyloaderv-0.9.0.tar.gz
Size 103.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f26193a6bda7ad2eeb2a958202798d3655722b8975447899c48a4f6bf819d3fc
BLAKE2b-256 checksum
How to use checksums
2b0c104213e0d065b6c94cf2286b18e377164b48dccd5c0bfad027c1be78524b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / pyloaderv-0.9.0-py3-none-any.whl

Download URL pyloaderv-0.9.0-py3-none-any.whl
Size 124.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8aac5a1fe5c35d88a3c9126e54176068ad4e21d7ced3219350622c377c401c88
BLAKE2b-256 checksum
How to use checksums
e6ed094f5dbb80a67c1b92ddc44707396197adc08c6a35171e85300ca7882871
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

0.9.1

2 release files

This release

0.9.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page