All Projects → ValvePython → Vpk

ValvePython / Vpk

Licence: mit
📦 Open, Search, Extract and Create VPKs in python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Vpk

Archisteamfarm
C# application with primary purpose of idling Steam cards from multiple accounts simultaneously.
Stars: ✭ 7,219 (+9037.97%)
Mutual labels:  hacktoberfest, valve, steam
Steam
☁️ Python package for interacting with Steam
Stars: ✭ 489 (+518.99%)
Mutual labels:  hacktoberfest, valve, steam
Valveresourceformat
🔬 Valve's Source 2 resource file format parser and decompiler
Stars: ✭ 638 (+707.59%)
Mutual labels:  hacktoberfest, valve, steam
Dota2
🐸 Python package for interacting with Dota 2 Game Coordinator
Stars: ✭ 129 (+63.29%)
Mutual labels:  hacktoberfest, valve, steam
halflife-op4-updated
Half-Life: Opposing Force SDK based on Half-Life Updated, with bug fixes. Check README.md for more information.
Stars: ✭ 57 (-27.85%)
Mutual labels:  steam, valve
valve-matchmaking-ip-ranges
Lists of locations & IP addresses of Valve servers
Stars: ✭ 69 (-12.66%)
Mutual labels:  steam, valve
SteamHelper-rs
Interact with Valve's Steam network with this collection of crates.
Stars: ✭ 24 (-69.62%)
Mutual labels:  steam, valve
VTFLib
VTFLib is a LGPL open source programming library that provides a C and C++ API for reading and writing Valve VTF and VMT format image files.
Stars: ✭ 68 (-13.92%)
Mutual labels:  steam, valve
steam.py
An async python wrapper to interact with the Steam API and its CMs
Stars: ✭ 74 (-6.33%)
Mutual labels:  steam, valve
HammerPatch
Modification of Source Valve Hammer Editor to fix some issues. Fixes brush vertex precision loss.
Stars: ✭ 49 (-37.97%)
Mutual labels:  steam, valve
Uwphook
🔗 Add your Windows Store or UWP games to Steam
Stars: ✭ 566 (+616.46%)
Mutual labels:  valve, steam
newsteamchat
Metro skin for Steam chat and friends UI.
Stars: ✭ 79 (+0%)
Mutual labels:  steam, valve
FLOSS-Games-on-Steam
A list of FLOSS games available on Steam
Stars: ✭ 90 (+13.92%)
Mutual labels:  steam, valve
ChatLogger
ChatLogger is a Steam Tool based on the SteamKit2 library, designed to save your and friends messages! [Metro Theme]
Stars: ✭ 39 (-50.63%)
Mutual labels:  steam, valve
AreWeAntiCheatYet
A comprehensive and crowd-sourced list of games using anti-cheats and their compatibility with GNU/Linux or Wine.
Stars: ✭ 289 (+265.82%)
Mutual labels:  steam, valve
php-steam-web-api-client
Automatically generated api client for the Steam Web API.
Stars: ✭ 79 (+0%)
Mutual labels:  steam, valve
Steamworks
Exposing SteamWorks functions to SourcePawn.
Stars: ✭ 70 (-11.39%)
Mutual labels:  valve, steam
vdf
📜 Package for working with Valve's text and binary KeyValue format
Stars: ✭ 146 (+84.81%)
Mutual labels:  steam, valve
JavaSteam
Java library that provides an interface to directly interact with Valve's Steam servers.
Stars: ✭ 70 (-11.39%)
Mutual labels:  steam, valve
Steamtracking
🕵 Tracking things, so you don't have to
Stars: ✭ 542 (+586.08%)
Mutual labels:  valve, steam

| |pypi| |license| |coverage| |master_build| | |sonar_maintainability| |sonar_reliability| |sonar_security|

VPK is Valve's file format for storing game assets. Pythonic access to VPK files and their contents together with a cli tool.

Works on: python2.7, python3.4+, pypy, and pypy3

Install

You can grab the latest release from https://pypi.python.org/pypi/vpk or via pip

.. code:: bash

pip install vpk

Quick start

The VPK instance is iterable in the standard ways and produces paths to files

.. code:: python

import vpk

pak1 = vpk.open("/d/Steam/steamapps/common/dota 2 beta/dota/pak01_dir.vpk")

for filepath in pak1:
    print filepath

Reading a specifc file is done by passing the file path to get_file() method, which returns a VPKFile instance, which acts as a regular file instance. Writting is not possible.

.. code:: python

pakfile = pak1.get_file("scripts/emoticons.txt")
pakfile = pak1["scripts/emoticons.txt"]
print pakfile.read().decode('utf-16le')

.. code:: text

-------------------------------------------------
"emoticons"
{
    // An ID of zero is invalid

    "1"
    {
        "image_name" "wink.png"
        "ms_per_frame" "100"
...

Saving a file is just as easy.

.. code:: python

pakfile.save("./emoticons.txt")

The module supports creating basic VPKs. Multi archive paks are not yet supported.

.. code:: python

newpak = vpk.new("./some/directory")
newpak.save("file.vpk")

pak = newpak.save_and_open("file.vpk")

CLI tool

A command line utility is also included

.. code:: text

usage: vpk [-h] [--version] [-l] [-la] [-x OUT_LOCATION] [-nd] [-t] [-c DIR]
           [-p] [-f WILDCARD | -re REGEX | -name WILDCARD] [-v]
           file

Manage Valve Pak files

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit

Main:
  file                  Input VPK file
  -l, --list            List file paths
  -la                   List file paths, crc, size
  -x OUT_LOCATION, --extract OUT_LOCATION
                        Extract files to directory
  -nd, --no-directories
                        Don't create directries during extraction
  -t, --test            Verify contents
  -c DIR, --create DIR  Create VPK file from directory
  -p, --pipe            Write file contents to stdout

Filters:
  -f WILDCARD, --filter WILDCARD
                        Wildcard filter for file paths
  -re REGEX, --regex REGEX
                        Regular expression filter for file paths
  -name WILDCARD        Filename wildcard filter
  -v, --invert-match    Use filters for exclusion

Looking to decompile Valve custom asset formats?

Check out https://github.com/SteamDatabase/ValveResourceFormat/

.. |pypi| image:: https://img.shields.io/pypi/v/vpk.svg?style=flat&label=latest%20version :target: https://pypi.python.org/pypi/vpk :alt: Latest version released on PyPi

.. |license| image:: https://img.shields.io/pypi/l/vpk.svg?style=flat&label=license :target: https://pypi.python.org/pypi/vpk :alt: MIT License

.. |coverage| image:: https://img.shields.io/coveralls/ValvePython/vpk/master.svg?style=flat :target: https://coveralls.io/r/ValvePython/vpk?branch=master :alt: Test coverage

.. |master_build| image:: https://github.com/ValvePython/vpk/workflows/Tests/badge.svg?branch=master :target: https://github.com/ValvePython/vpk/actions?query=workflow%3A%22Tests%22+branch%3Amaster :alt: Build status of master branch

.. |sonar_maintainability| image:: https://sonarcloud.io/api/project_badges/measure?project=ValvePython_vpk&metric=sqale_rating :target: https://sonarcloud.io/dashboard?id=ValvePython_vpk :alt: SonarCloud Rating

.. |sonar_reliability| image:: https://sonarcloud.io/api/project_badges/measure?project=ValvePython_vpk&metric=reliability_rating :target: https://sonarcloud.io/dashboard?id=ValvePython_vpk :alt: SonarCloud Rating

.. |sonar_security| image:: https://sonarcloud.io/api/project_badges/measure?project=ValvePython_vpk&metric=security_rating :target: https://sonarcloud.io/dashboard?id=ValvePython_vpk :alt: SonarCloud Rating

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].