Skip to content

Repository files navigation

ContributorsForksStargazersIssuesDownloadsGPLv3 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:

fromcs2patternimportcheck_rare# Provide full item name and pattern numberresult=check_rare("★ Karambit | Case Hardened (Factory New)", 269)
ifresult.rare:
ifresult.orderedandresult.order:
rank, total=result.orderprint(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:

fromcs2patternimportgem_blackpatterns, 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.

fromcs2patternimportget_pattern_dictcatalog=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.

About

Pattern utility for CS2 items

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages