get()

Returns the portfolio with the given ID, or None when no such portfolio exists.

The server API offers no job that reads exactly one portfolio. get() is therefore a search() with portfolio_id and a single return value.

1. Signature

  • Sync

  • Async

ecm.portfolio.get(portfolio_id: int) -> ECMPortfolio | None
await ecm.portfolio.get(portfolio_id: int) -> ECMPortfolio | None

2. Parameters

Parameter Type Default Description

portfolio_id

int

Numeric ID of the portfolio.

3. Returns

ECMPortfolio or None.

4. Example

portfolio = ecm.portfolio.get(42)
if portfolio is None:
    print("portfolio does not exist")
else:
    for obj in portfolio.objects:
        print(obj.id, obj.type_id)
  • search() — several portfolios by criteria