hippius 0.2.19__tar.gz → 0.2.20__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 (22) hide show
  1. {hippius-0.2.19 → hippius-0.2.20}/PKG-INFO +1 -1
  2. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/__init__.py +1 -1
  3. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/client.py +29 -1
  4. {hippius-0.2.19 → hippius-0.2.20}/pyproject.toml +1 -1
  5. {hippius-0.2.19 → hippius-0.2.20}/README.md +0 -0
  6. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/cli.py +0 -0
  7. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/cli_assets.py +0 -0
  8. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/cli_handlers.py +0 -0
  9. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/cli_parser.py +0 -0
  10. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/cli_rich.py +0 -0
  11. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/config.py +0 -0
  12. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/db/README.md +0 -0
  13. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/db/env.db.template +0 -0
  14. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/db/migrations/20241201000001_create_key_storage_tables.sql +0 -0
  15. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/db/setup_database.sh +0 -0
  16. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/db_utils.py +0 -0
  17. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/errors.py +0 -0
  18. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/ipfs.py +0 -0
  19. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/ipfs_core.py +0 -0
  20. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/key_storage.py +0 -0
  21. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/substrate.py +0 -0
  22. {hippius-0.2.19 → hippius-0.2.20}/hippius_sdk/utils.py +0 -0
@@ -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
@@ -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",
@@ -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)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "hippius"
3
- version = "0.2.19"
3
+ version = "0.2.20"
4
4
  description = "Python SDK and CLI for Hippius blockchain storage"
5
5
  authors = ["Dubs <dubs@dubs.rs>"]
6
6
  readme = "README.md"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes