Skip to main content

CS2 pattern utility

Project description

Contributors Forks Stargazers Issues Downloads GPLv3 License

cs2pattern

Overview

cs2pattern is a python package used to identify different rare pattern from counter-strike skins given a pattern number.

Installation

pip install cs2pattern

Usage

Quick start

To check if your skin has a rare pattern:

from cs2pattern import check_rare

# Provide full item name and pattern number
result = check_rare("★ Karambit | Case Hardened (Factory New)", 269)
if result.rare:
    if result.ordered and result.order:
        rank, total = result.order
        print(f"Rare pattern: {result.name} (rank {rank}/{total})")
    else:
        print(f"Rare pattern: {result.name}")

#=> Rare pattern: gem_blue (rank 5/14)

Modular helpers

When you already know the skin family you care about, import the helper functions:

from cs2pattern import gem_black

patterns, ordered = gem_black("skeleton knife")
print(f"Patterns: {patterns} / Ordered: {ordered}")

#=> Patterns: [446, 791, 497, 28] / Ordered: True

Raw catalog access

Helper names match the pattern groups inside pattern.json, so you can discover what is available by calling get_pattern_dict() and inspecting the keys.

from cs2pattern import get_pattern_dict

catalog = get_pattern_dict()
scorched_ursus = catalog["scorched"]["ursus knife"][0]
print(scorched_ursus["pattern"])

#=> [446, 791]

Contributing

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

License

GPLv3 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

cs2pattern-0.9.0.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

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

cs2pattern-0.9.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file cs2pattern-0.9.0.tar.gz.

File metadata

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

File hashes

Hashes for cs2pattern-0.9.0.tar.gz
Algorithm Hash digest
SHA256 5fce1a3d7657e7ebe15a45e3dfd99ac9fbbe8d927f59530f4238991b756aa613
MD5 e8f957721e631e4aec6c094f0da570f7
BLAKE2b-256 3d9a696942dd3283b6aac181d6d9ad4894a653a9b83b3eccf225b9e4c2ea301d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cs2pattern-0.9.0.tar.gz:

Publisher: python-publish.yml on Helyux/cs2pattern

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

File details

Details for the file cs2pattern-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: cs2pattern-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cs2pattern-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12a98d1b80146fa94384b68063a49d3e5565c7b1f961879286d0cc20c3258318
MD5 80b1980b7ed2b41600c90e7e2ce9c52e
BLAKE2b-256 b7bf819c3363a900c5262e0d4be010f7225b6fa518c1fd4aa220a4b51f8061f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for cs2pattern-0.9.0-py3-none-any.whl:

Publisher: python-publish.yml on Helyux/cs2pattern

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