Skip to content

Commit 3d62c07

Browse files
authored
Merge pull request #16 from offish/v2.2.0
v2.2.0
2 parents b85c24e + de8baa0 commit 3d62c07

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1345
-35377
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: documentation
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
permissions:
6+
contents: write
7+
8+
jobs:
9+
docs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-python@v3
14+
- name: Install dependencies
15+
run: |
16+
pip install sphinx furo
17+
- name: Sphinx build
18+
run: |
19+
sphinx-build docs _build
20+
- name: Deploy to GitHub Pages
21+
uses: peaceiris/actions-gh-pages@v3
22+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
23+
with:
24+
publish_branch: gh-pages
25+
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
publish_dir: _build/
27+
force_orphan: true

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.vscode
22
__pycache__
3-
jsons
3+
jsons
4+
config.py
5+
_build

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019-2023 offish
3+
Copyright (c) 2019-2024 offish
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 0 additions & 127 deletions
This file was deleted.

README.rst

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
tf2-utils
2+
=========
3+
|license| |stars| |issues| |repo_size| |discord| |code_style| |downloads|
4+
5+
``tf2-utils`` is a collection of tools and utilities for TF2 trading.
6+
Use 3rd party inventory providers, SKUs formatting, interact with various APIs, websockets and more.
7+
``tf2-utils`` is built on top of `tf2-sku <https://github.com/offish/tf2-sku>`_ and `tf2-data <https://github.com/offish/tf2-data>`_.
8+
``tf2-utils`` is a key dependency of `tf2-express <https://github.com/offish/tf2-express>`_.
9+
10+
Donate
11+
------
12+
13+
- BTC: ``bc1qntlxs7v76j0zpgkwm62f6z0spsvyezhcmsp0z2``
14+
- `Steam Trade Offer <https://steamcommunity.com/tradeoffer/new/?partner=293059984&token=0-l_idZR>`_
15+
16+
You can reach me at `Steam <https://steamcommunity.com/id/confern>`_,
17+
my `Discord server <https://discord.gg/t8nHSvA>`_
18+
or `Discord profile <https://discord.com/users/252183247843229696>`_.
19+
20+
Features
21+
--------
22+
23+
- Built-in currency picking (metal + keys) for sending offers
24+
- Interact with BackpackTF's API
25+
- Interact with PricesTF's API
26+
- Get MarketplaceTF item prices and stocks
27+
- Get SKUs directly from inventories/offers
28+
- Convert names to SKUs and vice versa
29+
- Fetch inventories using 3rd party providers or your own (avoid being rate-limited)
30+
- Listen for Backpack.TF websocket events
31+
- Listen for Prices.TF websocket events
32+
- Get item properties (``is_craft_hat``, ``get_paint``, ``get_effect`` and more)
33+
- Fetch TF2 Schema data
34+
- Convert SKU/defindex to item image URL
35+
- Calculate scrap and refined prices
36+
- Convert SteamIDs
37+
- and more...
38+
39+
Documentation
40+
-------------
41+
Documentation including usage and examples can be found `here <https://offish.github.io/tf2-utils/>`_.
42+
43+
Installing
44+
----------
45+
46+
.. code-block:: bash
47+
48+
pip install tf2-utils
49+
# or
50+
python -m pip install tf2-utils
51+
52+
Updating
53+
~~~~~~~~
54+
55+
.. code-block:: bash
56+
57+
pip install --upgrade tf2-utils tf2-sku tf2-data
58+
# or
59+
python -m pip install --upgrade tf2-utils tf2-sku tf2-data
60+
61+
62+
Development
63+
-----------
64+
65+
Testing
66+
~~~~~~~
67+
.. code-block:: bash
68+
69+
# tf2-utils/
70+
python -m unittest
71+
72+
Documentation
73+
~~~~~~~~~~~~~
74+
.. code-block:: bash
75+
76+
# tf2-utils/docs/
77+
pip install sphinx furo
78+
make clean # .\make.bat <command> on windows
79+
make html
80+
81+
When submitting a pull request, please make sure to run the tests (+ make new ones if applicable)
82+
and update the documentation. Run the code through ``black`` and ``flake8`` before submitting.
83+
84+
License
85+
-------
86+
MIT License
87+
88+
Copyright (c) 2019-2024 offish (`confern <https://steamcommunity.com/id/confern>`_)
89+
90+
Permission is hereby granted, free of charge, to any person obtaining a copy
91+
of this software and associated documentation files (the "Software"), to deal
92+
in the Software without restriction, including without limitation the rights
93+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
94+
copies of the Software, and to permit persons to whom the Software is
95+
furnished to do so, subject to the following conditions:
96+
97+
The above copyright notice and this permission notice shall be included in all
98+
copies or substantial portions of the Software.
99+
100+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
101+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
102+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
103+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
104+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
105+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
106+
SOFTWARE.
107+
108+
.. |license| image:: https://img.shields.io/github/license/offish/tf2-utils.svg
109+
:target: https://github.com/offish/tf2-utils/blob/master/LICENSE
110+
:alt: License
111+
112+
.. |stars| image:: https://img.shields.io/github/stars/offish/tf2-utils.svg
113+
:target: https://github.com/offish/tf2-utils/stargazers
114+
:alt: Stars
115+
116+
.. |issues| image:: https://img.shields.io/github/issues/offish/tf2-utils.svg
117+
:target: https://github.com/offish/tf2-utils/issues
118+
:alt: Issues
119+
120+
.. |repo_size| image:: https://img.shields.io/github/repo-size/offish/tf2-utils.svg
121+
:target: https://github.com/offish/tf2-utils
122+
:alt: Size
123+
124+
.. |discord| image:: https://img.shields.io/discord/467040686982692865?color=7289da&label=Discord&logo=discord
125+
:target: https://discord.gg/t8nHSvA
126+
:alt: Discord
127+
128+
.. |code_style| image:: https://img.shields.io/badge/code%20style-black-000000.svg
129+
:target: https://github.com/psf/black
130+
:alt: Code style
131+
132+
.. |downloads| image:: https://img.shields.io/pypi/dm/tf2-utils
133+
:target: https://pypi.org/project/tf2-utils/
134+
:alt: Downloads

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
# flake8: noqa
6+
import re
7+
import os
8+
import sys
9+
10+
sys.path.insert(0, os.path.abspath(".."))
11+
sys.path.append(os.path.abspath("extensions"))
12+
13+
14+
# -- Project information -----------------------------------------------------
15+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
16+
17+
project = "tf2-utils"
18+
copyright = "2019-2024, offish (confern)"
19+
author = "offish"
20+
21+
with open("../src/tf2_utils/__init__.py") as f:
22+
version = re.search(
23+
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE
24+
).group(1)
25+
26+
# The full version, including alpha/beta/rc tags
27+
release = version
28+
29+
# -- General configuration ---------------------------------------------------
30+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
31+
32+
extensions = []
33+
34+
templates_path = ["_templates"]
35+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
36+
37+
extensions = [
38+
"sphinx.ext.duration",
39+
"sphinx.ext.doctest",
40+
"sphinx.ext.autodoc",
41+
"sphinx.ext.autosummary",
42+
"sphinx.ext.napoleon",
43+
]
44+
45+
autodoc_member_order = "bysource"
46+
autodoc_mock_imports = ["requests", "websockets", "tf2_data", "tf2_sku"]
47+
48+
# -- Options for HTML output -------------------------------------------------
49+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
50+
51+
napoleon_google_docstring = True
52+
napoleon_numpy_docstring = False
53+
napoleon_include_init_with_doc = False
54+
napoleon_include_private_with_doc = False
55+
napoleon_include_special_with_doc = True
56+
napoleon_use_admonition_for_examples = False
57+
napoleon_use_admonition_for_notes = False
58+
napoleon_use_admonition_for_references = False
59+
napoleon_use_ivar = False
60+
napoleon_use_param = True
61+
napoleon_use_rtype = True
62+
napoleon_preprocess_types = False
63+
napoleon_type_aliases = None
64+
napoleon_attr_annotations = True
65+
66+
html_theme = "furo"

0 commit comments

Comments
 (0)