async API wrapper for Tarkov Market written in Python.
Project description
async API wrapper for Tarkov Market written in Python. It is designed to reverse discord.py as a base.
What is Tarkov-Market.py?
Tarkov-Market.py is Modern Python API using async and await.
Installing
Python 3.8 or higher is required
# Linux/macOS
python3 -m pip install -U tarkov-market.py
# Windows
py -3 -m pip install -U tarkov-market.py
Quick Example
import asyncio
import tarkov_market
from typing import List
loop = asyncio.get_event_loop()
market = tarkov_market.Client(token='INSERT YOUR API KEY.', refresh_rate=None)
async def main() -> None:
# Find Item and return Items from preloaded Item List. It's Unlimited.
items: List[tarkov_market.Item] = market.find_items('keycard')
# Get Item by name. Can get it through uid and bsg_id.
item: tarkov_market.Item
item = market.get_item('Tactical glasses')
item = market.get_item(bsg_id='BSG_ID')
item = market.get_item(uid='UID')
print('Item Name: {}'.format(item.name))
print('Short Name: {}'.format(item.short_name))
print('Price {}'.format(item.price))
if __name__ == '__main__':
market.start()
loop.run_until_complete(main())
loop.close()
Fetch Example
import asyncio
import tarkov_market
from typing import List
loop = asyncio.get_event_loop()
market = tarkov_market.Client(token='INSERT YOUR API KEY.', loop=loop)
async def main():
# fetch the latest data from tarkov-market.
# there is a limit of 300 requests per minute to fetch.
# return the first data item from the request result.
item: tarkov_market.Item = await market.fetch_item('TerraGroup Labs keycard (Red)')
# return the items from the request results.
items: List[tarkov_market.Item] = await market.fetch_items('keycard')
return item
if __name__ == '__main__':
loop.run_until_complete(main())
loop.close()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tarkov-market.py-0.12.1.tar.gz
(10.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tarkov-market.py-0.12.1.tar.gz.
File metadata
- Download URL: tarkov-market.py-0.12.1.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1750b1883fcf426b42173b3cde80de2661f3bfdca823e9b3d339e4e2bf878b2
|
|
| MD5 |
e8b823ed12df8b3e0c288417440f74db
|
|
| BLAKE2b-256 |
e7a7ead911f1a8252e06d052b89c8d599eac8b7fa24b0d6b335919b528f2e40d
|
File details
Details for the file tarkov_market.py-0.12.1-py3-none-any.whl.
File metadata
- Download URL: tarkov_market.py-0.12.1-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b77fcbc336035dad6788be2cc337221f8300b80ac1305d49aee5f465598f6995
|
|
| MD5 |
cc20fc463491924f41bcbf1458eb7315
|
|
| BLAKE2b-256 |
527bcc919561bd5cb0f6a50f98a592fdf071fba894125a725645a16928f56299
|