stntrading


Namestntrading JSON
Version 1.1.0 PyPI version JSON
download
home_page
SummaryInteract with STNTrading's API
upload_time2024-01-20 11:20:09
maintainer
docs_urlNone
author
requires_python>=3.10
license
keywords tf2 stntrading stn
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # stntrading
[![License](https://img.shields.io/github/license/offish/stntrading.svg)](https://github.com/offish/stntrading/blob/master/LICENSE)
[![Stars](https://img.shields.io/github/stars/offish/stntrading.svg)](https://github.com/offish/stntrading/stargazers)
[![Issues](https://img.shields.io/github/issues/offish/stntrading.svg)](https://github.com/offish/stntrading/issues)
[![Size](https://img.shields.io/github/repo-size/offish/stntrading.svg)](https://github.com/offish/stntrading)
[![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)

Interact with STNTrading.eu's API hosted at https://api.stntrading.eu

For getting inventories and item names, I recommend using [tf2-utils](https://github.com/offish/tf2-utils). 


## Installation
```bash
pip install stntrading
```

### Update
```bash
pip install --upgrade stntrading
```

# Setup
Find or register your API key on https://stntrading.eu/dev/apikey

If you want to access BETA endpoints shown [here](https://github.com/STNTrading/public-api/wiki), you need STN Premium.
For more information read [this](https://api.stntrading.eu/docs/#/beta).


# Usage
```python
>>> from stntrading import STN, EStateCodes

>>> stn = STN("26bf8abb59e86b4301aaff5b88547aaf") # (fake api key)

>>> stn.get_key_prices()
{'success': 1, 'result': {'pricing': {'buyPrice': 570.0, 'sellPrice': 606.0}}}

>>> stn.get_key_stock()
{'success': 1, 'result': {'stock': {'canBuy': 15, 'canSell': 15, 'stockLevel': 702, 'stockLimit': 1770}}}

>>> stn.request_key_trade("buy", 1)
{'success': 0, 'error': "Failed to create trade: 'NotEnoughCurrenciesUser'"}

>>> stn.get_trade_status(20530029)
{'success': 1, 'result': {'trade': {'state': 15, 'tradeOfferId': 6697968536}}}

>>> EStateCodes(15).name
CANCELLED_AFTER_SENDING

>>> stn.request_item_trade("buy", "The Team Captain", 1)
{'success': 1, 'result': {'tradeDetails': {'id': 20530029, 'bot': '76561198309976634'}}}

>>> stn.request_item_trade("sell", [12552033523], 1)
{'success': 0, 'error': "Failed to create trade: 'UserItemOverstocked'"}

# ----------------------
# if STN Premium access:
# ----------------------
>>> stn.get_schema()
{'success': 1, 'result': {'schema': ['A Brush with Death', 'A Color Similar to Slate', 'A Deep Commitment to Purple', ...]}}

>>> stn.get_item_details("The Team Captain")
{'success': 1, 'item': {'full_name': 'The Team Captain', 'pricing': {'buy': {'keys': 0, 'metal': 10.0}, 'sell': {'keys': 0, 'metal': 10.88}}, 'stock': {'level': 48, 'limit': 100}}}
```


# Documentation
Documentation can be found on the [official wiki](https://github.com/STNTrading/public-api/wiki) or using [Swagger](https://api.stntrading.eu/docs/).


# License
Copyright (c) 2020-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
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.


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "stntrading",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "tf2,stntrading,stn",
    "author": "",
    "author_email": "offish <overutilization@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/e1/7f/2b96e5bc6018595892df1d1a6845727940a18c7496e4e0a5cefa1e98eba2/stntrading-1.1.0.tar.gz",
    "platform": null,
    "description": "# stntrading\n[![License](https://img.shields.io/github/license/offish/stntrading.svg)](https://github.com/offish/stntrading/blob/master/LICENSE)\n[![Stars](https://img.shields.io/github/stars/offish/stntrading.svg)](https://github.com/offish/stntrading/stargazers)\n[![Issues](https://img.shields.io/github/issues/offish/stntrading.svg)](https://github.com/offish/stntrading/issues)\n[![Size](https://img.shields.io/github/repo-size/offish/stntrading.svg)](https://github.com/offish/stntrading)\n[![Discord](https://img.shields.io/discord/467040686982692865?color=7289da&label=Discord&logo=discord)](https://discord.gg/t8nHSvA)\n[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nInteract with STNTrading.eu's API hosted at https://api.stntrading.eu\n\nFor getting inventories and item names, I recommend using [tf2-utils](https://github.com/offish/tf2-utils). \n\n\n## Installation\n```bash\npip install stntrading\n```\n\n### Update\n```bash\npip install --upgrade stntrading\n```\n\n# Setup\nFind or register your API key on https://stntrading.eu/dev/apikey\n\nIf you want to access BETA endpoints shown [here](https://github.com/STNTrading/public-api/wiki), you need STN Premium.\nFor more information read [this](https://api.stntrading.eu/docs/#/beta).\n\n\n# Usage\n```python\n>>> from stntrading import STN, EStateCodes\n\n>>> stn = STN(\"26bf8abb59e86b4301aaff5b88547aaf\") # (fake api key)\n\n>>> stn.get_key_prices()\n{'success': 1, 'result': {'pricing': {'buyPrice': 570.0, 'sellPrice': 606.0}}}\n\n>>> stn.get_key_stock()\n{'success': 1, 'result': {'stock': {'canBuy': 15, 'canSell': 15, 'stockLevel': 702, 'stockLimit': 1770}}}\n\n>>> stn.request_key_trade(\"buy\", 1)\n{'success': 0, 'error': \"Failed to create trade: 'NotEnoughCurrenciesUser'\"}\n\n>>> stn.get_trade_status(20530029)\n{'success': 1, 'result': {'trade': {'state': 15, 'tradeOfferId': 6697968536}}}\n\n>>> EStateCodes(15).name\nCANCELLED_AFTER_SENDING\n\n>>> stn.request_item_trade(\"buy\", \"The Team Captain\", 1)\n{'success': 1, 'result': {'tradeDetails': {'id': 20530029, 'bot': '76561198309976634'}}}\n\n>>> stn.request_item_trade(\"sell\", [12552033523], 1)\n{'success': 0, 'error': \"Failed to create trade: 'UserItemOverstocked'\"}\n\n# ----------------------\n# if STN Premium access:\n# ----------------------\n>>> stn.get_schema()\n{'success': 1, 'result': {'schema': ['A Brush with Death', 'A Color Similar to Slate', 'A Deep Commitment to Purple', ...]}}\n\n>>> stn.get_item_details(\"The Team Captain\")\n{'success': 1, 'item': {'full_name': 'The Team Captain', 'pricing': {'buy': {'keys': 0, 'metal': 10.0}, 'sell': {'keys': 0, 'metal': 10.88}}, 'stock': {'level': 48, 'limit': 100}}}\n```\n\n\n# Documentation\nDocumentation can be found on the [official wiki](https://github.com/STNTrading/public-api/wiki) or using [Swagger](https://api.stntrading.eu/docs/).\n\n\n# License\nCopyright (c) 2020-2024 offish\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the 'Software'), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Interact with STNTrading's API",
    "version": "1.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/offish/stntrading/issues",
        "Homepage": "https://github.com/offish/stntrading"
    },
    "split_keywords": [
        "tf2",
        "stntrading",
        "stn"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d540cfcdec1bf987834ff5c161144f8b928434564092f855e42ca11104f3b8ee",
                "md5": "b31a3246567ae3a74541a6fe3bfea4c6",
                "sha256": "670b0993ee02c2530d0eb2d458aa22ebb662c6c12dc055040dc17ea18a311336"
            },
            "downloads": -1,
            "filename": "stntrading-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b31a3246567ae3a74541a6fe3bfea4c6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 5887,
            "upload_time": "2024-01-20T11:20:07",
            "upload_time_iso_8601": "2024-01-20T11:20:07.846874Z",
            "url": "https://files.pythonhosted.org/packages/d5/40/cfcdec1bf987834ff5c161144f8b928434564092f855e42ca11104f3b8ee/stntrading-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e17f2b96e5bc6018595892df1d1a6845727940a18c7496e4e0a5cefa1e98eba2",
                "md5": "87fd6b3f3b16227f042e5fbf911d84f1",
                "sha256": "3adeddee715a384b6387ce58928f2a96938724c66de3f66dc331baf09f978db0"
            },
            "downloads": -1,
            "filename": "stntrading-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "87fd6b3f3b16227f042e5fbf911d84f1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 6069,
            "upload_time": "2024-01-20T11:20:09",
            "upload_time_iso_8601": "2024-01-20T11:20:09.670938Z",
            "url": "https://files.pythonhosted.org/packages/e1/7f/2b96e5bc6018595892df1d1a6845727940a18c7496e4e0a5cefa1e98eba2/stntrading-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-20 11:20:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "offish",
    "github_project": "stntrading",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "stntrading"
}
        
Elapsed time: 0.17775s