-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rewrite and new version * small fixes and documentation * update version number
- Loading branch information
Showing
15 changed files
with
323 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Upload Python Package | ||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
pypi: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- run: python3 -m pip install --upgrade build && python3 -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# tf2-sku | ||
[![License](https://img.shields.io/github/license/offish/tf2-sku.svg)](https://github.com/offish/tf2-sku/blob/master/LICENSE) | ||
[![Stars](https://img.shields.io/github/stars/offish/tf2-sku.svg)](https://github.com/offish/tf2-sku/stargazers) | ||
[![Issues](https://img.shields.io/github/issues/offish/tf2-sku.svg)](https://github.com/offish/tf2-sku/issues) | ||
[![Size](https://img.shields.io/github/repo-size/offish/tf2-sku.svg)](https://github.com/offish/tf2-sku) | ||
[![Discord](https://img.shields.io/discord/467040686982692865?color=7289da&label=Discord&logo=discord)](https://discord.gg/t8nHSvA) | ||
[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) | ||
|
||
Parse TF2 items to SKU format with Python. | ||
|
||
## Donate | ||
- BTC: `bc1qntlxs7v76j0zpgkwm62f6z0spsvyezhcmsp0z2` | ||
- [Steam Trade Offer](https://steamcommunity.com/tradeoffer/new/?partner=293059984&token=0-l_idZR) | ||
|
||
## Usage | ||
```python | ||
>>> from tf2_sku import to_sku, from_sku | ||
|
||
>>> to_sku({"defindex": 5021, "quality": 6}) | ||
"5021;6" | ||
# https://marketplace.tf/items/tf2/5021;6 | ||
|
||
>>> from_sku("161;3;kt-3") | ||
{ | ||
"defindex": 161, | ||
"quality": 3, | ||
"effect": -1, | ||
"australium": False, | ||
"craftable": True, | ||
"wear": -1, | ||
"skin": -1, | ||
"strange": -1, | ||
"killstreak_tier": 3, | ||
"target_defindex": -1, | ||
"festivized": False, | ||
"craft_number": -1, | ||
"crate_number": -1, | ||
"output_defindex": -1, | ||
"output_quality": -1, | ||
"paint": -1, | ||
} | ||
# https://marketplace.tf/items/tf2/161;3;kt-3 | ||
|
||
>>> to_sku({ | ||
... "defindex": 199, | ||
... "quality": 5, | ||
... "effect": 702, | ||
... "wear": 3, | ||
... "skin": 292, | ||
... "strange": True, | ||
... "killstreak_tier": 3}) | ||
"199;5;u702;w3;pk292;strange;kt-3" | ||
# https://marketplace.tf/items/tf2/199;5;u702;w3;pk292;strange;kt-3 | ||
``` | ||
|
||
## Setup | ||
### Install | ||
```bash | ||
pip install tf2-sku | ||
# or | ||
python -m pip install tf2-sku | ||
``` | ||
|
||
### Upgrade | ||
```bash | ||
pip upgrade tf2-sku | ||
# or | ||
python -m pip upgrade tf2-sku | ||
``` | ||
|
||
## Testing | ||
```bash | ||
# tf2-sku/ | ||
python -m unittest | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[build-system] | ||
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "tf2-sku" | ||
authors = [ | ||
{ name="offish", email="overutilization@gmail.com" }, | ||
] | ||
description = "Parse TF2 items to SKU format" | ||
readme = "README.md" | ||
requires-python = ">=3.7" | ||
keywords = ["tf2", "sku"] | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
] | ||
dependencies = [] | ||
dynamic = ["version"] | ||
|
||
[project.urls] | ||
"Homepage" = "https://github.com/offish/tf2-sku" | ||
"Bug Tracker" = "https://github.com/offish/tf2-sku/issues" | ||
|
||
[tool.setuptools_scm] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,3 @@ | ||
from setuptools import setup | ||
import re | ||
|
||
|
||
with open("README.rst", "r") as f: | ||
long_description = f.read() | ||
|
||
|
||
with open("tf2_sku/__init__.py") as f: | ||
version = re.search( | ||
r"""^__version__\s*=\s*['"]([^\'"]*)['"]""", f.read(), re.MULTILINE).group(1) | ||
|
||
|
||
setup( | ||
name="tf2_sku", | ||
version=version, | ||
author="offish", | ||
author_email="overutilization@gmail.com", | ||
description="Format TF2 items as strings or objects.", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
license="MIT", | ||
url="https://github.com/offish/tf2_sku", | ||
download_url="https://github.com/offish/tf2_sku/tarball/v" + version, | ||
packages=["tf2_sku"], | ||
classifiers=[ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
], | ||
python_requires='>=3.6', | ||
) | ||
setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
""" | ||
tf2_sku | ||
======= | ||
tf2-sku | ||
Format TF2 items as strings or objects. | ||
""" | ||
|
||
|
||
__title__ = "tf2_sku" | ||
__title__ = "tf2-sku" | ||
__author__ = "offish" | ||
__license__ = "MIT" | ||
__version__ = "1.0.1" | ||
|
||
__version__ = "2.0.0" | ||
|
||
from .sku import to_sku, from_sku | ||
from .prettify import prettify | ||
from .utils import SKU, MAPPING |
Oops, something went wrong.