# Ic-py Development and Ongoing Maintenance

**URL:** <https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455>\
**Category:** Developers\
**Tags:** Discussing, agent\
**Created:** [May 8, 2025, 8:54am UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455 "2025-05-08T08:54:35Z")\
**Posts on this page:** 20\
**Page:** 4

<div class="post-metadata">

**Author:** ![icpp](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icpp/32/9310_2.png) [@icpp](https://forum.dfinity.org/u/icpp)\
**Post date:** [January 5, 2026, 11:15am UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/61 "2026-01-05T11:15:40Z")

</div>

@C-B-Elite ,  
Would you be able to push out a v2.2.0 with the already merged updates?

I have many projects that still use ic-py, and I would be able to upgrade them after that.

---

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [January 6, 2026, 6:58am UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/62 "2026-01-06T06:58:30Z")

</div>

Hi, I just got back from vacation.

I’m back to work now, and I’m planning to release a new version this week (likely Friday–Saturday), which will include your PR.

By the way, over the next month, I’m also expecting a larger upgrade. The main focus will be updating the current endpoints (v2 is already outdated), which may introduce some underlying code changes. It will also include a few security-related features that were not previously supported.

Thanks for your attention and support!

---

<div class="post-metadata">

**Author:** ![q2333gh](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/q2333gh/32/36020_2.png) [@q2333gh](https://forum.dfinity.org/u/q2333gh)\
**Post date:** [January 7, 2026, 4:54am UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/63 "2026-01-07T04:54:06Z")

</div>

Does canister http-outcall in pocket-ic support?

---

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [January 9, 2026, 5:23am UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/64 "2026-01-09T05:23:13Z")

</div>

At the moment, icp-py-core doesn’t have support for pocket-ic (and there’s no short-term plan to implement it). As far as I remember, pocket-ic is able to simulate \canister HTTP outcalls.

---

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [January 11, 2026, 9:36am UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/65 "2026-01-11T09:36:04Z")

</div>

# 🐍 icp-py-core v2.1.1 Released - Fixed Candid DID Parser Issue

We’re excited to announce the release of **icp-py-core v2.1.1** , which fixes an important bug in the Candid DID parser that affected Motoko-generated DID files.

## 🐛 What Was Fixed

The Candid DID parser now correctly handles service definitions that use type references, a pattern commonly generated by Motoko canisters.

**Previously broken pattern (now fixed):**

```candid

type MyService = service {

hello: () -> (text);

};

service : () -> MyService

```

This pattern is valid Candid syntax and is frequently used in Motoko-generated DID files, but the parser was failing to parse it correctly.

## ✨ Improvements

- ✅ Support for `service : () -> TypeName` pattern

- ✅ Support for nested type references

- ✅ Support for type references with initialization arguments

- ✅ Comprehensive test coverage added

## 📦 Installation

```bash

pip install --upgrade icp-py-core

```

## 🔗 Links

- **GitHub Repository:** [GitHub - eliezhao/icp-py-core: Python Agent Library for the DFINITY Internet Computer](https://github.com/eliezhao/icp-py-core)

- **PyPI Package:** [Client Challenge](https://pypi.org/project/icp-py-core/)

- **Issue Fixed:** [The Canister DIDLoader does not parse service definitions that reference a type name · Issue #7 · eliezhao/icp-py-core · GitHub](https://github.com/eliezhao/icp-py-core/issues/7)

- **Full Changelog:** [icp-py-core/CHANGELOG.md at master · eliezhao/icp-py-core · GitHub](https://github.com/eliezhao/icp-py-core/blob/master/CHANGELOG.md)

## 🙏 Acknowledgments

Thanks to [@icppWorld](https://github.com/icppWorld) for reporting this issue and providing detailed analysis.

---

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [January 21, 2026, 4:06pm UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/66 "2026-01-21T16:06:40Z")

</div>

# 🎉 ICP-PY-CORE v2.2.1 Released!

I’m excited to announce the release of **ICP-PY-CORE v2.2.1** , a significant update that brings structured error handling, HTTP/2 support, and enhanced certificate verification capabilities to the Python SDK for the Internet Computer.

## 📦 Installation

```bash
pip install icp-py-core==2.2.1

```

**PyPI** : [icp-py-core · PyPI](https://pypi.org/project/icp-py-core/)  
**GitHub** : [GitHub - eliezhao/icp-py-core: Python Agent Library for the DFINITY Internet Computer](https://github.com/eliezhao/icp-py-core)

* * *

## ✨ What’s New

### 🎯 Structured Error Handling Hierarchy

v2.2.1 introduces a comprehensive error handling system with 11 specialized error classes, making it easier to handle different types of failures:

```python
from icp_core import (
    TransportError, # HTTP/network errors
    ReplicaReject, # Canister rejections
    SecurityError, # Base for security errors
    SignatureVerificationFailed,
    CertificateVerificationError,
    # ... and more
)

try:
    result = agent.update("canister-id", "method", args)
except ReplicaReject as e:
    print(f"Rejected: {e.reject_code} - {e.reject_message}")
except TransportError as e:
    print(f"Network error: {e.url}")
except SecurityError as e:
    print(f"Security issue: {e}")

```

**Benefits:**

- Better error categorization and handling
- Improved debugging with error chaining
- Sanitized error messages for production use
- Full documentation with examples in README

### ⚡ HTTP/2 Support

HTTP/2 is now enabled by default in all async methods, providing:

- **Multiplexing** : Multiple requests over a single connection
- **Header compression** : Reduced bandwidth usage
- **Automatic fallback** : Gracefully falls back to HTTP/1.1 if not supported
- **Better performance** : Reduced latency for concurrent requests

No code changes required - it’s automatically enabled!

### 🌐 Latest Boundary Node Endpoints

v2.2.1 now uses the latest Boundary Node API endpoints for optimal performance and compatibility:

- **Read State Operations** : Updated to use v3 endpoints (`/api/v3/canister/.../read_state` and `/api/v3/subnet/.../read_state`)
- **Call Operations** : Full support for v4 call endpoint (`/api/v4/canister/.../call`) with proper delegation verification
- **Delegation Verification** : Enhanced delegation verification logic that works seamlessly with v4 API endpoints
- **Backward Compatibility** : All endpoint updates maintain full backward compatibility with existing code

These updates ensure you’re using the most current and efficient endpoints available on the Internet Computer.

### 🔐 V4 API Sharded Canister Ranges Support

Added support for the v4 API’s sharded `canister_ranges` structure:

- Updated certificate verification to handle sharded paths: `[canister_ranges, subnet_id, shard_label]`
- Improved `lookup_tree` and `list_paths` methods for shard navigation
- Updated test certificates to use v4 API format

### 🔒 Enhanced Certificate Verification

- Improved certificate delegation path handling
- Better error messages for verification failures
- Enhanced subnet-level `read_state` operations
- Node key caching for performance optimization
- Proper delegation verification for v4 call endpoints

* * *

## 🛠 Improvements & Fixes

### Error Handling

- All `Client` methods now raise `TransportError` for network issues
- All `Agent` methods raise structured errors (`ReplicaReject`, `SecurityError`, etc.)
- Better error chaining with ` __cause__ ` attribute preservation
- Improved error messages with sanitized stack traces

### API Updates

- **Read State** : Now uses latest v3 endpoints (`/api/v3/canister/.../read_state` and `/api/v3/subnet/.../read_state`)
- **Call Operations** : Full support for v4 call endpoint (`/api/v4/canister/.../call`)
- **Delegation Verification** : Restored and enhanced `check_delegation` logic for proper delegation verification with v4 endpoints
- Maintained full backward compatibility with existing code

### Code Quality

- Fixed circular import issues using lazy loading pattern
- Enhanced type annotations throughout codebase
- Better code organization and maintainability

* * *

## 📋 Migration Guide

### Error Handling

If you’re currently catching generic `Exception`, consider catching specific error types:

```python
# Before
try:
    result = agent.update("canister-id", "method", args)
except Exception as e:
    # Generic handling
    pass

# After (recommended)
try:
    result = agent.update("canister-id", "method", args)
except ReplicaReject as e:
    # Handle canister rejections
    handle_rejection(e)
except TransportError as e:
    # Handle network issues
    handle_network_error(e)
except SecurityError as e:
    # Handle security issues
    handle_security_error(e)

```

### Imports

Error classes are now available from `icp_core`:

```python
from icp_core import TransportError, ReplicaReject, SecurityError

```

### HTTP/2

No code changes required - HTTP/2 is automatically enabled for async methods.

### Endpoint Updates

The endpoint updates are transparent - no code changes required. The library automatically uses:

- v3 endpoints for read state operations
- v4 endpoints for call operations with proper delegation verification

* * *

## 🔗 Resources

- **Documentation** : [GitHub - eliezhao/icp-py-core: Python Agent Library for the DFINITY Internet Computer](https://github.com/eliezhao/icp-py-core#readme)
- **Changelog** : [icp-py-core/CHANGELOG.md at master · eliezhao/icp-py-core · GitHub](https://github.com/eliezhao/icp-py-core/blob/master/CHANGELOG.md)
- **Migration Guide** : [icp-py-core/MIGRATION.md at master · eliezhao/icp-py-core · GitHub](https://github.com/eliezhao/icp-py-core/blob/master/MIGRATION.md)
- **Issues & Feedback** : [GitHub · Where software is built](https://github.com/eliezhao/icp-py-core/issues)

* * *

**Happy coding with ICP-PY-CORE! 🐍**

---

<div class="post-metadata">

**Author:** ![icpp](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icpp/32/9310_2.png) [@icpp](https://forum.dfinity.org/u/icpp)\
**Post date:** [January 22, 2026, 12:08pm UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/67 "2026-01-22T12:08:48Z")

</div>

> [@C-B-Elite](#):
>
> ✅ Support for `service : () -> TypeName` pattern

The Rust extension ic-candid-parser is still at v0.1.0 on PyPI, which predates the fix for the pattern.

Would you be able to push out a new release for that ic-candid-parser package as well?

I issued a bug report too at [Bug: VarT service reference fix not published to PyPI · Issue #10 · eliezhao/icp-py-core · GitHub](https://github.com/eliezhao/icp-py-core/issues/10)

Thank you!

---

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [January 22, 2026, 12:40pm UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/68 "2026-01-22T12:40:10Z")

</div>

I’ll check it and update it soon.

---

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [January 22, 2026, 1:21pm UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/69 "2026-01-22T13:21:51Z")

</div>

I’ve released version **v2.2.1** , which fixes this issue. Thank you for the feedback — my local environment was affected by the development setup, so I didn’t notice this problem earlier.  
@icpp

---

<div class="post-metadata">

**Author:** ![icpp](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icpp/32/9310_2.png) [@icpp](https://forum.dfinity.org/u/icpp)\
**Post date:** [January 22, 2026, 3:45pm UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/70 "2026-01-22T15:45:01Z")

</div>

> [@C-B-Elite](#):
>
> version **v2.2.1** , which fixes this issue

Everything now works. Thanks for the quick action.

---

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [January 29, 2026, 9:44am UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/71 "2026-01-29T09:44:50Z")

</div>

# Upcoming Release

I am pleased to preview the next release of icp-py-core. This update adds configurable timeouts, optional replica-signed query verification, automatic Candid (`.did`) fetching from canisters, and async-friendly Canister methods.

**Release timeline:** I expect this update to be released in **1–2 weeks**. During this period I will collect feedback and issues for version **2.2.1** ; any fixes will be included in the next release.

Development of the above features is complete. Further testing is in progress on the **`feature/verify-replica-query-signature-and-canister-timeout`** branch.

* * *

## New Features

### 1. Query and canister call timeouts

- **Query timeout**

- **Update (canister call) timeout**

All timeouts are configurable; when not set, the defaults above apply.

* * *

### 2. Verify query response signatures (opt-in)

- **Replica-signed query verification**  
When the boundary node returns **replica-signed** query responses (with signatures), you can optionally verify them before trusting the result.

- **How to use**

- **What is verified**

* * *

### 3. Automatically fetch the .did file from the canister

- **Auto-fetch Candid (DID)**  
You no longer need to manually provide a `.did` file for every canister.  
The **`Canister`** class can fetch the Candid interface from the Internet Computer when you don’t pass a local definition.

- **How it works**

- **Backward compatibility**

* * *

### 4. Canister async method support

- **Async variants for every canister method**  
For each method defined in the canister’s Candid interface, the library now exposes an async variant: **`<method_name>_async`** (e.g. `get_async`, `set_async`).

- **Usage**

- **Example**

* * *

I hope these changes make icp-py-core more robust, secure, and convenient for both sync and async workflows. Feedback and issues are welcome on the repository.

---

<div class="post-metadata">

**Author:** ![icpp](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icpp/32/9310_2.png) [@icpp](https://forum.dfinity.org/u/icpp)\
**Post date:** [February 1, 2026, 1:07pm UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/72 "2026-02-01T13:07:23Z")

</div>

Looking forward to these updates. Especially the auto-pull of did files and the ability to set the timeout are really nice and important 👍

---

<div class="post-metadata">

**Author:** ![icpp](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icpp/32/9310_2.png) [@icpp](https://forum.dfinity.org/u/icpp)\
**Post date:** [February 5, 2026, 2:23am UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/73 "2026-02-05T02:23:41Z")

</div>

> [@C-B-Elite](#):
>
> Development of the above features is complete. Further testing is in progress on the **`feature/verify-replica-query-signature-and-canister-timeout`** branch.

Hi @C-B-Elite ,

I managed to replace yet another dfx subprocess with an icp-py-core call using the canister interface, but it included a long duration call and the resulting timeout exposed a few bugs.

They’re fixed in this PR: [Fix/read state and v4 polling by icppWorld · Pull Request #13 · eliezhao/icp-py-core · GitHub](https://github.com/eliezhao/icp-py-core/pull/13)

Let me know how that looks. With these changes, my long duration call is working great.

---

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [February 5, 2026, 9:56am UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/74 "2026-02-05T09:56:11Z")

</div>

Thank you for your feedback. Since we updated the endpoint, some issues may have surfaced that were outside my expectations.

It looks like the next release will need to be brought forward. I’m planning to publish a new version this weekend that includes a fix for this bug along with the new features.

---

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [February 9, 2026, 5:49am UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/75 "2026-02-09T05:49:39Z")

</div>

# icp-py-core v2.3.0 Released

I have released **icp-py-core v2.3.0** with new features and bug fixes. Upgrade with:

```bash

pip install --upgrade icp-py-core

```

* * *

## New features

**Configurable timeouts**

Query and update calls now have configurable timeouts (defaults: 30s for queries, 60s for update polling). On timeout the library raises `TimeoutWaitingForResponse`.

```python

# Override per call

result = agent.query(canister_id, "method", arg, timeout=10)

result = await agent.query_async(canister_id, "method", arg, timeout=10)

agent.update(canister_id, "method", arg, timeout=90)

```

**Optional query response signature verification**

You can verify replica-signed query responses (opt-in, default off). Uses Ed25519 and subnet node public keys (fetched and cached as needed).

```python

agent = Agent(url, verify_query_signatures=True)

# or per call:

agent.query(canister_id, "method", arg, verify_query_signatures=True)

```

**Auto-fetch Candid from canister**

The `Canister` wrapper can fetch the service’s Candid interface from the IC when you don’t provide it (tries public `candid:service`, then private `candid` metadata).

```python

canister = Canister(agent, canister_id) # no candid_str needed

canister.some_method(args)

```

**Canister async methods**

For each canister method, an async variant is available (e.g. `get_async`, `set_async`) with the same types and encoding as the sync methods.

```python

result = await canister.get_async()

await canister.set_async(value)

```

**Candid composite query support**

Candid support for composite query is included.

**Canister timeout passthrough**

Canister high-level methods now pass the `timeout` argument through to the underlying query/update calls.

* * *

## Bug fix

- **Read state and v4 polling** – Fixed read-state handling and v4 call polling (see [PR #13](https://github.com/eliezhao/icp-py-core/pull/13)).

* * *

## Links

- **PyPI:** [icp-py-core · PyPI](https://pypi.org/project/icp-py-core/)

- **Repo & changelog:** [GitHub - eliezhao/icp-py-core: Python Agent Library for the DFINITY Internet Computer](https://github.com/eliezhao/icp-py-core)

---

<div class="post-metadata">

**Author:** ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)\
**Post date:** [February 9, 2026, 1:19pm UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/76 "2026-02-09T13:19:49Z")

</div>

Since taking over the maintenance of the Python agent, I have completed all originally planned milestones along with every additional feature introduced afterward.

icp-py-core now delivers a comprehensive set of core functionalities and has resolved all previously identified security vulnerabilities from the ic-py audit.

Moving forward, maintenance will focus on staying aligned with the latest Internet Computer features, keeping endpoints up to date, optimizing performance, and addressing issues raised by the developer community.

Thank you for using icp-py-core — I remain committed to actively maintaining and improving this repository.

---

<div class="post-metadata">

**Author:** ![icpp](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icpp/32/9310_2.png) [@icpp](https://forum.dfinity.org/u/icpp)\
**Post date:** [February 9, 2026, 7:36pm UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/77 "2026-02-09T19:36:39Z")

</div>

Thank you for getting icp-py-core in good shape. Things are working great and this package is critical for a lot of the things we do.

---

<div class="post-metadata">

**Author:** ![icpp](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icpp/32/9310_2.png) [@icpp](https://forum.dfinity.org/u/icpp)\
**Post date:** [February 14, 2026, 2:55pm UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/78 "2026-02-14T14:55:21Z")

</div>

@C-B-Elite ,

FYI, icp-py-core is an important enabler to make this application possible & secure.

It is python cli that has a locally managed wallet that can now verify the certificates of signed messages using the capabilities of icp-py-core.

> **[GitHub - onicai/odin\_bots: Bitcoin rune trading CLI & SDK](https://github.com/onicai/odin_bots)**
>
> Bitcoin rune trading CLI & SDK

---

<div class="post-metadata">

**Author:** ![marc0olo](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/marc0olo/32/17290_2.png) [@marc0olo](https://forum.dfinity.org/u/marc0olo)\
**Post date:** [May 5, 2026, 8:03am UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/79 "2026-05-05T08:03:38Z")

</div>

Hey @C-B-Elite, can you look at this issue and fix it? We ran into the problem recently when using `ic-py-core` for preview deployments:

- [cbor2 6.x compatibility: frozendict breaks isinstance(response, dict) check in update\_raw() · Issue #14 · eliezhao/icp-py-core · GitHub](https://github.com/eliezhao/icp-py-core/issues/14)

---

<div class="post-metadata">

**Author:** ![icpp](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icpp/32/9310_2.png) [@icpp](https://forum.dfinity.org/u/icpp)\
**Post date:** [May 5, 2026, 11:48am UTC](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455/80 "2026-05-05T11:48:30Z")

</div>

> [@marc0olo](#):
>
> cbor2 6.x compatibility

Thanks for opening this issue. I also ran into it.

[Previous page](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455.md?page=3)

[Next page](https://forum.dfinity.org/t/ic-py-development-and-ongoing-maintenance/47455.md?page=5)
