Skip to content

Commit

Permalink
Merge pull request #16 from offish/v2.2.0
Browse files Browse the repository at this point in the history
v2.2.0
  • Loading branch information
offish authored Mar 26, 2024
2 parents b85c24e + de8baa0 commit 3d62c07
Show file tree
Hide file tree
Showing 47 changed files with 1,345 additions and 35,377 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: documentation

on: [push, pull_request, workflow_dispatch]

permissions:
contents: write

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install dependencies
run: |
pip install sphinx furo
- name: Sphinx build
run: |
sphinx-build docs _build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
force_orphan: true
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.vscode
__pycache__
jsons
jsons
config.py
_build
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019-2023 offish
Copyright (c) 2019-2024 offish

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
127 changes: 0 additions & 127 deletions README.md

This file was deleted.

134 changes: 134 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
tf2-utils
=========
|license| |stars| |issues| |repo_size| |discord| |code_style| |downloads|

``tf2-utils`` is a collection of tools and utilities for TF2 trading.
Use 3rd party inventory providers, SKUs formatting, interact with various APIs, websockets and more.
``tf2-utils`` is built on top of `tf2-sku <https://github.com/offish/tf2-sku>`_ and `tf2-data <https://github.com/offish/tf2-data>`_.
``tf2-utils`` is a key dependency of `tf2-express <https://github.com/offish/tf2-express>`_.

Donate
------

- BTC: ``bc1qntlxs7v76j0zpgkwm62f6z0spsvyezhcmsp0z2``
- `Steam Trade Offer <https://steamcommunity.com/tradeoffer/new/?partner=293059984&token=0-l_idZR>`_

You can reach me at `Steam <https://steamcommunity.com/id/confern>`_,
my `Discord server <https://discord.gg/t8nHSvA>`_
or `Discord profile <https://discord.com/users/252183247843229696>`_.

Features
--------

- Built-in currency picking (metal + keys) for sending offers
- Interact with BackpackTF's API
- Interact with PricesTF's API
- Get MarketplaceTF item prices and stocks
- Get SKUs directly from inventories/offers
- Convert names to SKUs and vice versa
- Fetch inventories using 3rd party providers or your own (avoid being rate-limited)
- Listen for Backpack.TF websocket events
- Listen for Prices.TF websocket events
- Get item properties (``is_craft_hat``, ``get_paint``, ``get_effect`` and more)
- Fetch TF2 Schema data
- Convert SKU/defindex to item image URL
- Calculate scrap and refined prices
- Convert SteamIDs
- and more...

Documentation
-------------
Documentation including usage and examples can be found `here <https://offish.github.io/tf2-utils/>`_.

Installing
----------

.. code-block:: bash
pip install tf2-utils
# or
python -m pip install tf2-utils
Updating
~~~~~~~~

.. code-block:: bash
pip install --upgrade tf2-utils tf2-sku tf2-data
# or
python -m pip install --upgrade tf2-utils tf2-sku tf2-data
Development
-----------

Testing
~~~~~~~
.. code-block:: bash
# tf2-utils/
python -m unittest
Documentation
~~~~~~~~~~~~~
.. code-block:: bash
# tf2-utils/docs/
pip install sphinx furo
make clean # .\make.bat <command> on windows
make html
When submitting a pull request, please make sure to run the tests (+ make new ones if applicable)
and update the documentation. Run the code through ``black`` and ``flake8`` before submitting.

License
-------
MIT License

Copyright (c) 2019-2024 offish (`confern <https://steamcommunity.com/id/confern>`_)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

.. |license| image:: https://img.shields.io/github/license/offish/tf2-utils.svg
:target: https://github.com/offish/tf2-utils/blob/master/LICENSE
:alt: License

.. |stars| image:: https://img.shields.io/github/stars/offish/tf2-utils.svg
:target: https://github.com/offish/tf2-utils/stargazers
:alt: Stars

.. |issues| image:: https://img.shields.io/github/issues/offish/tf2-utils.svg
:target: https://github.com/offish/tf2-utils/issues
:alt: Issues

.. |repo_size| image:: https://img.shields.io/github/repo-size/offish/tf2-utils.svg
:target: https://github.com/offish/tf2-utils
:alt: Size

.. |discord| image:: https://img.shields.io/discord/467040686982692865?color=7289da&label=Discord&logo=discord
:target: https://discord.gg/t8nHSvA
:alt: Discord

.. |code_style| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code style

.. |downloads| image:: https://img.shields.io/pypi/dm/tf2-utils
:target: https://pypi.org/project/tf2-utils/
:alt: Downloads
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
66 changes: 66 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# flake8: noqa
import re
import os
import sys

sys.path.insert(0, os.path.abspath(".."))
sys.path.append(os.path.abspath("extensions"))


# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "tf2-utils"
copyright = "2019-2024, offish (confern)"
author = "offish"

with open("../src/tf2_utils/__init__.py") as f:
version = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE
).group(1)

# The full version, including alpha/beta/rc tags
release = version

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = []

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

extensions = [
"sphinx.ext.duration",
"sphinx.ext.doctest",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
]

autodoc_member_order = "bysource"
autodoc_mock_imports = ["requests", "websockets", "tf2_data", "tf2_sku"]

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

napoleon_google_docstring = True
napoleon_numpy_docstring = False
napoleon_include_init_with_doc = False
napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = True
napoleon_use_admonition_for_examples = False
napoleon_use_admonition_for_notes = False
napoleon_use_admonition_for_references = False
napoleon_use_ivar = False
napoleon_use_param = True
napoleon_use_rtype = True
napoleon_preprocess_types = False
napoleon_type_aliases = None
napoleon_attr_annotations = True

html_theme = "furo"
Loading

0 comments on commit 3d62c07

Please sign in to comment.