neptune-sdk 0.0.1.dev798__tar.gz → 0.0.1.dev838__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: neptune-sdk
3
- Version: 0.0.1.dev798
3
+ Version: 0.0.1.dev838
4
4
  Summary: Python SDK for Neptune BitTorrent client JSON-RPC API
5
5
  License-Expression: MIT
6
6
  Requires-Python: >=3.10
@@ -14,7 +14,7 @@ dependencies = [
14
14
  "httpx>=0.27",
15
15
  "pydantic>=2",
16
16
  ]
17
- version = "0.0.1.dev798"
17
+ version = "0.0.1.dev838"
18
18
 
19
19
  [dependency-groups]
20
20
  dev = [
@@ -25,8 +25,8 @@ from .models import (
25
25
  TorrentInfo,
26
26
  TorrentListResponse,
27
27
  TorrentPeersResponse,
28
- TorrentTrackersResponse,
29
28
  TorrentState,
29
+ TorrentTrackersResponse,
30
30
  Tracker,
31
31
  TransferSummary,
32
32
  UpdateCustomRequest,
@@ -65,8 +65,7 @@ __all__ = [
65
65
  "TorrentListResponse",
66
66
  "TorrentPeersResponse",
67
67
  "TorrentTrackersResponse",
68
+ "TorrentState",
68
69
  "Tracker",
69
70
  "TransferSummary",
70
- # state constants
71
- "TorrentState",
72
71
  ]
@@ -21,6 +21,7 @@ from .models import (
21
21
  GetDownloadSlotsResponse,
22
22
  GetRecheckOnCompleteResponse,
23
23
  GetSlowDownloadSpeedThresholdResponse,
24
+ GetTorrentConnectionLimitResponse,
24
25
  InfoHashRequest,
25
26
  ListTorrentRequest,
26
27
  MoveTorrentRequest,
@@ -35,6 +36,7 @@ from .models import (
35
36
  SetRecheckOnCompleteRequest,
36
37
  SetSlowDownloadSpeedThresholdRequest,
37
38
  SetSpeedLimitRequest,
39
+ SetTorrentConnectionLimitRequest,
38
40
  TagsRequest,
39
41
  TorrentFilesResponse,
40
42
  TorrentInfo,
@@ -120,6 +122,8 @@ class NeptuneClient:
120
122
  }
121
123
  if params is not None:
122
124
  payload["params"] = asdict(params)
125
+ else:
126
+ payload["params"] = {}
123
127
 
124
128
  body_bytes = json.dumps(payload, default=_json_default).encode()
125
129
 
@@ -369,6 +373,20 @@ class NeptuneClient:
369
373
  self._call("client.get_recheck_on_complete"),
370
374
  )
371
375
 
376
+ def client_set_torrent_connection_limit(self, limit: int) -> None:
377
+ """Set max connections per torrent."""
378
+ self._call(
379
+ "client.set_torrent_connection_limit",
380
+ SetTorrentConnectionLimitRequest(limit=limit),
381
+ )
382
+
383
+ def client_get_torrent_connection_limit(self) -> GetTorrentConnectionLimitResponse:
384
+ """Get max connections per torrent."""
385
+ return _validate(
386
+ GetTorrentConnectionLimitResponse,
387
+ self._call("client.get_torrent_connection_limit"),
388
+ )
389
+
372
390
  # ── torrent — file priority ────────────────────────────────────────
373
391
 
374
392
  def torrent_set_file_priority(
@@ -58,6 +58,7 @@ class TransferSummary:
58
58
  download_total: int
59
59
  upload_rate: int
60
60
  upload_total: int
61
+ connection_count: int = 0
61
62
 
62
63
 
63
64
  @dataclass(frozen=True, slots=True, kw_only=True)
@@ -323,3 +324,17 @@ class TorrentTrackersResponse:
323
324
  """Response for torrent.trackers."""
324
325
 
325
326
  trackers: list[Tracker]
327
+
328
+
329
+ @dataclass(frozen=True, slots=True, kw_only=True)
330
+ class SetTorrentConnectionLimitRequest:
331
+ """Parameters for client.set_torrent_connection_limit."""
332
+
333
+ limit: int = 0
334
+
335
+
336
+ @dataclass(frozen=True, slots=True, kw_only=True)
337
+ class GetTorrentConnectionLimitResponse:
338
+ """Response for client.get_torrent_connection_limit."""
339
+
340
+ limit: int = 0
@@ -16,7 +16,7 @@ from neptune_sdk import (
16
16
  TorrentState,
17
17
  )
18
18
 
19
- BASE = "http://127.0.0.1:8002"
19
+ BASE = "http://127.0.0.1:8002/json_rpc"
20
20
  TOKEN = "test-token"
21
21
 
22
22
  # ── helpers ───────────────────────────────────────────────────────────