Skip to main content

async API wrapper for Tarkov Market written in Python.

Project description

PyPI

async API wrapper for Tarkov Market written in Python. It is designed to reverse discord.py as a base.

PyPI

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


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.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tarkov_market.py-0.12.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file tarkov-market.py-0.12.0.tar.gz.

File metadata

  • Download URL: tarkov-market.py-0.12.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.9

File hashes

Hashes for tarkov-market.py-0.12.0.tar.gz
Algorithm Hash digest
SHA256 b7f1c07819eb2fff7bc3e8823004aed45f8ea99209f4f665c8c65268f0aaf859
MD5 20718b785a71dbc172f35c9fb334bafd
BLAKE2b-256 a5eeda6e3f285af9427aa2247ea6527497f13215d0a807a1292156b31a8a0bf3

See more details on using hashes here.

File details

Details for the file tarkov_market.py-0.12.0-py3-none-any.whl.

File metadata

  • Download URL: tarkov_market.py-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.9

File hashes

Hashes for tarkov_market.py-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43be13dd776fc26bae9c50c9c943263df6d369b058cc474394470e5bcf2886a4
MD5 9f1f9562d2b7a8b23800357e1316cdd5
BLAKE2b-256 0e7de8b03d0e1ade743669c85161d43c37468cc2a8a3773ba908ff412a2d8fad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page