hippius 0.2.52__py3-none-any.whl → 0.2.53__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.52
3
+ Version: 0.2.53
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,4 +1,4 @@
1
- hippius_sdk/__init__.py,sha256=gdgM236scbP5uU_jU9yw4QOkq29L4toaMXaZ_S5jhpk,1474
1
+ hippius_sdk/__init__.py,sha256=oO-2itSSL6zSBvfbDXJ2kIX1nI_0bMldoJJFFVD6P6c,1474
2
2
  hippius_sdk/cli.py,sha256=3TocM--b4stdOYS8_ixZMzThZvJZVmmWqEqz_PHvWxo,22188
3
3
  hippius_sdk/cli_assets.py,sha256=rjH3Z5A1CQr2d5CIAAAb0WMCjoZZlMWcdo0f93KqluE,635
4
4
  hippius_sdk/cli_handlers.py,sha256=zwLpOMW_sorPZRP8LWxhR9ITZSdOzUxucDy7wXrcMJw,157852
@@ -14,12 +14,12 @@ hippius_sdk/db/setup_database.sh,sha256=STp03qxkp2RmIVr6YZIcvQQm-_LLUOb6Jobh-52H
14
14
  hippius_sdk/db_utils.py,sha256=-x0rbN0as7Tn3PJPZBYCgreZe52FLH40ppA1TLxsg90,1851
15
15
  hippius_sdk/errors.py,sha256=LScJJmawVAx7aRzqqQguYSkf9iazSjEQEBNlD_GXZ6Y,1589
16
16
  hippius_sdk/incentives.py,sha256=0_xpaxNBmbK-0mvTm87vwBaZF-daM7hxm0dKYgkuXh4,16908
17
- hippius_sdk/ipfs.py,sha256=GmxG1K3vy2Ed3zzGXgqhHFu4Ulupcb_8tb0xI-Z6VAw,104640
17
+ hippius_sdk/ipfs.py,sha256=rCAuSEiO1B2FCs3WQpNb2rpSJfRJkt6PWUD7KsmF6B8,105376
18
18
  hippius_sdk/ipfs_core.py,sha256=xsY0Ox6anmrkbrxkRr2RXzEukB-EEaW_oMvO0Va3vjQ,13148
19
19
  hippius_sdk/key_storage.py,sha256=HWV9mM5Zkq_xxn7A72L7gvlYBtcmMwOyeFdtl8ExlmE,8315
20
20
  hippius_sdk/substrate.py,sha256=4a7UIE4UqGcDW7luKTBgSDqfb2OIZusB39G1UiRs_YU,50158
21
21
  hippius_sdk/utils.py,sha256=rJ611yvwKSyiBpYU3w-SuyQxoghMGU-ePuslrPv5H5g,7388
22
- hippius-0.2.52.dist-info/METADATA,sha256=O8kVmOP1oGOjDowFPZGfAHs3TGVAgc5CqcDXI3_wAaQ,30088
23
- hippius-0.2.52.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
24
- hippius-0.2.52.dist-info/entry_points.txt,sha256=bFAZjW3vndretf9-8s587jA2ebMVI7puhn_lVs8jPc8,149
25
- hippius-0.2.52.dist-info/RECORD,,
22
+ hippius-0.2.53.dist-info/METADATA,sha256=TWhWHeH2ok1GkBtYeGatgYBMlDrCMw5mpMWJwKTfJA4,30088
23
+ hippius-0.2.53.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
24
+ hippius-0.2.53.dist-info/entry_points.txt,sha256=bFAZjW3vndretf9-8s587jA2ebMVI7puhn_lVs8jPc8,149
25
+ hippius-0.2.53.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.52"
29
+ __version__ = "0.2.53"
30
30
  __all__ = [
31
31
  "HippiusClient",
32
32
  "IPFSClient",
hippius_sdk/ipfs.py CHANGED
@@ -2117,15 +2117,26 @@ class IPFSClient:
2117
2117
 
2118
2118
  logger.info(f"Got {len(objects)=} from {store_node=}")
2119
2119
  # filter out just the one file cid, ignore dirs, it's usually the first item,
2120
- # but hey let's not risk it
2120
+ # but hey let's not risk it. IPFS may convert + to spaces in filenames.
2121
2121
  for o in objects:
2122
2122
  if o["Name"] == file_name:
2123
2123
  cid = o["Hash"]
2124
2124
  break
2125
2125
  else:
2126
- raise KeyError(
2127
- f"Store call failed, {file_name=} not found in {objects=}"
2128
- )
2126
+ # If exact match fails, try to find by matching the basename only
2127
+ # This handles cases where IPFS modifies the filename (e.g., + to space)
2128
+ target_basename = os.path.basename(file_name)
2129
+ for o in objects:
2130
+ if os.path.basename(o["Name"]) == target_basename:
2131
+ cid = o["Hash"]
2132
+ logger.info(
2133
+ f"Found file by basename match: {o['Name']} (original: {file_name})"
2134
+ )
2135
+ break
2136
+ else:
2137
+ raise KeyError(
2138
+ f"Store call failed, {file_name=} not found in {objects=}"
2139
+ )
2129
2140
  else:
2130
2141
  cid = result["Hash"]
2131
2142
  logger.info(f"Content uploaded to store node {store_node} with CID: {cid}")
@@ -2526,7 +2537,9 @@ class IPFSClient:
2526
2537
  async with httpx.AsyncClient() as client:
2527
2538
  async with client.stream("GET", download_url) as response:
2528
2539
  response.raise_for_status()
2529
- logger.info(f"Started streaming from {download_node} for CID: {cid}")
2540
+ logger.info(
2541
+ f"Started streaming from {download_node} for CID: {cid}"
2542
+ )
2530
2543
 
2531
2544
  async for chunk in response.aiter_bytes(chunk_size=8192):
2532
2545
  yield chunk