TornAPIWrapper 2.1.1__tar.gz → 2.3.0__tar.gz

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.
Files changed (37) hide show
  1. {tornapiwrapper-2.1.1/src/TornAPIWrapper.egg-info → tornapiwrapper-2.3.0}/PKG-INFO +2 -2
  2. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/README.md +2 -2
  3. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/__init__.py +2 -2
  4. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints/torn.py +12 -0
  5. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints/user.py +43 -1
  6. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints_async/torn.py +12 -0
  7. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints_async/user.py +11 -0
  8. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/params/map.py +3 -0
  9. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/type_hints.py +1 -0
  10. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0/src/TornAPIWrapper.egg-info}/PKG-INFO +2 -2
  11. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/LICENSE +0 -0
  12. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/pyproject.toml +0 -0
  13. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/setup.cfg +0 -0
  14. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/__main__.py +0 -0
  15. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/client.py +0 -0
  16. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/client_async.py +0 -0
  17. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints/__init__.py +0 -0
  18. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints/faction.py +0 -0
  19. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints/forum.py +0 -0
  20. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints/key.py +0 -0
  21. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints/market.py +0 -0
  22. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints/property.py +0 -0
  23. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints/racing.py +0 -0
  24. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints_async/__init__.py +0 -0
  25. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints_async/faction.py +0 -0
  26. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints_async/forum.py +0 -0
  27. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints_async/key.py +0 -0
  28. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints_async/market.py +0 -0
  29. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints_async/property.py +0 -0
  30. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/endpoints_async/racing.py +0 -0
  31. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/errors.py +0 -0
  32. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/params/__init__.py +0 -0
  33. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper/params/builders.py +0 -0
  34. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper.egg-info/SOURCES.txt +0 -0
  35. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper.egg-info/dependency_links.txt +0 -0
  36. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper.egg-info/requires.txt +0 -0
  37. {tornapiwrapper-2.1.1 → tornapiwrapper-2.3.0}/src/TornAPIWrapper.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TornAPIWrapper
3
- Version: 2.1.1
3
+ Version: 2.3.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-19.02.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-10.03.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
 
@@ -6,7 +6,7 @@
6
6
  <a href="https://pypi.org/project/TornAPIWrapper/"><img src=https://img.shields.io/pypi/v/tornapiwrapper?cacheSeconds=300></a>
7
7
  <a href="https://pypi.org/project/TornAPIWrapper/"><img src=https://img.shields.io/pypi/pyversions/tornapiwrapper?cacheSeconds=300></a>
8
8
  <a href="https://pypi.org/project/TornAPIWrapper/"><img src=https://img.shields.io/pepy/dt/tornapiwrapper?color=blue&cacheSeconds=300></a>
9
- <a href="https://www.torn.com/api.html#:~:text=Patch%20Notes"><img src=https://img.shields.io/badge/patch-19.02.2026-c4c4c4?cacheSeconds=300></a>
9
+ <a href="https://www.torn.com/api.html#:~:text=Patch%20Notes"><img src=https://img.shields.io/badge/patch-10.03.2026-c4c4c4?cacheSeconds=300></a>
10
10
  <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>
11
11
  </div>
12
12
 
@@ -43,4 +43,4 @@ View [CONTRIBUTING.md](https://github.com/cxdzc/TornAPIWrapper?tab=contributing-
43
43
  > [!NOTE]
44
44
  > This is not legal advice.
45
45
 
46
- The content and software in this repository are licensed under the [MIT License](https://github.com/cxdzc/TornAPIWrapper?tab=MIT-1-ov-file), a simple and permissive license that allows use, modification, and distribution as long as the license notice is preserved.
46
+ The content and software in this repository are licensed under the [MIT License](https://github.com/cxdzc/TornAPIWrapper?tab=MIT-1-ov-file), a simple and permissive license that allows use, modification, and distribution as long as the license notice is preserved.
@@ -26,8 +26,8 @@ __author__ = "cxdzc"
26
26
  __copyright__ = "Copyright 2023-Present cxdzc"
27
27
  __license__ = "MIT"
28
28
  __title__ = "TornAPIWrapper"
29
- __version__ = "2.1.1"
30
- __patch__ = "19.02.2026"
29
+ __version__ = "2.3.0"
30
+ __patch__ = "10.03.2026"
31
31
 
32
32
  from .errors import (
33
33
  WrapperError,
@@ -301,6 +301,18 @@ class Torn:
301
301
  """
302
302
  return self.api.request("/torn/properties", build_params(self.get_properties, locals()))
303
303
 
304
+ def get_stocks(self, stock_id: int = None, timestamp: int = None, comment: str = None) -> dict:
305
+ """
306
+ Get all stocks or specific stock with chart history.
307
+ API key (Public).
308
+ :param stock_id: Stock id.
309
+ :param timestamp: Timestamp to bypass cache.
310
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
311
+ :return: API response data.
312
+ :rtype: dict
313
+ """
314
+ return self.api.request("/torn/stocks", build_params(self.get_stocks, locals()))
315
+
304
316
  def get_subcrimes(self, crime_id: int, timestamp: int = None, comment: str = None) -> dict:
305
317
  """
306
318
  Get Subcrimes information.
@@ -28,7 +28,8 @@ from typing import TYPE_CHECKING
28
28
 
29
29
  from ..params.builders import build_params
30
30
  from ..type_hints import SortOptions, RaceCatOptions, UserListCatOptions, AttackFiltersOptions, \
31
- UserPropertiesFiltersOptions, ReportCatOptions, UserPrsnlStatsCatOptions, UserPrsnlStatsStatOptions
31
+ UserPropertiesFiltersOptions, ReportCatOptions, UserPrsnlStatsCatOptions, UserPrsnlStatsStatOptions, \
32
+ UserTradeCatOptions
32
33
 
33
34
  if TYPE_CHECKING:
34
35
  from ..client import TornAPIWrapper
@@ -724,6 +725,47 @@ class User:
724
725
  """
725
726
  return self.api.request("/user/skills", build_params(self.get_skills, locals()))
726
727
 
728
+ def get_stocks(self, timestamp: int = None, comment: str = None) -> dict:
729
+ """
730
+ Get your stocks.
731
+ API key (Limited).
732
+ :param timestamp: Timestamp to bypass cache.
733
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
734
+ :return: API response data.
735
+ :rtype: dict
736
+ """
737
+ return self.api.request("/user/stocks", build_params(self.get_stocks, locals()))
738
+
739
+ def get_trades(self, trade_category: UserTradeCatOptions = "ongoing", limit: int = 100, sort: SortOptions = "DESC", to: int = None, from_: int = None, timestamp: int = None, comment: str = None) -> dict:
740
+ """
741
+ Get your trades.
742
+ API key (Limited).
743
+ When requesting 'ongoing' trades (default), limit/offset/sort are not being used.
744
+ :param trade_category: Category of trades returned.
745
+ :param limit: Number of results to return.
746
+ :param sort: Sorted by the greatest timestamps.
747
+ :param to: Timestamp that sets the upper limit for the data returned. Data returned will be up to and including this time.
748
+ :param from_: Timestamp that sets the lower limit for the data returned. Data returned will be after this time.
749
+ :param timestamp: Timestamp to bypass cache.
750
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
751
+ :return: API response data.
752
+ :rtype: dict
753
+ """
754
+ return self.api.request("/user/trades", build_params(self.get_trades, locals()))
755
+
756
+ def get_trade(self, trade_id: int, timestamp: int = None, comment: str = None) -> dict:
757
+ """
758
+ Get your detailed trade.
759
+ API key (Limited).
760
+ Only possible to get trades you participated in.
761
+ :param trade_id: Trade id.
762
+ :param timestamp: Timestamp to bypass cache.
763
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
764
+ :return: API response data.
765
+ :rtype: dict
766
+ """
767
+ return self.api.request("/user/trade", build_params(self.get_trade, locals()))
768
+
727
769
  def get_travel(self, timestamp: int = None, comment: str = None) -> dict:
728
770
  """
729
771
  Get your travel information.
@@ -301,6 +301,18 @@ class Torn:
301
301
  """
302
302
  return await self.api.request("/torn/properties", build_params(self.get_properties, locals()))
303
303
 
304
+ async def get_stocks(self, stock_id: int = None, timestamp: int = None, comment: str = None) -> dict:
305
+ """
306
+ Get all stocks or specific stock with chart history.
307
+ API key (Public).
308
+ :param stock_id: Stock id.
309
+ :param timestamp: Timestamp to bypass cache.
310
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
311
+ :return: API response data.
312
+ :rtype: dict
313
+ """
314
+ return await self.api.request("/torn/stocks", build_params(self.get_stocks, locals()))
315
+
304
316
  async def get_subcrimes(self, crime_id: int, timestamp: int = None, comment: str = None) -> dict:
305
317
  """
306
318
  Get Subcrimes information.
@@ -724,6 +724,17 @@ class User:
724
724
  """
725
725
  return await self.api.request("/user/skills", build_params(self.get_skills, locals()))
726
726
 
727
+ async def get_stocks(self, timestamp: int = None, comment: str = None) -> dict:
728
+ """
729
+ Get your stocks.
730
+ API key (Limited).
731
+ :param timestamp: Timestamp to bypass cache.
732
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
733
+ :return: API response data.
734
+ :rtype: dict
735
+ """
736
+ return await self.api.request("/user/stocks", build_params(self.get_stocks, locals()))
737
+
727
738
  async def get_travel(self, timestamp: int = None, comment: str = None) -> dict:
728
739
  """
729
740
  Get your travel information.
@@ -14,6 +14,8 @@ param_id = {
14
14
  "log_category_id_torn",
15
15
  "property_id",
16
16
  "property_type_id",
17
+ "stock_id",
18
+ "trade_id",
17
19
  "race_id",
18
20
  "raid_war_id",
19
21
  "ranked_war_id",
@@ -37,6 +39,7 @@ param_cat = {
37
39
  "race_category",
38
40
  "report_category",
39
41
  "stat_category",
42
+ "trade_category",
40
43
  "warfare_category",
41
44
  }
42
45
  param_group = {
@@ -29,6 +29,7 @@ RaceCatOptions = Literal["official", "custom"]
29
29
  AttackFiltersOptions = Literal["incoming", "outgoing", "idFilter"]
30
30
  ReportCatOptions = Literal["mostwanted", "money", "stats", "references", "friendorfoe", "companyfinancials", "truelevel", "stockanalysis", "anonymousbounties", "investment"]
31
31
 
32
+ UserTradeCatOptions = Literal["finished", "ongoing"]
32
33
  UserListCatOptions = Literal["Friends", "Enemies", "Targets"]
33
34
  UserPropertiesFiltersOptions = Literal["ownedByUser", "ownedBySpouse"]
34
35
  UserPrsnlStatsCatOptions = Literal["all", "popular", "attacking", "battle_stats", "jobs", "trading", "jail", "hospital", "finishing_hits", "communication", "crimes", "bounties", "investments", "items", "travel", "drugs", "missions", "racing", "networth", "other", "itemmarketcustomers", "itemmarketsales", "itemmarketrevenue", "itemmarketfees"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TornAPIWrapper
3
- Version: 2.1.1
3
+ Version: 2.3.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-19.02.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-10.03.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
 
File without changes
File without changes