TornAPIWrapper 2.3.1__py3-none-any.whl → 2.4.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.3.1"
30
- __patch__ = "10.03.2026"
29
+ __version__ = "2.4.0"
30
+ __patch__ = "15.04.2026"
31
31
 
32
32
  from .errors import (
33
33
  WrapperError,
@@ -29,7 +29,7 @@ from typing import TYPE_CHECKING
29
29
  from ..params.builders import build_params
30
30
  from ..type_hints import SortOptions, RaceCatOptions, UserListCatOptions, AttackFiltersOptions, \
31
31
  UserPropertiesFiltersOptions, ReportCatOptions, UserPrsnlStatsCatOptions, UserPrsnlStatsStatOptions, \
32
- UserTradeCatOptions
32
+ UserTradeCatOptions, UserInventoryCatOptions
33
33
 
34
34
  if TYPE_CHECKING:
35
35
  from ..client import TornAPIWrapper
@@ -365,6 +365,21 @@ class User:
365
365
  """
366
366
  return self.api.request("/user/icons", build_params(self.get_icons, locals()))
367
367
 
368
+ def get_inventory(self, inventory_category: UserInventoryCatOptions, limit: int = 20, offset: int = 0, timestamp: int = None, comment: str = None) -> dict:
369
+ """
370
+ Get your inventory.
371
+ API key (Limited).
372
+ Cached selection (1 hour per category).
373
+ :param inventory_category: Items category.
374
+ :param offset: Number of rows to skip before returning results.
375
+ :param limit: Number of results to return.
376
+ :param timestamp: Timestamp to bypass cache.
377
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
378
+ :return: API response data.
379
+ :rtype: dict
380
+ """
381
+ return self.api.request("/user/inventory", build_params(self.get_inventory, locals()))
382
+
368
383
  def get_itemmarket(self, offset: int = 0, timestamp: int = None, comment: str = None) -> dict:
369
384
  """
370
385
  Get your item market listings for a specific item.
@@ -29,7 +29,7 @@ from typing import TYPE_CHECKING
29
29
  from ..params.builders import build_params
30
30
  from ..type_hints import SortOptions, RaceCatOptions, UserListCatOptions, AttackFiltersOptions, \
31
31
  UserPropertiesFiltersOptions, ReportCatOptions, UserPrsnlStatsCatOptions, UserPrsnlStatsStatOptions, \
32
- UserTradeCatOptions
32
+ UserTradeCatOptions, UserInventoryCatOptions
33
33
 
34
34
  if TYPE_CHECKING:
35
35
  from ..client_async import TornAPIWrapperAsync
@@ -365,6 +365,21 @@ class User:
365
365
  """
366
366
  return await self.api.request("/user/icons", build_params(self.get_icons, locals()))
367
367
 
368
+ async def get_inventory(self, inventory_category: UserInventoryCatOptions, limit: int = 20, offset: int = 0, timestamp: int = None, comment: str = None) -> dict:
369
+ """
370
+ Get your inventory.
371
+ API key (Limited).
372
+ Cached selection (1 hour per category).
373
+ :param inventory_category: Items category.
374
+ :param offset: Number of rows to skip before returning results.
375
+ :param limit: Number of results to return.
376
+ :param timestamp: Timestamp to bypass cache.
377
+ :param comment: Comment for your tool/service/bot/website to be visible in the logs.
378
+ :return: API response data.
379
+ :rtype: dict
380
+ """
381
+ return await self.api.request("/user/inventory", build_params(self.get_inventory, locals()))
382
+
368
383
  async def get_itemmarket(self, offset: int = 0, timestamp: int = None, comment: str = None) -> dict:
369
384
  """
370
385
  Get your item market listings for a specific item.
@@ -14,15 +14,15 @@ param_id = {
14
14
  "log_category_id_torn",
15
15
  "property_id",
16
16
  "property_type_id",
17
- "stock_id",
18
- "trade_id",
19
17
  "race_id",
20
18
  "raid_war_id",
21
19
  "ranked_war_id",
20
+ "stock_id",
22
21
  "team_id",
23
22
  "territory_war_id",
24
23
  "thread_id",
25
24
  "track_id",
25
+ "trade_id",
26
26
  "user_id",
27
27
  }
28
28
  param_cat = {
@@ -31,6 +31,7 @@ param_cat = {
31
31
  "car_category",
32
32
  "contributors_category",
33
33
  "crimes_category",
34
+ "inventory_category",
34
35
  "item_category",
35
36
  "leaderboard_category",
36
37
  "list_category",
@@ -32,6 +32,7 @@ ReportCatOptions = Literal["mostwanted", "money", "stats", "references", "friend
32
32
  UserTradeCatOptions = Literal["finished", "ongoing"]
33
33
  UserListCatOptions = Literal["Friends", "Enemies", "Targets"]
34
34
  UserPropertiesFiltersOptions = Literal["ownedByUser", "ownedBySpouse"]
35
+ UserInventoryCatOptions = Literal["Collectible", "Clothing", "Other", "Tool", "Melee", "Defensive", "Material", "Car", "Primary", "Secondary", "Book", "Special", "Supply Pack", "Temporary", "Enhancer", "Artifact", "Flower", "Booster", "Medical", "Candy", "Jewelry", "Alcohol", "Plushie", "Drug", "Energy Drink"]
35
36
  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"]
36
37
  UserPrsnlStatsStatOptions = Literal["attackswon", "attackslost", "attacksdraw", "attacksassisted", "defendswon", "defendslost", "defendsstalemated", "elo", "yourunaway", "theyrunaway", "unarmoredwon", "bestkillstreak", "attackhits", "attackmisses", "attackdamage", "bestdamage", "onehitkills", "attackcriticalhits", "roundsfired", "specialammoused", "hollowammoused", "tracerammoused", "piercingammoused", "incendiaryammoused", "attacksstealthed", "retals", "moneymugged", "largestmug", "itemslooted", "highestbeaten", "respectforfaction", "rankedwarhits", "raidhits", "territoryjoins", "territoryclears", "territorytime", "jobpointsused", "trainsreceived", "marketitemsbought", "auctionswon", "auctionsells", "itemssent", "trades", "cityitemsbought", "pointsbought", "pointssold", "bazaarcustomers", "bazaarsales", "bazaarprofit", "jailed", "peoplebusted", "failedbusts", "peoplebought", "peopleboughtspent", "hospital", "medicalitemsused", "bloodwithdrawn", "reviveskill", "revives", "revivesreceived", "heavyhits", "machinehits", "riflehits", "smghits", "shotgunhits", "pistolhits", "temphits", "piercinghits", "slashinghits", "clubbinghits", "mechanicalhits", "h2hhits", "mailssent", "friendmailssent", "factionmailssent", "companymailssent", "spousemailssent", "classifiedadsplaced", "personalsplaced", "criminaloffensesold", "sellillegalgoods", "theftold", "autotheftcrime", "drugdealscrime", "computercrime", "fraudold", "murdercrime", "othercrime", "organizedcrimes", "bountiesplaced", "totalbountyspent", "bountiescollected", "totalbountyreward", "bountiesreceived", "receivedbountyvalue", "cityfinds", "dumpfinds", "itemsdumped", "booksread", "boostersused", "consumablesused", "candyused", "alcoholused", "energydrinkused", "statenhancersused", "eastereggsfound", "eastereggsused", "virusescoded", "traveltimes", "timespenttraveling", "itemsboughtabroad", "attackswonabroad", "defendslostabroad", "argtravel", "mextravel", "uaetravel", "hawtravel", "japtravel", "uktravel", "satravel", "switravel", "chitravel", "cantravel", "caytravel", "drugsused", "overdosed", "rehabs", "rehabcost", "cantaken", "exttaken", "kettaken", "lsdtaken", "opitaken", "pcptaken", "shrtaken", "spetaken", "victaken", "xantaken", "missionscompleted", "contractscompleted", "dukecontractscompleted", "missioncreditsearned", "racingskill", "racingpointsearned", "racesentered", "raceswon", "networth", "timeplayed", "activestreak", "bestactivestreak", "awards", "refills", "nerverefills", "tokenrefills", "meritsbought", "daysbeendonator", "criminaloffenses", "vandalism", "theft", "counterfeiting", "fraud", "illicitservices", "cybercrime", "extortion", "illegalproduction", "currentkillstreak", "strength", "defense", "speed", "dexterity", "totalstats", "manuallabor", "intelligence", "endurance", "totalworkingstats", "moneyinvested", "investedprofit", "investamount", "banktimeleft", "stockprofits", "stocklosses", "stockfees", "stocknetprofits", "stockpayouts", "networthwallet", "networthvault", "networthbank", "networthcayman", "networthpoints", "networthitems", "networthdisplaycase", "networthbazaar", "networthitemmarket", "networthproperties", "networthstockmarket", "networthauctionhouse", "networthbookie", "networthcompany", "networthenlistedcars", "networthpiggybank", "networthpending", "networthloan", "networthunpaidfees", "huntingskill", "searchforcashskill", "bootleggingskill", "graffitiskill", "shopliftingskill", "pickpocketingskill", "cardskimmingskill", "burglaryskill", "hustlingskill", "disposalskill", "crackingskill", "forgeryskill", "scammingskill", "arsonskill"]
37
38
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TornAPIWrapper
3
- Version: 2.3.1
3
+ Version: 2.4.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-10.03.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-15.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,9 +1,9 @@
1
- TornAPIWrapper/__init__.py,sha256=wBL7VuC--OJa-iQeJE5vunBNJ3fOthK-ywyfpaqkftc,2763
1
+ TornAPIWrapper/__init__.py,sha256=VEig4DSZAnbrvrc62r7QFH9tHhsVRrc4OiSV-67cYB4,2763
2
2
  TornAPIWrapper/__main__.py,sha256=JKsDOr6esnYwiUO5HypNL_0ieiEc5YCItsLwdMfxyLs,1806
3
3
  TornAPIWrapper/client.py,sha256=W8S0lSwx5sz-rZWhUjBwJqMov_zFplDbJVZPsNis8os,3114
4
4
  TornAPIWrapper/client_async.py,sha256=vqL4-ZOEGdSLlqsluA_UI17TE86qlpYbCQ7MkXEahc0,3885
5
5
  TornAPIWrapper/errors.py,sha256=lq0c7tA7M7-7r7rE7Mt1Edp9lOc4iEGY1BLazYrBEz4,9328
6
- TornAPIWrapper/type_hints.py,sha256=BNwTzPwEb5HQrQjA2C08IZ-0tehpUz9kVxa6XfQlJW0,8659
6
+ TornAPIWrapper/type_hints.py,sha256=B5xgRDSptf7jfUAhJ4qvaZMlSoXjwLfMFuqJbWsQvFM,8971
7
7
  TornAPIWrapper/endpoints/__init__.py,sha256=UoVUdkQ9O_wgG2QJvIsOMFtYR0n2-XjUCFUccBSbD7A,1126
8
8
  TornAPIWrapper/endpoints/faction.py,sha256=sdqaBvckixkCL1zfKqC0B8B0rwKRB7sc8CI6EzQ9qe0,30608
9
9
  TornAPIWrapper/endpoints/forum.py,sha256=F9ocJ9RAiC67Cvdmgj08GGiqPmITT3-_lZL6Lox8zGY,5701
@@ -12,7 +12,7 @@ TornAPIWrapper/endpoints/market.py,sha256=Iv7kQ3tCtayjXG-NQu2uTAW04dbS37zMgJx1KD
12
12
  TornAPIWrapper/endpoints/property.py,sha256=y7tQ3FuzRy7oNDBvSUei45qY9-o6sbK4yik78gnXoI0,2828
13
13
  TornAPIWrapper/endpoints/racing.py,sha256=xjoGHTNmnqbqyhZeetBXRVcFdKYUAM_m6paomPloHj8,6097
14
14
  TornAPIWrapper/endpoints/torn.py,sha256=utJ4vz3hLXaqNdEq-ycs78nsqwYvyGh3oEJqlZEzz6E,16558
15
- TornAPIWrapper/endpoints/user.py,sha256=aiM4dPC-EN2PEM2l1QHb0q0XXvkTftrqkSz6yIvTscQ,44569
15
+ TornAPIWrapper/endpoints/user.py,sha256=d3K-gANjULiEFS5h3QXgPwbPcslSZ2P-SWUY7UYFlKI,45354
16
16
  TornAPIWrapper/endpoints_async/__init__.py,sha256=1x2hi50HSEPTeUVrUD1NQTkhpLjyVGg8kDo4LcXFcP8,1132
17
17
  TornAPIWrapper/endpoints_async/faction.py,sha256=823cLOK4Y9sqWfP_ARJacJrd4eJbTZlGhjLDw8Uh0C8,31032
18
18
  TornAPIWrapper/endpoints_async/forum.py,sha256=rIxZYuViGnUYSerak0whRHdbZlLfCbVJMg3roVRLEGU,5789
@@ -21,12 +21,12 @@ TornAPIWrapper/endpoints_async/market.py,sha256=lfLwbTTUxTajdWM45XEBLVm83UX2oZRX
21
21
  TornAPIWrapper/endpoints_async/property.py,sha256=DBCA2BXoCaKww9MGNRVAaEJkZT-N-ZbQUVpRJWmD5Y4,2880
22
22
  TornAPIWrapper/endpoints_async/racing.py,sha256=zfJhLhem2HZQYyP8ngqp8nkOm2O3AQO-kYRPJJBD6w4,6209
23
23
  TornAPIWrapper/endpoints_async/torn.py,sha256=wo1yecshY3wXDbzGpUC7nA_0GCznBQvRT2V0yF3I0F8,16886
24
- TornAPIWrapper/endpoints_async/user.py,sha256=ZvWdUdjYdxRqWzJsXj1cCsNDz9zlTPhUpeRcoZO2S4o,45317
24
+ TornAPIWrapper/endpoints_async/user.py,sha256=FvWYMM_oKd23h3Cp-2rjVU2hu0l4ajsh53qS0-W7Qcg,46114
25
25
  TornAPIWrapper/params/__init__.py,sha256=62xgULpfqEnTYmzSz_6W2MVGtna4DFb6oABy02ZsGcY,1123
26
26
  TornAPIWrapper/params/builders.py,sha256=WQIHSmMgJedNpwps8p4QjXvMLG-s09QBsT1Qynaxx1s,2057
27
- TornAPIWrapper/params/map.py,sha256=vy-8U3QFOSCYbZslBZkY01frYAtUOUaXpXIs9naQTWM,1338
28
- tornapiwrapper-2.3.1.dist-info/licenses/LICENSE,sha256=tFxfnm48fk5x0JCMs1t7Ao6XDt_bHn_ogl3Y_q2EuPc,1079
29
- tornapiwrapper-2.3.1.dist-info/METADATA,sha256=ltnwNkkgH3VCkdVYYN73jrwsNT6HDgDnsGl6AFJ4Huc,5069
30
- tornapiwrapper-2.3.1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
31
- tornapiwrapper-2.3.1.dist-info/top_level.txt,sha256=z3QKLWbCxzb7qZb9LV37myVFXQm3hgA57PGuSWkc4R4,15
32
- tornapiwrapper-2.3.1.dist-info/RECORD,,
27
+ TornAPIWrapper/params/map.py,sha256=VIc9tKoxPWETwJA2-t4NUlIVg7QmqBXcda9QGccuxrs,1364
28
+ tornapiwrapper-2.4.0.dist-info/licenses/LICENSE,sha256=tFxfnm48fk5x0JCMs1t7Ao6XDt_bHn_ogl3Y_q2EuPc,1079
29
+ tornapiwrapper-2.4.0.dist-info/METADATA,sha256=MktAQ49NsKwnkISlHJMyo5l24WHQ_SV83ltWOef3nPg,5069
30
+ tornapiwrapper-2.4.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
31
+ tornapiwrapper-2.4.0.dist-info/top_level.txt,sha256=z3QKLWbCxzb7qZb9LV37myVFXQm3hgA57PGuSWkc4R4,15
32
+ tornapiwrapper-2.4.0.dist-info/RECORD,,