Projects

envless.projects.list_all()

Collect every reachable project into one list

def list_all(
    *,
    limit: int | None = None,
    offset: int | None = None,
    search: str | None = None,
    order: str | None = None,
    product: str | None = None,
    timeout: float | None = None,
) -> list[ProjectResource]

Walks every page for you and returns the flattened result. Use it when the workspace is small enough that holding all projects in memory is fine and you would rather not manage offsets.

The trap is limit=: here it sets the page size used while walking, not a cap on how many projects come back. Asking for a limit of 5 still returns everything, just in more round trips. Duplicate slugs across products survive into the list, so continue keying off id.

Example

from envless import envless

projects = envless.projects.list_all(search='api')

print(len(projects))

Parameters

ParameterTypeRequiredDescription
productstrNoProduct slug or product uniqueId to restrict the walk to one product.
limitintNoPage size used while walking, clamped to 100.
offsetintNoRow to start the walk from.
searchstrNoCase insensitive substring match against project name and slug.
orderstrNoDefaults to name, which sorts A to Z. Pass asc for oldest first or desc for newest first on createdAt.
timeoutfloatNoSeconds each attempt of this call may take, the response body included, before it raises EnvlessNetworkError with is_timeout set. Overrides the client's timeout for this call, and 0 turns the limit off.

Returns

list[ProjectResource] holding every project the key can reach.

Reads the projects collection. list returns one page as a dict with items and pagination, list_all collects every page into a list, and iterate yields one item at a time, fetching the next page only when the loop reaches it. On AsyncEnvless, iterate is an async iterator for async for.

Worth knowing

  • Page size defaults to the API maximum of 100 and is clamped there, so a larger limit buys nothing.
  • Nothing is returned until the final page lands. Prefer iterate when you want to act on rows as they arrive.

Required scopes

projects:read

Underlying endpoint

GET /projects

Request and response schema, every error code, and a live playground.

In TypeScript

envless.projects.listAll()

The same method in @goenvless/sdk, with the same request, retries and errors.