TornAPIWrapper 2.5.0__py3-none-any.whl → 2.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,8 +26,8 @@ __author__ = "cxdzc"
26
26
  __copyright__ = "Copyright 2023-Present cxdzc"
27
27
  __license__ = "MIT"
28
28
  __title__ = "TornAPIWrapper"
29
- __version__ = "2.5.0"
30
- __patch__ = "20.04.2026"
29
+ __version__ = "2.6.0"
30
+ __patch__ = "30.04.2026"
31
31
 
32
32
  from .errors import (
33
33
  WrapperError,
TornAPIWrapper/client.py CHANGED
@@ -25,6 +25,7 @@ DEALINGS IN THE SOFTWARE.
25
25
  import requests
26
26
 
27
27
  from . import __version__
28
+ from .endpoints.company import Company
28
29
  from .endpoints.faction import Faction
29
30
  from .endpoints.forum import Forum
30
31
  from .endpoints.key import Key
@@ -50,6 +51,7 @@ class TornAPIWrapper:
50
51
 
51
52
  self.user: User = User(self)
52
53
  self.faction: Faction = Faction(self)
54
+ self.company: Company = Company(self)
53
55
  self.market: Market = Market(self)
54
56
  self.forum: Forum = Forum(self)
55
57
  self.racing: Racing = Racing(self)
@@ -25,6 +25,7 @@ DEALINGS IN THE SOFTWARE.
25
25
  import aiohttp
26
26
 
27
27
  from . import __version__
28
+ from .endpoints_async.company import Company
28
29
  from .endpoints_async.faction import Faction
29
30
  from .endpoints_async.forum import Forum
30
31
  from .endpoints_async.key import Key
@@ -56,6 +57,7 @@ class TornAPIWrapperAsync:
56
57
 
57
58
  self.user: User = User(self)
58
59
  self.faction: Faction = Faction(self)
60
+ self.company: Company = Company(self)
59
61
  self.market: Market = Market(self)
60
62
  self.forum: Forum = Forum(self)
61
63
  self.racing: Racing = Racing(self)
@@ -0,0 +1,111 @@
1
+ """
2
+ The MIT License (MIT)
3
+
4
+ Copyright (c) 2023-Present cxdzc
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a
7
+ copy of this software and associated documentation files (the "Software"),
8
+ to deal in the Software without restriction, including without limitation
9
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
+ and/or sell copies of the Software, and to permit persons to whom the
11
+ Software is furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ DEALINGS IN THE SOFTWARE.
23
+ """
24
+
25
+ from __future__ import annotations
26
+
27
+ from typing import TYPE_CHECKING
28
+
29
+ from ..params.builders import build_params
30
+
31
+ if TYPE_CHECKING:
32
+ from ..client import TornAPIWrapper
33
+
34
+ class Company:
35
+ """
36
+ Company API endpoints.
37
+ """
38
+
39
+ def __init__(self, api: TornAPIWrapper):
40
+ self.api = api
41
+
42
+ def get_applications(self, timestamp: int = None, comment: str = None):
43
+ """
44
+ Get your company's applications.
45
+ API key (Limited).
46
+ :param timestamp: Timestamp to bypass cache.
47
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
48
+ :return: API response data.
49
+ :rtype: dict
50
+ """
51
+ return self.api.request("/company/applications", build_params(self.get_applications, locals()))
52
+
53
+ def get_employees(self, company_id: int = None, striptags: bool = True, timestamp: int = None, comment: str = None):
54
+ """
55
+ Get my company's employees.
56
+ API key (Public).
57
+ When using Limited, Custom or Full access API keys, the response will be of type CompanyEmployeeExtended, otherwise it will be of type CompanyEmployee.
58
+ :param company_id: Company id.
59
+ :param striptags: Determines if fields include HTML or not ('Hospitalized by user' vs 'Hospitalized by user').
60
+ :param timestamp: Timestamp to bypass cache.
61
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
62
+ :return: API response data.
63
+ :rtype: dict
64
+ """
65
+ return self.api.request("/company/employees", build_params(self.get_employees, locals()))
66
+
67
+ def get_profile(self, company_id: int = None, striptags: bool = True, timestamp: int = None, comment: str = None):
68
+ """
69
+ Get a company's profile.
70
+ API key (Public).
71
+ When using Limited, Custom or Full access API keys, the response will be of type CompanyEmployeeExtended, otherwise it will be of type CompanyEmployee.
72
+ :param company_id: Company id.
73
+ :param striptags: Determines if fields include HTML or not ('Hospitalized by user' vs 'Hospitalized by user').
74
+ :param timestamp: Timestamp to bypass cache.
75
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
76
+ :return: API response data.
77
+ :rtype: dict
78
+ """
79
+ return self.api.request("/company/profile", build_params(self.get_profile, locals()))
80
+
81
+ def get_stock(self, timestamp: int = None, comment: str = None):
82
+ """
83
+ Get your company's stock.
84
+ API key (Limited).
85
+ :param timestamp: Timestamp to bypass cache.
86
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
87
+ :return: API response data.
88
+ :rtype: dict
89
+ """
90
+ return self.api.request("/company/stock", build_params(self.get_stock, locals()))
91
+
92
+ def get_lookup(self, timestamp: int = None, comment: str = None):
93
+ """
94
+ API key (Public).
95
+ :param timestamp: Timestamp to bypass cache.
96
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
97
+ :return: API response data.
98
+ :rtype: dict
99
+ """
100
+ return self.api.request("/company/lookup", build_params(self.get_lookup, locals()))
101
+
102
+ def get_timestamp(self, timestamp: int = None, comment: str = None):
103
+ """
104
+ Get current server time.
105
+ API key (Public).
106
+ :param timestamp: Timestamp to bypass cache.
107
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
108
+ :return: API response data.
109
+ :rtype: dict
110
+ """
111
+ return self.api.request("/company/timestamp", build_params(self.get_timestamp, locals()))
@@ -0,0 +1,111 @@
1
+ """
2
+ The MIT License (MIT)
3
+
4
+ Copyright (c) 2023-Present cxdzc
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a
7
+ copy of this software and associated documentation files (the "Software"),
8
+ to deal in the Software without restriction, including without limitation
9
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
+ and/or sell copies of the Software, and to permit persons to whom the
11
+ Software is furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ DEALINGS IN THE SOFTWARE.
23
+ """
24
+
25
+ from __future__ import annotations
26
+
27
+ from typing import TYPE_CHECKING
28
+
29
+ from ..params.builders import build_params
30
+
31
+ if TYPE_CHECKING:
32
+ from ..client_async import TornAPIWrapperAsync
33
+
34
+ class Company:
35
+ """
36
+ Company API endpoints.
37
+ """
38
+
39
+ def __init__(self, api: TornAPIWrapperAsync):
40
+ self.api = api
41
+
42
+ async def get_applications(self, timestamp: int = None, comment: str = None):
43
+ """
44
+ Get your company's applications.
45
+ API key (Limited).
46
+ :param timestamp: Timestamp to bypass cache.
47
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
48
+ :return: API response data.
49
+ :rtype: dict
50
+ """
51
+ return await self.api.request("/company/applications", build_params(self.get_applications, locals()))
52
+
53
+ async def get_employees(self, company_id: int = None, striptags: bool = True, timestamp: int = None, comment: str = None):
54
+ """
55
+ Get my company's employees.
56
+ API key (Public).
57
+ When using Limited, Custom or Full access API keys, the response will be of type CompanyEmployeeExtended, otherwise it will be of type CompanyEmployee.
58
+ :param company_id: Company id.
59
+ :param striptags: Determines if fields include HTML or not ('Hospitalized by user' vs 'Hospitalized by user').
60
+ :param timestamp: Timestamp to bypass cache.
61
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
62
+ :return: API response data.
63
+ :rtype: dict
64
+ """
65
+ return await self.api.request("/company/employees", build_params(self.get_employees, locals()))
66
+
67
+ async def get_profile(self, company_id: int = None, striptags: bool = True, timestamp: int = None, comment: str = None):
68
+ """
69
+ Get a company's profile.
70
+ API key (Public).
71
+ When using Limited, Custom or Full access API keys, the response will be of type CompanyEmployeeExtended, otherwise it will be of type CompanyEmployee.
72
+ :param company_id: Company id.
73
+ :param striptags: Determines if fields include HTML or not ('Hospitalized by user' vs 'Hospitalized by user').
74
+ :param timestamp: Timestamp to bypass cache.
75
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
76
+ :return: API response data.
77
+ :rtype: dict
78
+ """
79
+ return await self.api.request("/company/profile", build_params(self.get_profile, locals()))
80
+
81
+ async def get_stock(self, timestamp: int = None, comment: str = None):
82
+ """
83
+ Get your company's stock.
84
+ API key (Limited).
85
+ :param timestamp: Timestamp to bypass cache.
86
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
87
+ :return: API response data.
88
+ :rtype: dict
89
+ """
90
+ return await self.api.request("/company/stock", build_params(self.get_stock, locals()))
91
+
92
+ async def get_lookup(self, timestamp: int = None, comment: str = None):
93
+ """
94
+ API key (Public).
95
+ :param timestamp: Timestamp to bypass cache.
96
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
97
+ :return: API response data.
98
+ :rtype: dict
99
+ """
100
+ return await self.api.request("/company/lookup", build_params(self.get_lookup, locals()))
101
+
102
+ async def get_timestamp(self, timestamp: int = None, comment: str = None):
103
+ """
104
+ Get current server time.
105
+ API key (Public).
106
+ :param timestamp: Timestamp to bypass cache.
107
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
108
+ :return: API response data.
109
+ :rtype: dict
110
+ """
111
+ return await self.api.request("/company/timestamp", build_params(self.get_timestamp, locals()))
@@ -7,6 +7,7 @@ param_ids = {"category_ids", "honor_ids", "item_ids", "medals_ids", "territory_i
7
7
  param_filters = {"attack_filters", "crimes_filter", "property_filters"}
8
8
  param_id = {
9
9
  "chain_id",
10
+ "company_id",
10
11
  "crime_id",
11
12
  "faction_id",
12
13
  "item_id",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TornAPIWrapper
3
- Version: 2.5.0
3
+ Version: 2.6.0
4
4
  Summary: A Python wrapper for the Torn City API, providing access to Torn City data.
5
5
  Author: cxdzc
6
6
  License: The MIT License (MIT)
@@ -53,7 +53,7 @@ Dynamic: license-file
53
53
  <a href="https://pypi.org/project/TornAPIWrapper/"><img src=https://img.shields.io/pypi/v/tornapiwrapper?cacheSeconds=300></a>
54
54
  <a href="https://pypi.org/project/TornAPIWrapper/"><img src=https://img.shields.io/pypi/pyversions/tornapiwrapper?cacheSeconds=300></a>
55
55
  <a href="https://pypi.org/project/TornAPIWrapper/"><img src=https://img.shields.io/pepy/dt/tornapiwrapper?color=blue&cacheSeconds=300></a>
56
- <a href="https://www.torn.com/api.html#:~:text=Patch%20Notes"><img src=https://img.shields.io/badge/patch-20.04.2026-c4c4c4?cacheSeconds=300></a>
56
+ <a href="https://www.torn.com/api.html#:~:text=Patch%20Notes"><img src=https://img.shields.io/badge/patch-30.04.2026-c4c4c4?cacheSeconds=300></a>
57
57
  <a rel="license" href="https://github.com/cxdzc/TornAPIWrapper/blob/main/LICENSE"><img alt="MIT License" src="https://img.shields.io/badge/license-MIT-ab1436"/></a>
58
58
  </div>
59
59
 
@@ -1,10 +1,11 @@
1
- TornAPIWrapper/__init__.py,sha256=5UVw9XlrU2w9mmcTO4yZjauCnIcvMIvbCFjoXs7dfIY,2763
1
+ TornAPIWrapper/__init__.py,sha256=I9doGBtL4Cb-X4uXjaG7IT91KVi-6qB73NmRAj9mMNc,2763
2
2
  TornAPIWrapper/__main__.py,sha256=JKsDOr6esnYwiUO5HypNL_0ieiEc5YCItsLwdMfxyLs,1806
3
- TornAPIWrapper/client.py,sha256=W8S0lSwx5sz-rZWhUjBwJqMov_zFplDbJVZPsNis8os,3114
4
- TornAPIWrapper/client_async.py,sha256=vqL4-ZOEGdSLlqsluA_UI17TE86qlpYbCQ7MkXEahc0,3885
3
+ TornAPIWrapper/client.py,sha256=IFKujsxf2A1buBsQwPmXbxgjRVmXg2rwNBBKv9OXCFc,3199
4
+ TornAPIWrapper/client_async.py,sha256=rn_AtgrtgNeumiwKD29F7f8l-4Oxr41AnMXbSGVQXqY,3976
5
5
  TornAPIWrapper/errors.py,sha256=lq0c7tA7M7-7r7rE7Mt1Edp9lOc4iEGY1BLazYrBEz4,9328
6
6
  TornAPIWrapper/type_hints.py,sha256=B5xgRDSptf7jfUAhJ4qvaZMlSoXjwLfMFuqJbWsQvFM,8971
7
7
  TornAPIWrapper/endpoints/__init__.py,sha256=UoVUdkQ9O_wgG2QJvIsOMFtYR0n2-XjUCFUccBSbD7A,1126
8
+ TornAPIWrapper/endpoints/company.py,sha256=IGs8KoGpBwsgfUQiB9YYyoHb1DC5J6N6TlGekoPhQiU,4831
8
9
  TornAPIWrapper/endpoints/faction.py,sha256=sdqaBvckixkCL1zfKqC0B8B0rwKRB7sc8CI6EzQ9qe0,30608
9
10
  TornAPIWrapper/endpoints/forum.py,sha256=F9ocJ9RAiC67Cvdmgj08GGiqPmITT3-_lZL6Lox8zGY,5701
10
11
  TornAPIWrapper/endpoints/key.py,sha256=GC8e7Z28mKViAauqr38gjAMJfWHns5Rn5sNOICHy854,2494
@@ -14,6 +15,7 @@ TornAPIWrapper/endpoints/racing.py,sha256=xjoGHTNmnqbqyhZeetBXRVcFdKYUAM_m6paomP
14
15
  TornAPIWrapper/endpoints/torn.py,sha256=utJ4vz3hLXaqNdEq-ycs78nsqwYvyGh3oEJqlZEzz6E,16558
15
16
  TornAPIWrapper/endpoints/user.py,sha256=Uig-vvDMK5_8FbUaOpUmh_05XcJPIZ8FNWgEzIfwLMQ,45853
16
17
  TornAPIWrapper/endpoints_async/__init__.py,sha256=1x2hi50HSEPTeUVrUD1NQTkhpLjyVGg8kDo4LcXFcP8,1132
18
+ TornAPIWrapper/endpoints_async/company.py,sha256=8y_vky7HpG1J6jsfuebatdiRRB7tArcjJYBXM7jx-kA,4919
17
19
  TornAPIWrapper/endpoints_async/faction.py,sha256=823cLOK4Y9sqWfP_ARJacJrd4eJbTZlGhjLDw8Uh0C8,31032
18
20
  TornAPIWrapper/endpoints_async/forum.py,sha256=rIxZYuViGnUYSerak0whRHdbZlLfCbVJMg3roVRLEGU,5789
19
21
  TornAPIWrapper/endpoints_async/key.py,sha256=d04B-YVkghJBqnyroGABlUX_HD-PNFAT-mI1ZYeipbk,2534
@@ -24,9 +26,9 @@ TornAPIWrapper/endpoints_async/torn.py,sha256=wo1yecshY3wXDbzGpUC7nA_0GCznBQvRT2
24
26
  TornAPIWrapper/endpoints_async/user.py,sha256=wg1oi-aSOXBmoV6CnOTqeXDKtd8tqbe_tCPJZWP1Q40,46625
25
27
  TornAPIWrapper/params/__init__.py,sha256=62xgULpfqEnTYmzSz_6W2MVGtna4DFb6oABy02ZsGcY,1123
26
28
  TornAPIWrapper/params/builders.py,sha256=WQIHSmMgJedNpwps8p4QjXvMLG-s09QBsT1Qynaxx1s,2057
27
- TornAPIWrapper/params/map.py,sha256=VIc9tKoxPWETwJA2-t4NUlIVg7QmqBXcda9QGccuxrs,1364
28
- tornapiwrapper-2.5.0.dist-info/licenses/LICENSE,sha256=tFxfnm48fk5x0JCMs1t7Ao6XDt_bHn_ogl3Y_q2EuPc,1079
29
- tornapiwrapper-2.5.0.dist-info/METADATA,sha256=OXmXVr6nrSd2W9J2-0svxYP_nkSU1PFrxG7rzyn7Uuo,5069
30
- tornapiwrapper-2.5.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
31
- tornapiwrapper-2.5.0.dist-info/top_level.txt,sha256=z3QKLWbCxzb7qZb9LV37myVFXQm3hgA57PGuSWkc4R4,15
32
- tornapiwrapper-2.5.0.dist-info/RECORD,,
29
+ TornAPIWrapper/params/map.py,sha256=nvZEklgS1IZYmwTY1vv9HQZjV8zJdU9xL3DAXGCtCno,1382
30
+ tornapiwrapper-2.6.0.dist-info/licenses/LICENSE,sha256=tFxfnm48fk5x0JCMs1t7Ao6XDt_bHn_ogl3Y_q2EuPc,1079
31
+ tornapiwrapper-2.6.0.dist-info/METADATA,sha256=p-q7bHp0ZLap4JalfPiAUuzmJfJRTdyMp7JnbRJwVAg,5069
32
+ tornapiwrapper-2.6.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
33
+ tornapiwrapper-2.6.0.dist-info/top_level.txt,sha256=z3QKLWbCxzb7qZb9LV37myVFXQm3hgA57PGuSWkc4R4,15
34
+ tornapiwrapper-2.6.0.dist-info/RECORD,,