Skip to main content

CS2 inspect link utility

Project description

Contributors Forks Stargazers Issues MIT License Xing

cs2inspect

Overview

cs2inspect is a python package used for creating and working with CS2 inspect links and gen codes.

Features

  • Creating 'unmasked' inspect links (containing the owners steam id)

  • Creating 'masked' inspect links (not containing the owners steam id)

  • Creating gen codes

  • Checking inspect link validity (using regex)

  • Structured protobuf creation

  • Hex data handling (for 'masked' inspect links)

Installation

git clone https://github.com/Helyux/cs2inspect.git
cd cs2inspect
pip install -r requirements.txt

Example usage

import cs2inspect

# Build an inspect link from a known steam id ('unmasked' inspect link)
link_data = {
    'asset_id': '38350177019',
    'class_id': '9385506221951591925',
    'owner_id': '76561198066322090'
}
link_str = cs2inspect.link(link_data)
print(link_str)  # = steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198066322090A38350177019D9385506221951591925

# Or build an inspect link from data only ('masked' inspect link)
proto_base = cs2inspect.Builder(
    defindex=7,
    paintindex=941,
    paintseed=2,
    paintwear=0.22540508210659027,
    rarity=5,
)

# You can also change and add attributes of the proto_base after creation
proto_base.stickers.append({'slot': 2, 'sticker_id': 7203, 'wear': 0})

try:
    # Build the protobuf
    protobuf = proto_base.build()
except Exception as e:
    print(f"Build failed: {e}")
    exit(1)

link_str = cs2inspect.link(protobuf)
print(link_str)  # = steam://rungame/730/76561202255233023/+csgo_econ_action_preview%2000180720AD0728053897A19BF3034002620A080210A3381D000000006B570344

# You can also create gen codes from the protobuf
gen_str = cs2inspect.gen(protobuf, prefix="!g")  # You can omit prefix to get '!gen'
print(gen_str)   # = !g 7 941 2 0.22540508210659027 7203 0.0

Contributing

Contributions are welcome! Open an issue or submit a pull request.

License

MIT License. See the LICENSE file for details.

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

cs2inspect-0.0.2.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

cs2inspect-0.0.2-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file cs2inspect-0.0.2.tar.gz.

File metadata

  • Download URL: cs2inspect-0.0.2.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.2 Windows/10

File hashes

Hashes for cs2inspect-0.0.2.tar.gz
Algorithm Hash digest
SHA256 1dbb7537f7935869c51cc1a0143a9e2dd633244ad2b4444976ea951e47dd8548
MD5 dc75a9bb9183709a4dd8c200ecc1f735
BLAKE2b-256 1fbc5fd9977d733c1e73cf38ca7a9f41f76884d527b1bf93333b91b41f36fde7

See more details on using hashes here.

File details

Details for the file cs2inspect-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: cs2inspect-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.2 Windows/10

File hashes

Hashes for cs2inspect-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 00f6c05e1883abfe64d67d95d4819aa18c162b94fdaf162b2dcd363ef0f7718c
MD5 d3501350a1861f1cebc6ea9e079e7d2e
BLAKE2b-256 6d4c54d1be34d3c3b507f2ddcd5f48b01b83064e71251beff76936791ea6f22a

See more details on using hashes here.

Supported by

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