Skip to main content

Lightweight pure-Python CS2 inspect link & propid:6 decoder. Zero dependencies.

Project description

cs2-inspect-lite

Минималистичная Pure Python библиотека для декодирования и кодирования CS2 inspect-ссылок и propid:6 данных.

Без внешних зависимостей — встроенный protobuf парсер.

Установка

pip install cs2-inspect-lite

Или из исходников:

pip install .

Быстрый старт

Декодирование propid:6 (данные с маркета)

from cs2_inspect_lite import decode_hex

item = decode_hex("00183C20B803280538E9A3C5DD0340E102C246A0D1")

print(item.defindex)    # 60
print(item.paintindex)  # 440
print(item.paintseed)   # 353
print(item.paintwear)   # ~0.00541
print(item.rarity)      # 5

Декодирование inspect-URL

from cs2_inspect_lite import decode_inspect_url, is_masked, is_classic

# Masked/hybrid формат — декодируется offline
url = "steam://run/730//+csgo_econ_action_preview%20E3F336..."
item = decode_inspect_url(url)
if item:
    print(f"Float: {item.paintwear}")
    print(f"Paint seed: {item.paintseed}")
    for s in item.stickers:
        print(f"Sticker #{s.slot}: id={s.sticker_id}")

# Проверка формата
print(is_masked(url))   # True — можно декодировать
print(is_classic(url))  # False

Кодирование

from cs2_inspect_lite import encode_hex, ItemInfo, Sticker

item = ItemInfo(
    defindex=7,
    paintindex=422,
    paintseed=922,
    paintwear=0.04121,
    rarity=3,
    quality=4,
    stickers=[
        Sticker(slot=0, sticker_id=7436),
        Sticker(slot=1, sticker_id=5144, wear=0.1),
    ],
)

hex_str = encode_hex(item)            # plain формат (key=0)
hex_str = encode_hex(item, xor_key=0xE3)  # обфусцированный

Поддерживаемые форматы URL

Формат Пример Offline
Masked steam://run/730//+csgo_econ_action_preview%20<hex> Да
Hybrid ...S<id>A<id>D<hex_proto> Да
Classic ...S<id>A<id>D<decimal> Нет (нужен GC)

Структура ItemInfo

Поле Тип Описание
defindex int Тип оружия
paintindex int Индекс скина
paintwear float Float value (износ)
paintseed int Pattern seed
rarity int Редкость
quality int Качество
stickers list[Sticker] Наклейки
keychains list[Sticker] Брелоки
itemid int ID предмета
customname str Nametag

Тесты

pip install pytest
pytest tests/

Лицензия

MIT

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

cs2_inspect_lite-0.1.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

cs2_inspect_lite-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file cs2_inspect_lite-0.1.0.tar.gz.

File metadata

  • Download URL: cs2_inspect_lite-0.1.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cs2_inspect_lite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e81e6874f84d4be5b0f286f99213adde44f16861e3eb78e969926da85ec91d86
MD5 588f51898d1c67fd9669ecc8b87e4707
BLAKE2b-256 5b8ce628668aad3cb3f598994a39ac0baa518ac1d40412cc285a62a2640412b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for cs2_inspect_lite-0.1.0.tar.gz:

Publisher: publish.yml on cs2floatscanner/cs2_inspect_lite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cs2_inspect_lite-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cs2_inspect_lite-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f33e1219dd26eb8941dc6c1c050959e94d325e4ed40989af0e44cb493f25ba8d
MD5 af65e986ebd181400ababd527b8e4583
BLAKE2b-256 284cf7d1bd416834ba11c3b65fc0150e87daa155aa3fcb553aea6bd5180ca720

See more details on using hashes here.

Provenance

The following attestation bundles were made for cs2_inspect_lite-0.1.0-py3-none-any.whl:

Publisher: publish.yml on cs2floatscanner/cs2_inspect_lite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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