hippius 0.2.19__py3-none-any.whl → 0.2.20__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hippius
3
- Version: 0.2.19
3
+ Version: 0.2.20
4
4
  Summary: Python SDK and CLI for Hippius blockchain storage
5
5
  Home-page: https://github.com/thenervelab/hippius-sdk
6
6
  Author: Dubs
@@ -1,10 +1,10 @@
1
- hippius_sdk/__init__.py,sha256=j0kPfN608bcRYKQzkq-8192AzFoHWkIxvMULfGYyNxs,1474
1
+ hippius_sdk/__init__.py,sha256=9rPlh9Ob5xHhR9owW4IxihHaanA0vxuMrDidpW5l0Fw,1474
2
2
  hippius_sdk/cli.py,sha256=aqKOYSBSWt7UhcpFt7wf9yIPJ3bznpsJ6ehOnuZ4usI,18235
3
3
  hippius_sdk/cli_assets.py,sha256=V3MX63QTiex6mCp0VDXQJ7cagm5v1s4xtsu8c1O4G_k,371
4
4
  hippius_sdk/cli_handlers.py,sha256=TQNE9os87gRzRKLEO-SIwhFnBtEFMiaSESv-Bu7omfo,128909
5
5
  hippius_sdk/cli_parser.py,sha256=z7UvgWvvy04ey-R56qZiCqYc_9RaNq1rVDkQyXoK3JU,21100
6
6
  hippius_sdk/cli_rich.py,sha256=_jTBYMdHi2--fIVwoeNi-EtkdOb6Zy_O2TUiGvU3O7s,7324
7
- hippius_sdk/client.py,sha256=W1aVyvgMXRXVqjwSmRl03kZKB96PHMPcpq3cj1equ-8,20179
7
+ hippius_sdk/client.py,sha256=k8K3__zDtWJhCbHPAPYu9FopSNXsrw1HpVAX6fV7pnI,21462
8
8
  hippius_sdk/config.py,sha256=Hf_aUYzG9ylzqauA_ABUSSB5mBTYbp-VtB36VQt2XDw,21981
9
9
  hippius_sdk/db/README.md,sha256=okDeI1qgkaZqXSlJ8L0xIE4UpuxO-qEGPIbXUvSHQjU,2030
10
10
  hippius_sdk/db/env.db.template,sha256=_6hEC3IvkzCDOAzG1_yJUKRUfCTMciNaJUicZpMCat4,217
@@ -17,7 +17,7 @@ hippius_sdk/ipfs_core.py,sha256=eOOgLoyP9mvwndnCjldnTc7z94ImYCXY3nm7JU3e_Mo,1267
17
17
  hippius_sdk/key_storage.py,sha256=-f4pEUvkczY_yw3lYJ_kM2iDDOAtKOgrexWxVgIo78w,9486
18
18
  hippius_sdk/substrate.py,sha256=AqfQNl5Qv_s6roOESSdwleX0-VGyu5sh3m5-dYZp5ek,49079
19
19
  hippius_sdk/utils.py,sha256=rJ611yvwKSyiBpYU3w-SuyQxoghMGU-ePuslrPv5H5g,7388
20
- hippius-0.2.19.dist-info/METADATA,sha256=fzIdrxmqDpYRA_Y8QBCUA4PtlfpYHby30WeHUFkq758,30088
21
- hippius-0.2.19.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
22
- hippius-0.2.19.dist-info/entry_points.txt,sha256=bFAZjW3vndretf9-8s587jA2ebMVI7puhn_lVs8jPc8,149
23
- hippius-0.2.19.dist-info/RECORD,,
20
+ hippius-0.2.20.dist-info/METADATA,sha256=-mfl3cVtxZhaYbQvq-yt2aR96T1szZxnCb_R3Xbhx5I,30088
21
+ hippius-0.2.20.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
22
+ hippius-0.2.20.dist-info/entry_points.txt,sha256=bFAZjW3vndretf9-8s587jA2ebMVI7puhn_lVs8jPc8,149
23
+ hippius-0.2.20.dist-info/RECORD,,
hippius_sdk/__init__.py CHANGED
@@ -26,7 +26,7 @@ from hippius_sdk.config import (
26
26
  from hippius_sdk.ipfs import IPFSClient, S3PublishResult, S3DownloadResult
27
27
  from hippius_sdk.utils import format_cid, format_size, hex_to_ipfs_cid
28
28
 
29
- __version__ = "0.2.19"
29
+ __version__ = "0.2.20"
30
30
  __all__ = [
31
31
  "HippiusClient",
32
32
  "IPFSClient",
hippius_sdk/client.py CHANGED
@@ -9,7 +9,7 @@ import nacl.secret
9
9
  import nacl.utils
10
10
 
11
11
  from hippius_sdk.config import get_config_value, get_encryption_key
12
- from hippius_sdk.ipfs import IPFSClient, S3PublishResult
12
+ from hippius_sdk.ipfs import IPFSClient, S3PublishResult, S3DownloadResult
13
13
  from hippius_sdk.substrate import SubstrateClient
14
14
 
15
15
 
@@ -532,3 +532,31 @@ class HippiusClient:
532
532
  ValueError: If encryption is requested but not available
533
533
  """
534
534
  return await self.ipfs_client.s3_publish(file_path, encrypt, seed_phrase)
535
+
536
+ async def s3_download(
537
+ self, cid: str, output_path: str, seed_phrase: str, auto_decrypt: bool = True
538
+ ) -> S3DownloadResult:
539
+ """
540
+ Download a file from IPFS with automatic decryption.
541
+
542
+ This method automatically manages decryption keys per seed phrase:
543
+ - Downloads the file from IPFS
544
+ - If auto_decrypt=True, attempts to decrypt using stored keys for the seed phrase
545
+ - Falls back to client encryption key if key storage is not available
546
+ - Returns the file in decrypted form if decryption succeeds
547
+
548
+ Args:
549
+ cid: Content Identifier (CID) of the file to download
550
+ output_path: Path where the downloaded file will be saved
551
+ seed_phrase: Seed phrase to use for retrieving decryption keys
552
+ auto_decrypt: Whether to attempt automatic decryption (default: True)
553
+
554
+ Returns:
555
+ S3DownloadResult: Object containing download info and decryption status
556
+
557
+ Raises:
558
+ HippiusIPFSError: If IPFS download fails
559
+ FileNotFoundError: If the output directory doesn't exist
560
+ ValueError: If decryption fails
561
+ """
562
+ return await self.ipfs_client.s3_download(cid, output_path, seed_phrase, auto_decrypt)