Passed
Push — master ( be3abd...2506d1 )
by Steffen
01:21
created

UsageOPSkins.pricing_interface()   A

Complexity

Conditions 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3
#
4
# This is an example usage
5
6
import logging
7
from pprint import pprint
8
9
import kuon.bitskins.api.interfaces as bitskins_interfaces
10
import kuon.opskins.api.interfaces as opskins_interfaces
11
import kuon.opskins.common as opskins_common
12
from kuon.common import *
13
from kuon.watcher import Watcher
14
15
16
class UsageWatcher:
17
    """Example usage for the watcher class of Kuon"""
18
19
    @staticmethod
20
    def watcher():
21
        """Example watcher usage
22
23
        :return:
24
        """
25
        Watcher(log_level=logging.INFO)
26
27
28
class UsageBitSkins:
29
    """Example usages for the implementation of the BitSkins API"""
30
31
    @staticmethod
32
    def sales_interface():
33
        """Example sales interface usage
34
35
        :return:
36
        """
37
        sales_interface = bitskins_interfaces.ISales()
38
39
        pprint(sales_interface.get_sales_info(market_hash_name="M4A4 | Howl (Factory New)"))
40
41
42
class UsageOPSkins:
43
    """Example usages for the implementation of the OPSkins API"""
44
45
    @staticmethod
46
    def inventory_interface():
47
        """Example inventory interface usage
48
49
        :return:
50
        """
51
        inventory_interface = opskins_interfaces.IInventory()
52
        pprint(inventory_interface.withdraw(['123', '456']))
53
54
    @staticmethod
55
    def cashout_interface():
56
        """Example cashout interface usage
57
58
        :return:
59
        """
60
        cashout_interface = opskins_interfaces.ICashout()
61
        pprint(cashout_interface.get_address(opskins_common.Processor.PAYPAL))
62
63
    @staticmethod
64
    def pricing_interface():
65
        """Example pricing interface usage
66
67
        :return:
68
        """
69
        pricing_interface = opskins_interfaces.IPricing()
70
        pprint(pricing_interface.get_all_lowest_list_prices())
71
72
    @staticmethod
73
    def status_interface():
74
        """Example status interface usage
75
76
        :return:
77
        """
78
        status_interface = opskins_interfaces.IStatus()
79
        pprint(status_interface.get_bot_list().response.bots)
80
81
    @staticmethod
82
    def user_interface():
83
        """Example user interface usage
84
85
        :return:
86
        """
87
        user_interface = opskins_interfaces.IUser()
88
        pprint(user_interface.get_balance())
89
90
    @staticmethod
91
    def sales_interface():
92
        """Example sales interface usage
93
94
        :return:
95
        """
96
        sales_interface = opskins_interfaces.ISales()
97
98
        pprint(sales_interface.get_sales(status_type=opskins_common.ItemStatus.SOLD_AND_DELIVERED,
99
                                         app_id=CommonSteamGames.APP_ID_CSGO))
100
        pprint(sales_interface.get_last_sales(app_id=CommonSteamGames.APP_ID_CSGO, context_id=ContextIds.VALVE_GAMES,
101
                                              market_name='AK-47 | Aquamarine Revenge (Field-Tested)'))
102
        pprint(sales_interface.get_last_sales_no_delay(market_name='M4A4 | Howl (Factory New)'))
103
        pprint(sales_interface.search(search_item="howl min", app_id=CommonSteamGames.APP_ID_CSGO))
104
105
        # uses selenium chrome driver so initial call takes a few seconds to initialise the driver
106
        # on second use and later it will take way less time
107
        pprint(sales_interface.search_no_delay(search_item="howl min", app_id=CommonSteamGames.APP_ID_CSGO))
108
109
110
if __name__ == '__main__':
111
    # UsageWatcher.watcher()
112
    UsageBitSkins.sales_interface()
113