TornAPIWrapper 2.7.0__py3-none-any.whl → 2.9.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.7.0"
30
- __patch__ = "08.05.2026"
29
+ __version__ = "2.9.0"
30
+ __patch__ = "01.06.2026"
31
31
 
32
32
  from .errors import (
33
33
  WrapperError,
@@ -27,6 +27,7 @@ from __future__ import annotations
27
27
  from typing import TYPE_CHECKING
28
28
 
29
29
  from ..params.builders import build_params
30
+ from ..type_hints import CpnyNewsCatOptions, SortOptions
30
31
 
31
32
  if TYPE_CHECKING:
32
33
  from ..client import TornAPIWrapper
@@ -64,6 +65,38 @@ class Company:
64
65
  """
65
66
  return self.api.request("/company/employees", build_params(self.get_employees, locals()))
66
67
 
68
+ def get_news(self, news_category: CpnyNewsCatOptions, striptags: bool = False, limit: int = 100, sort: SortOptions = "DESC", to: int = None, from_: int = None, timestamp: int = None, comment: str = None):
69
+ """
70
+ Get your company's news details.
71
+ API key (Minimal).
72
+ :param news_category: News category type.
73
+ :param striptags: Determines if fields include HTML or not ('Hospitalized by user' vs 'Hospitalized by user').
74
+ :param limit: Number of results to return.
75
+ :param sort: Sorted by the greatest timestamps.
76
+ :param to: Timestamp that sets the upper limit for the data returned. Data returned will be up to and including this time.
77
+ :param from_: Timestamp that sets the lower limit for the data returned. Data returned will be after this time.
78
+ :param timestamp: Timestamp to bypass cache.
79
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
80
+ :return: API response data.
81
+ :rtype: dict
82
+ """
83
+ return self.api.request("/company/news", build_params(self.get_news, locals()))
84
+
85
+ def get_companies(self, company_type_id: int, striptags: bool = True, limit: int = 20, offset: int = None, timestamp: int = None, comment: str = None):
86
+ """
87
+ Get a list of companies for a specific company type.
88
+ API key (Public).
89
+ :param company_type_id: Company type id.
90
+ :param limit: Number of results to return.
91
+ :param offset: Number of rows to skip before returning results.
92
+ :param striptags: Determines if fields include HTML or not ('Hospitalized by user' vs 'Hospitalized by user').
93
+ :param timestamp: Timestamp to bypass cache.
94
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
95
+ :return: API response data.
96
+ :rtype: dict
97
+ """
98
+ return self.api.request("/company/companies", build_params(self.get_companies, locals()))
99
+
67
100
  def get_profile(self, company_id: int = None, striptags: bool = True, timestamp: int = None, comment: str = None):
68
101
  """
69
102
  Get a company's profile.
@@ -78,6 +111,36 @@ class Company:
78
111
  """
79
112
  return self.api.request("/company/profile", build_params(self.get_profile, locals()))
80
113
 
114
+ def get_search(self, company_name: str = None, filters: list[str] = None, limit: int = 20, offset: int = 0, timestamp: int = None, comment: str = None) -> dict: #1F4A9 endpoint
115
+ """
116
+ Search companies by name or other criteria.
117
+ API key (Public).
118
+ This selection is standalone and cannot be used together with other selections.
119
+ :param company_name: Name to search for.
120
+ :param filters: A filtering query parameter allowing a comma-separated list of filters.
121
+ :param limit: Number of results to return.
122
+ :param offset: Number of rows to skip before returning results.
123
+ :param timestamp: Timestamp to bypass cache or get the data in specific point in time.
124
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
125
+ :return: API response data.
126
+ :rtype: dict
127
+ """
128
+ return self.api.request("/company/search", build_params(self.get_search, locals()))
129
+
130
+ def get_snapshot(self, timestamp: int = None, comment: str = None):
131
+ """
132
+ Get daily companies snapshot CSV.
133
+ API key (Public).
134
+ Returns a CSV daily snapshot of companies.
135
+ This selection is standalone and cannot be used together with other selections.
136
+ CSV columns: id, name, created_at, days_old, image, type, rating, director_id, employees_hired, employees_capacity, daily_income, daily_customers, weekly_income, weekly_customers, applications_allowed
137
+ :param timestamp: Timestamp to bypass cache or get the data in specific point in time.
138
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
139
+ :return: API response data.
140
+ :rtype: dict
141
+ """
142
+ return self.api.request("/company/snapshot", build_params(self.get_snapshot, locals()))
143
+
81
144
  def get_stock(self, timestamp: int = None, comment: str = None):
82
145
  """
83
146
  Get your company's stock.
@@ -27,6 +27,7 @@ from __future__ import annotations
27
27
  from typing import TYPE_CHECKING
28
28
 
29
29
  from ..params.builders import build_params
30
+ from ..type_hints import CpnyNewsCatOptions, SortOptions
30
31
 
31
32
  if TYPE_CHECKING:
32
33
  from ..client_async import TornAPIWrapperAsync
@@ -64,6 +65,38 @@ class Company:
64
65
  """
65
66
  return await self.api.request("/company/employees", build_params(self.get_employees, locals()))
66
67
 
68
+ async def get_news(self, news_category: CpnyNewsCatOptions, striptags: bool = False, limit: int = 100, sort: SortOptions = "DESC", to: int = None, from_: int = None, timestamp: int = None, comment: str = None):
69
+ """
70
+ Get your company's news details.
71
+ API key (Minimal).
72
+ :param news_category: News category type.
73
+ :param striptags: Determines if fields include HTML or not ('Hospitalized by user' vs 'Hospitalized by user').
74
+ :param limit: Number of results to return.
75
+ :param sort: Sorted by the greatest timestamps.
76
+ :param to: Timestamp that sets the upper limit for the data returned. Data returned will be up to and including this time.
77
+ :param from_: Timestamp that sets the lower limit for the data returned. Data returned will be after this time.
78
+ :param timestamp: Timestamp to bypass cache.
79
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
80
+ :return: API response data.
81
+ :rtype: dict
82
+ """
83
+ return await self.api.request("/company/news", build_params(self.get_news, locals()))
84
+
85
+ async def get_companies(self, company_type_id: int, striptags: bool = True, limit: int = 20, offset: int = None, timestamp: int = None, comment: str = None):
86
+ """
87
+ Get a list of companies for a specific company type.
88
+ API key (Public).
89
+ :param company_type_id: Company type id.
90
+ :param limit: Number of results to return.
91
+ :param offset: Number of rows to skip before returning results.
92
+ :param striptags: Determines if fields include HTML or not ('Hospitalized by user' vs 'Hospitalized by user').
93
+ :param timestamp: Timestamp to bypass cache.
94
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
95
+ :return: API response data.
96
+ :rtype: dict
97
+ """
98
+ return await self.api.request("/company/companies", build_params(self.get_companies, locals()))
99
+
67
100
  async def get_profile(self, company_id: int = None, striptags: bool = True, timestamp: int = None, comment: str = None):
68
101
  """
69
102
  Get a company's profile.
@@ -78,6 +111,36 @@ class Company:
78
111
  """
79
112
  return await self.api.request("/company/profile", build_params(self.get_profile, locals()))
80
113
 
114
+ async def get_search(self, company_name: str = None, filters: list[str] = None, limit: int = 20, offset: int = 0, timestamp: int = None, comment: str = None) -> dict: #1F4A9 endpoint
115
+ """
116
+ Search companies by name or other criteria.
117
+ API key (Public).
118
+ This selection is standalone and cannot be used together with other selections.
119
+ :param company_name: Name to search for.
120
+ :param filters: A filtering query parameter allowing a comma-separated list of filters.
121
+ :param limit: Number of results to return.
122
+ :param offset: Number of rows to skip before returning results.
123
+ :param timestamp: Timestamp to bypass cache or get the data in specific point in time.
124
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
125
+ :return: API response data.
126
+ :rtype: dict
127
+ """
128
+ return await self.api.request("/company/search", build_params(self.get_search, locals()))
129
+
130
+ async def get_snapshot(self, timestamp: int = None, comment: str = None):
131
+ """
132
+ Get daily companies snapshot CSV.
133
+ API key (Public).
134
+ Returns a CSV daily snapshot of companies.
135
+ This selection is standalone and cannot be used together with other selections.
136
+ CSV columns: id, name, created_at, days_old, image, type, rating, director_id, employees_hired, employees_capacity, daily_income, daily_customers, weekly_income, weekly_customers, applications_allowed
137
+ :param timestamp: Timestamp to bypass cache or get the data in specific point in time.
138
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
139
+ :return: API response data.
140
+ :rtype: dict
141
+ """
142
+ return await self.api.request("/company/snapshot", build_params(self.get_snapshot, locals()))
143
+
81
144
  async def get_stock(self, timestamp: int = None, comment: str = None):
82
145
  """
83
146
  Get your company's stock.
@@ -1,6 +1,6 @@
1
1
  param_from = {"from_"}
2
2
  param_target = {"target_id"}
3
- param_name = {"faction_name"}
3
+ param_name = {"company_name", "faction_name"}
4
4
  param_stat = {"stat_key", "stat_keys"}
5
5
  param_log = {"attack_log_id", "log_id"}
6
6
  param_ids = {"category_ids", "honor_ids", "item_ids", "medals_ids", "territory_ids"}
@@ -8,6 +8,7 @@ param_filters = {"attack_filters", "crimes_filter", "property_filters"}
8
8
  param_id = {
9
9
  "chain_id",
10
10
  "company_id",
11
+ "company_type_id",
11
12
  "crime_id",
12
13
  "faction_id",
13
14
  "item_id",
@@ -43,6 +43,8 @@ FacCrimesCatOptions = Literal["all", "recruiting", "planning", "failure", "succe
43
43
  FacNewsCatOptions = Literal["main", "attack", "armoryDeposit", "armoryAction", "territoryWar", "rankedWar", "territoryGain", "chain", "crime", "membership", "depositFunds", "giveFunds"]
44
44
  FacContributorsStatOptions = Literal["medicalitemsused", "criminaloffences", "organisedcrimerespect", "organisedcrimemoney", "organisedcrimesuccess", "organisedcrimefail", "attackswon", "attackslost", "attackschain", "attacksleave", "attacksmug", "attackshosp", "bestchain", "busts", "revives", "jails", "hosps", "medicalitemrecovery", "medicalcooldownused", "gymtrains", "gymstrength", "gymspeed", "gymenergy", "gymdefense", "gymdexterity", "candyused", "alcoholused", "energydrinkused", "drugsused", "drugoverdoses", "rehabs", "caymaninterest", "traveltimes", "traveltime", "hunting", "attacksdamagehits", "attacksdamage", "hosptimegiven", "hosptimereceived", "attacksdamaging", "attacksrunaway", "highestterritories", "territoryrespect", "membersamount", "factionage", "upgradesamount"]
45
45
 
46
+ CpnyNewsCatOptions = Literal["main", "funds", "training", "employees", "all"]
47
+
46
48
  MrktBazaarCatOptions = Literal["Alcohol", "Artifact", "Booster", "Candy", "Car", "Clothing", "Collectible", "Defensive", "Drug", "Energy Drink", "Enhancer", "Flower", "Jewelry", "Material", "Medical", "Melee", "Other", "Plushie", "Primary", "Secondary", "Special", "Supply Pack", "Temporary", "Tool"]
47
49
  MrktItemBonusOptions = Literal["Any", "Double", "Yellow", "Orange", "Red", "Achilles", "Assassinate", "Backstab", "Berserk", "Bleed", "Blindfire", "Blindside", "Bloodlust", "Burn", "Comeback", "Conserve", "Cripple", "Crusher", "Cupid", "Deadeye", "Deadly", "Demoralize", "Disarm", "Double-edged", "Double Tap", "Emasculate", "Empower", "Eviscerate", "Execute", "Expose", "Finale", "Focus", "Freeze", "Frenzy", "Fury", "Grace", "Hazardous", "Home run", "Irradiate", "Lacerate", "Motivation", "Paralyze", "Parry", "Penetrate", "Plunder", "Poison", "Powerful", "Proficience", "Puncture", "Quicken", "Rage", "Revitalize", "Roshambo", "Shock", "Sleep", "Slow", "Smash", "Smurf", "Specialist", "Spray", "Storage", "Stricken", "Stun", "Suppress", "Sure Shot", "Throttle", "Toxin", "Warlord", "Weaken", "Wind-up", "Wither"]
48
50
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TornAPIWrapper
3
- Version: 2.7.0
3
+ Version: 2.9.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-08.05.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-01.06.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,11 +1,11 @@
1
- TornAPIWrapper/__init__.py,sha256=av4M0lmoPvxkQNbi4uFFquxccHS0nJY9PU2cMXLU7qw,2763
1
+ TornAPIWrapper/__init__.py,sha256=KYA3CC89grnh3B-S1jkYCs_5YrfUFaFA2afhcggfVBg,2763
2
2
  TornAPIWrapper/__main__.py,sha256=JKsDOr6esnYwiUO5HypNL_0ieiEc5YCItsLwdMfxyLs,1806
3
3
  TornAPIWrapper/client.py,sha256=IFKujsxf2A1buBsQwPmXbxgjRVmXg2rwNBBKv9OXCFc,3199
4
4
  TornAPIWrapper/client_async.py,sha256=rn_AtgrtgNeumiwKD29F7f8l-4Oxr41AnMXbSGVQXqY,3976
5
5
  TornAPIWrapper/errors.py,sha256=lq0c7tA7M7-7r7rE7Mt1Edp9lOc4iEGY1BLazYrBEz4,9328
6
- TornAPIWrapper/type_hints.py,sha256=B5xgRDSptf7jfUAhJ4qvaZMlSoXjwLfMFuqJbWsQvFM,8971
6
+ TornAPIWrapper/type_hints.py,sha256=tf0RLIKI4LKupMLyOVywUPvUBO07k0lfrWr2Qmc-d7U,9050
7
7
  TornAPIWrapper/endpoints/__init__.py,sha256=UoVUdkQ9O_wgG2QJvIsOMFtYR0n2-XjUCFUccBSbD7A,1126
8
- TornAPIWrapper/endpoints/company.py,sha256=IGs8KoGpBwsgfUQiB9YYyoHb1DC5J6N6TlGekoPhQiU,4831
8
+ TornAPIWrapper/endpoints/company.py,sha256=ibcIZTDJD8RDfH_G_GpaQKpU8A4hceM1OwicwwLSyTM,8699
9
9
  TornAPIWrapper/endpoints/faction.py,sha256=sdqaBvckixkCL1zfKqC0B8B0rwKRB7sc8CI6EzQ9qe0,30608
10
10
  TornAPIWrapper/endpoints/forum.py,sha256=F9ocJ9RAiC67Cvdmgj08GGiqPmITT3-_lZL6Lox8zGY,5701
11
11
  TornAPIWrapper/endpoints/key.py,sha256=GC8e7Z28mKViAauqr38gjAMJfWHns5Rn5sNOICHy854,2494
@@ -15,7 +15,7 @@ TornAPIWrapper/endpoints/racing.py,sha256=xjoGHTNmnqbqyhZeetBXRVcFdKYUAM_m6paomP
15
15
  TornAPIWrapper/endpoints/torn.py,sha256=utJ4vz3hLXaqNdEq-ycs78nsqwYvyGh3oEJqlZEzz6E,16558
16
16
  TornAPIWrapper/endpoints/user.py,sha256=q8kHn2VAnybjAxt3Sr2qJ80nol5YYm6dDJyRic0CLKM,46336
17
17
  TornAPIWrapper/endpoints_async/__init__.py,sha256=1x2hi50HSEPTeUVrUD1NQTkhpLjyVGg8kDo4LcXFcP8,1132
18
- TornAPIWrapper/endpoints_async/company.py,sha256=8y_vky7HpG1J6jsfuebatdiRRB7tArcjJYBXM7jx-kA,4919
18
+ TornAPIWrapper/endpoints_async/company.py,sha256=gCrb2TJYpR93b8-gAfQlW3k0QGCzhUZUzLOwpCUj0Rs,8835
19
19
  TornAPIWrapper/endpoints_async/faction.py,sha256=823cLOK4Y9sqWfP_ARJacJrd4eJbTZlGhjLDw8Uh0C8,31032
20
20
  TornAPIWrapper/endpoints_async/forum.py,sha256=rIxZYuViGnUYSerak0whRHdbZlLfCbVJMg3roVRLEGU,5789
21
21
  TornAPIWrapper/endpoints_async/key.py,sha256=d04B-YVkghJBqnyroGABlUX_HD-PNFAT-mI1ZYeipbk,2534
@@ -26,9 +26,9 @@ TornAPIWrapper/endpoints_async/torn.py,sha256=wo1yecshY3wXDbzGpUC7nA_0GCznBQvRT2
26
26
  TornAPIWrapper/endpoints_async/user.py,sha256=cm5d0INBrZ3xukzOhcLIQcDeCqfHnhKGctpGlS0CtNg,47120
27
27
  TornAPIWrapper/params/__init__.py,sha256=62xgULpfqEnTYmzSz_6W2MVGtna4DFb6oABy02ZsGcY,1123
28
28
  TornAPIWrapper/params/builders.py,sha256=WQIHSmMgJedNpwps8p4QjXvMLG-s09QBsT1Qynaxx1s,2057
29
- TornAPIWrapper/params/map.py,sha256=nvZEklgS1IZYmwTY1vv9HQZjV8zJdU9xL3DAXGCtCno,1382
30
- tornapiwrapper-2.7.0.dist-info/licenses/LICENSE,sha256=tFxfnm48fk5x0JCMs1t7Ao6XDt_bHn_ogl3Y_q2EuPc,1079
31
- tornapiwrapper-2.7.0.dist-info/METADATA,sha256=lnQBDrrz9MLpvptPp0UDPxVwZn9Z9DCxGye1S2YKNYI,5069
32
- tornapiwrapper-2.7.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
33
- tornapiwrapper-2.7.0.dist-info/top_level.txt,sha256=z3QKLWbCxzb7qZb9LV37myVFXQm3hgA57PGuSWkc4R4,15
34
- tornapiwrapper-2.7.0.dist-info/RECORD,,
29
+ TornAPIWrapper/params/map.py,sha256=rWxyyQBpUsqQYgjoZRqNWYwr0JfinFMpQtX7FNtGTDs,1421
30
+ tornapiwrapper-2.9.0.dist-info/licenses/LICENSE,sha256=tFxfnm48fk5x0JCMs1t7Ao6XDt_bHn_ogl3Y_q2EuPc,1079
31
+ tornapiwrapper-2.9.0.dist-info/METADATA,sha256=pvPj4mjTDHh9hsiZ5ZKvxNQkppQaI9u3UmfBEmTTIOE,5069
32
+ tornapiwrapper-2.9.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
33
+ tornapiwrapper-2.9.0.dist-info/top_level.txt,sha256=z3QKLWbCxzb7qZb9LV37myVFXQm3hgA57PGuSWkc4R4,15
34
+ tornapiwrapper-2.9.0.dist-info/RECORD,,