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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e81e6874f84d4be5b0f286f99213adde44f16861e3eb78e969926da85ec91d86
|
|
| MD5 |
588f51898d1c67fd9669ecc8b87e4707
|
|
| BLAKE2b-256 |
5b8ce628668aad3cb3f598994a39ac0baa518ac1d40412cc285a62a2640412b5
|
Provenance
The following attestation bundles were made for cs2_inspect_lite-0.1.0.tar.gz:
Publisher:
publish.yml on cs2floatscanner/cs2_inspect_lite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cs2_inspect_lite-0.1.0.tar.gz -
Subject digest:
e81e6874f84d4be5b0f286f99213adde44f16861e3eb78e969926da85ec91d86 - Sigstore transparency entry: 1159485644
- Sigstore integration time:
-
Permalink:
cs2floatscanner/cs2_inspect_lite@1c43dacaf6a11470626984672572b97dc7d70294 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/cs2floatscanner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1c43dacaf6a11470626984672572b97dc7d70294 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cs2_inspect_lite-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cs2_inspect_lite-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f33e1219dd26eb8941dc6c1c050959e94d325e4ed40989af0e44cb493f25ba8d
|
|
| MD5 |
af65e986ebd181400ababd527b8e4583
|
|
| BLAKE2b-256 |
284cf7d1bd416834ba11c3b65fc0150e87daa155aa3fcb553aea6bd5180ca720
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cs2_inspect_lite-0.1.0-py3-none-any.whl -
Subject digest:
f33e1219dd26eb8941dc6c1c050959e94d325e4ed40989af0e44cb493f25ba8d - Sigstore transparency entry: 1159485748
- Sigstore integration time:
-
Permalink:
cs2floatscanner/cs2_inspect_lite@1c43dacaf6a11470626984672572b97dc7d70294 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/cs2floatscanner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1c43dacaf6a11470626984672572b97dc7d70294 -
Trigger Event:
release
-
Statement type: