Skip to main content

async API wrapper for Tarkov Changes written in Python.

Project description

PyPI GitHub release (latest by date including pre-releases) https://img.shields.io/badge/Tarkov%20Changes-Provides%20API-abab99?style=for-the-badge&logo=appveyor&logoColor=ffffff

A Wrapper for the Tarkov Changes API written with Python.

Quick Examples

Basic use with use client

import tvc
import asyncio

from tvc import Ammunition
from typing import List

TOKEN: str = 'blahblah some token string'

client = tvc.TVCClient(token=TOKEN)


async def main():
    ammunition: List[Ammunition] = await client.fetch_ammunition('7.62x39mm BP gzh')

    if not ammunition:
        # fetch result can be return empty list.
        # If the list of ammunition what responded to is empty.
        print('Can not found ammunition!')
        return

    for ammo in ammunition:
        print(f"Name: {ammo}")

    # Returns all entries if you do not insert a query into the fetch function argument.
    ammunition: List[Ammunition] = await client.fetch_ammunition()

    for ammo in ammunition:
        print(f"Name: {ammo}")

if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())
    loop.close()

Simple to use without client declaration

import asyncio

from tvc import Ammunition, TVCClient
from typing import List

TOKEN: str = 'blahblah some token string'


async def main():

    async with TVCClient(TOKEN) as api:
        ammunition: List[Ammunition] = await api.fetch_ammunition('7.62x39mm BP gzh')

        if not ammunition:
            # fetch result can be return empty list.
            # If the list of ammunition what responded to is empty.
            print('Can not found ammunition!')
            return

        for ammo in ammunition:
            print(f"Name: {ammo}")

        # Returns all entries if you do not insert a query into the fetch function argument.
        ammunition: List[Ammunition] = await api.fetch_ammunition()

        for ammo in ammunition:
            print(f"Name: {ammo}")

    # When you exit the `async with` syntax, aiohttp.ClientSession is automatically and securely terminated.
    # When you use the `async with` with again, a new aiohttp.ClientSession is created again.

    async with TVCClient(TOKEN) as api:
        ...

if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())
    loop.close()

Update Logs

Check Here

View more examples

Click here!

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-changes.py-0.3.0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

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

tarkov_changes.py-0.3.0-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file tarkov-changes.py-0.3.0.tar.gz.

File metadata

  • Download URL: tarkov-changes.py-0.3.0.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for tarkov-changes.py-0.3.0.tar.gz
Algorithm Hash digest
SHA256 bfb5b056a286876dc78c27400196edcbd694e46a0e82072cbafa0299d366fa9e
MD5 c25291113e8ce71f1c4928ae09e5ebf0
BLAKE2b-256 65ae60027e4b46f83c4264719c553bcaa8cb371513a84bb6a9828e35b20c3120

See more details on using hashes here.

File details

Details for the file tarkov_changes.py-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tarkov_changes.py-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3708460410f28710f4840b1b4823a81f039d8dd0e0c3db8e22e509c7322f4e63
MD5 b7dbf1fccc009c1c1ae69b3c9d3b294e
BLAKE2b-256 6468169955500b1e8a090368c96595fa822a51192b522d8cdfe3f8f364380631

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