Skip to content

Python API Reference

This reference is generated from the installed package. Run python scripts/gen_api_md.py to regenerate.

How values are reduced within a bucket.

SUM_QUANTITY — sum of quantities (default). COUNT — number of matching entries. SHARE — each bucket’s percentage of the filtered total (0..100).

What the /aggregate primitive groups over.

DIRECT — direct exchanges of the activity. SUPPLY_CHAIN — the upstream activities reachable via cumulative flow. BIOSPHERE — only biosphere flows in the supply chain.

Direction of a biosphere exchange.

RESOURCE — extraction from the environment (input). EMISSION — release to the environment (output).

HTTP client for the VoLCA HTTP API.

Usage::

c = Client(db="agribalyse-3.2", password="1234")
plants = c.search_activities(name="at plant")
chain = c.get_supply_chain(plants[0].process_id, name="at farm")

Substitutions can be passed to get_supply_chain, get_inventory, and get_impacts to compute results with a different upstream supplier — fast::

subs = [{"from": old_pid, "to": new_pid, "consumer": consumer_pid}]
result = c.get_impacts(pid, method_id=mid, substitutions=subs)

Constructor: Client(base_url: str = 'http://localhost:8080', db: str = '', password: str = '')

Client.aggregate(process_id: str, scope: AggregateScope | str, *, is_input: bool | None = None, max_depth: int | None = None, filter_name: str | None = None, filter_name_not: list[str] | str | None = None, filter_unit: str | None = None, preset: str | None = None, filter_classification: list[ClassificationFilter] | None = None, filter_target_name: str | None = None, filter_is_reference: bool | None = None, group_by: str | None = None, aggregate: AggregateOp | str | None = None) -> AggregateResult
Section titled “Client.aggregate(process_id: str, scope: AggregateScope | str, *, is_input: bool | None = None, max_depth: int | None = None, filter_name: str | None = None, filter_name_not: list[str] | str | None = None, filter_unit: str | None = None, preset: str | None = None, filter_classification: list[ClassificationFilter] | None = None, filter_target_name: str | None = None, filter_is_reference: bool | None = None, group_by: str | None = None, aggregate: AggregateOp | str | None = None) -> AggregateResult”

SQL-group-by aggregation over direct exchanges, supply chain, or biosphere flows.

Args: scope: :class:AggregateScope member (DIRECT / SUPPLY_CHAIN / BIOSPHERE) or the equivalent wire string. Strings are accepted for one-liner ergonomics but bypass static checking. group_by: omit for a single-bucket result (just the totals). Supported keys: "name", "flow_id", "name_prefix", "unit", "location", "target_name", "classification.<system>". aggregate: :class:AggregateOp member or wire string ("sum_quantity" — default, "count", or "share").

Client.call(operation_id: str, **kwargs) -> Any
Section titled “Client.call(operation_id: str, **kwargs) -> Any”

Escape hatch: call any OpenAPI operation by operationId.

Returns the raw JSON (no dataclass wrapping). Use this for operations that don’t have an ergonomic wrapper yet, or for new endpoints added after the installed pyvolca was released.

Client.copy_database(new_name: str, db_name: str | None = None) -> dict
Section titled “Client.copy_database(new_name: str, db_name: str | None = None) -> dict”

Copy a loaded database in memory under a new name.

new_name is a path segment; the source defaults to self.db. Returns the engine’s ActivateResponse dict ({"success", "message", "database"?}). Raises VoLCAError if the engine reports success=false.

Client.delete_activities(*, name: str = '', location: str = '', product: str = '', classifications: list[dict | tuple] | None = None, exact: bool = False, keep: list[str] | None = None, extra: list[str] | None = None, db_name: str | None = None) -> dict
Section titled “Client.delete_activities(*, name: str = '', location: str = '', product: str = '', classifications: list[dict | tuple] | None = None, exact: bool = False, keep: list[str] | None = None, extra: list[str] | None = None, db_name: str | None = None) -> dict”

Delete activities selected by filter, sparing/adding explicit ids.

Builds a DeleteSelectionRequest: the filter fields select the whole matching set, keep spares matched process ids, and extra adds ones the filter missed. classifications is a list of {"system", "value", "exact"} dicts or (system, value, exact) tuples.

Returns the DeleteSelectionResponse dict ({"success", "message", "deleted"}); raises VoLCAError on success=false.

Client.get_activity(process_id: str) -> ActivityDetail
Section titled “Client.get_activity(process_id: str) -> ActivityDetail”

Fetch an activity’s full detail.

Returns a typed ActivityDetail. Use act.inputs / act.outputs / act.technosphere_inputs to filter exchanges instead of walking act.exchanges directly.

Client.get_characterization(method_id: str, *, flow: str | None = None, limit: int | None = None) -> CharacterizationResult
Section titled “Client.get_characterization(method_id: str, *, flow: str | None = None, limit: int | None = None) -> CharacterizationResult”

Look up characterization factors for a method matched to database flows.

Returns a :class:CharacterizationResult carrying matches (total rows the filter selected) and shown (rows actually returned under limit). Check result.has_more to detect truncation.

Client.get_consumers(process_id: str, *, name: str | None = None, location: str | None = None, product: str | None = None, preset: str | None = None, classification_filters: list[ClassificationFilter] | None = None, page: int | None = None, page_size: int | None = None, limit: int | None = None, offset: int | None = None, max_depth: int | None = None, include_edges: bool = False) -> ConsumersResponse
Section titled “Client.get_consumers(process_id: str, *, name: str | None = None, location: str | None = None, product: str | None = None, preset: str | None = None, classification_filters: list[ClassificationFilter] | None = None, page: int | None = None, page_size: int | None = None, limit: int | None = None, offset: int | None = None, max_depth: int | None = None, include_edges: bool = False) -> ConsumersResponse”

Find all activities that transitively consume this supplier.

Args: max_depth: Max hops from supplier. 1 = direct consumers only. classification_filters: ClassificationFilter entries restricting the results. Multiple filters are AND-combined by the server. Mode is :class:MatchMode.EXACT or :class:MatchMode.CONTAINS. include_edges: When True, the response carries every technosphere edge whose endpoints are both reachable from the supplier. Callers can walk these to reconstruct supplier→consumer paths without a second get_path_to round-trip.

Returns a :class:ConsumersResponse whose consumers attribute is a :class:SearchResults[ConsumerResult] (iterate it to walk every consumer across all pages) and whose edges attribute carries the traversal subgraph (empty by default).

Client.get_contributing_activities(process_id: str, method_id: str, *, collection: str = 'methods', limit: int | None = None) -> ContributingActivities
Section titled “Client.get_contributing_activities(process_id: str, method_id: str, *, collection: str = 'methods', limit: int | None = None) -> ContributingActivities”

Which upstream activities drive a given impact category.

Same engine-side limitation as :meth:get_contributing_flows: no total exposed, so has_more cannot be derived. Inspect share_pct totals to gauge coverage.

Client.get_contributing_flows(process_id: str, method_id: str, *, collection: str = 'methods', limit: int | None = None) -> ContributingFlows
Section titled “Client.get_contributing_flows(process_id: str, method_id: str, *, collection: str = 'methods', limit: int | None = None) -> ContributingFlows”

Which elementary flows drive a given impact category.

Returns a :class:ContributingFlows. Caveat: the engine does not report the total flow count, so pyvolca cannot derive has_more from the response. Pass a generous limit if you need exhaustive coverage and inspect share_pct totals.

Client.get_flow_mapping(method_id: str) -> FlowMapping
Section titled “Client.get_flow_mapping(method_id: str) -> FlowMapping”

Get the characterization-factor-to-database-flow mapping coverage.

:class:FlowMapping.coverage_pct summarises how many of the DB’s biosphere flows the method has a CF for; flows is the per-flow breakdown including unmatched rows (cf_value=None).

Client.get_impacts(process_id: str, method_id: str, *, collection: str = 'methods', top_flows: int | None = None, substitutions: list[SubstitutionLike] | None = None) -> LCIAResult
Section titled “Client.get_impacts(process_id: str, method_id: str, *, collection: str = 'methods', top_flows: int | None = None, substitutions: list[SubstitutionLike] | None = None) -> LCIAResult”

Compute the LCIA score for a single impact category on an activity.

Use :meth:get_impacts_batch to retrieve every category in a method collection at once (and any configured scoring sets).

Args: collection: Method collection name. Defaults to "methods" for single-method calls; most engines expose methods under a single collection. top_flows: Max top contributing flows to return (default 5).

Client.get_impacts_batch(process_id: str, *, collection: str = 'methods', substitutions: list[SubstitutionLike] | None = None) -> LCIABatchResult
Section titled “Client.get_impacts_batch(process_id: str, *, collection: str = 'methods', substitutions: list[SubstitutionLike] | None = None) -> LCIABatchResult”

Compute LCIA for every impact category in a collection, in one call.

The response carries the per-method :class:LCIAResult list plus any formula-based scoring sets declared in the engine config (PEF, ECS…). scoring_indicators gives the per-variable breakdown of each scoring set, pre-multiplied by the set’s displayMultiplier.

Uses a direct HTTP call: the batch endpoint has no operationId in the OpenAPI spec (the dispatcher primary is the single-method variant), so this wrapper bypasses _call and builds the URL itself.

Client.get_inputs(process_id: str) -> list[Exchange]
Section titled “Client.get_inputs(process_id: str) -> list[Exchange]”

Return the input exchanges of an activity (richer metadata than get_activity).

Uses a direct HTTP call because /inputs has no operationId (it’s a non-Resources auxiliary endpoint).

Client.get_inventory(process_id: str, *, flow: str | None = None, limit: int | None = None, substitutions: list[SubstitutionLike] | None = None) -> InventoryResult
Section titled “Client.get_inventory(process_id: str, *, flow: str | None = None, limit: int | None = None, substitutions: list[SubstitutionLike] | None = None) -> InventoryResult”

Compute the life-cycle inventory (cumulative biosphere flows) for an activity.

Returns an :class:InventoryResult with the per-elementary-flow totals scaled to one functional unit of the activity’s reference product. Use :meth:get_impacts to apply a characterization method to the inventory; use :meth:aggregate with scope="biosphere" for grouped views.

Args: flow: Substring filter on flow name. limit: Cap on returned flow rows. (Server returns full inventory otherwise — the engine doesn’t paginate this endpoint.) substitutions: Upstream supplier swaps; see :meth:get_supply_chain.

Client.get_outputs(process_id: str) -> list[Exchange]
Section titled “Client.get_outputs(process_id: str) -> list[Exchange]”

Return the output exchanges of an activity. See :meth:get_inputs for notes.

Client.get_path_to(process_id: str, target: str) -> PathResult
Section titled “Client.get_path_to(process_id: str, target: str) -> PathResult”

Find the shortest upstream path from process to first activity whose name matches target.

Returns a PathResult whose path is ordered root → target. Each step includes cumulative_quantity, scaling_factor, and (except the root) local_step_ratio.

Client.get_supply_chain(process_id: str, *, name: str | None = None, location: str | None = None, limit: int | None = None, min_quantity: float | None = None, max_depth: int | None = None, preset: str | None = None, classification_filters: list[ClassificationFilter] | None = None, substitutions: list[SubstitutionLike] | None = None, include_edges: bool | None = None) -> SupplyChain
Section titled “Client.get_supply_chain(process_id: str, *, name: str | None = None, location: str | None = None, limit: int | None = None, min_quantity: float | None = None, max_depth: int | None = None, preset: str | None = None, classification_filters: list[ClassificationFilter] | None = None, substitutions: list[SubstitutionLike] | None = None, include_edges: bool | None = None) -> SupplyChain”

Get the flat supply chain of an activity.

Returns a :class:SupplyChain. Check result.has_more to detect when limit truncated entries below filtered_activities — further downstream analysis on a truncated chain would be wrong without flagging the gap.

Args: max_depth: Max hops from root. 1 = direct inputs only. classification_filters: Restrict entries to those matching any of the given ClassificationFilter triples. Multiple filters are AND-combined by the server. substitutions: When provided, the call is upgraded to POST and the scaling vector is recomputed with the substituted suppliers. Accepts :class:Substitution (preferred) or the legacy {"from", "to", "consumer"} dict form; consumer is optional — omit it for a global swap.

Fetch the recursive activity tree used by the analysis SPA.

/tree has no operationId in the OpenAPI spec — it’s kept for the SPA’s lazy-expanding graph widget and intentionally not exposed as a Resource. Included here as a direct HTTP call for scripts that need the same shape.

Return server build metadata: version, git hash/tag, build target.

Uses a direct HTTP call — /api/v1/version has no operationId since it predates the Resources ADT.

List classification systems and their values for the current database.

ClassificationSystem.activity_count tells how widely each system is populated — useful for picking a filter dimension with enough signal.

List every database declared in the engine config.

The typed entries carry depends_on, so callers can derive cross-DB dependency sets from declared topology rather than hardcoding allowlists.

List every LCIA method available in the engine.

Each :class:Method carries id, name, category, unit, factor_count, and the parent collection. Pass m.id to :meth:get_impacts as method_id.

List classification presets configured in this instance.

Each :class:Preset carries its filters (list of :class:PresetFilter triples). Apply by passing preset=p.name to filtering endpoints.

Client.load_database(db_name: str) -> dict
Section titled “Client.load_database(db_name: str) -> dict”

Load a database into memory so it answers queries.

Has no effect if the database is already loaded.

Fetch the OpenAPI spec from the server and refresh the dispatch table.

Also regenerates the .pyi type stubs in the installed pyvolca package directory so IDE autocomplete reflects the current engine. Useful when the engine is upgraded without reinstalling pyvolca.

Client.search_activities(name: str | None = None, *, geo: str | None = None, product: str | None = None, preset: str | None = None, classification: str | None = None, classification_value: str | None = None, page: int | None = None, page_size: int | None = None, limit: int | None = None, offset: int | None = None, exact: bool = False) -> SearchResults[Activity]
Section titled “Client.search_activities(name: str | None = None, *, geo: str | None = None, product: str | None = None, preset: str | None = None, classification: str | None = None, classification_value: str | None = None, page: int | None = None, page_size: int | None = None, limit: int | None = None, offset: int | None = None, exact: bool = False) -> SearchResults[Activity]”

Search activities in the current database.

All filters are AND-combined and case-insensitive. name and product match by substring unless exact=True.

Returns a paginated :class:SearchResults — iterate it to walk every match across all pages (subsequent pages fetched on demand), or use .page(n) for explicit page access. len(results) is the server-reported total across all pages.

Args: name: Substring (or exact match) on activity name. geo: Geography code ("FR", "GLO", "RoW"…). product: Substring on the reference product name. preset: Apply a named classification preset configured in the engine. classification: System name ("ISIC rev.4 ecoinvent"). classification_value: Substring within that system’s value. page: 1-based page number. Must be paired with page_size — offset cannot be derived from page alone. page_size: Items per page (becomes the wire-level limit). Alone (no page) means “page 1 with this size”. limit: Wire-level cap on returned items. Prefer page_size. offset: Wire-level starting index. Prefer page + page_size. exact: When True, name and product are matched exactly.

Returns: :class:SearchResults[Activity] — iterable across all pages.

Client.search_flows(query: str | None = None, *, page: int | None = None, page_size: int | None = None, limit: int | None = None, offset: int | None = None) -> SearchResults[Flow]
Section titled “Client.search_flows(query: str | None = None, *, page: int | None = None, page_size: int | None = None, limit: int | None = None, offset: int | None = None) -> SearchResults[Flow]”

Search flows (technosphere products and biosphere flows) in the current database.

Returns a paginated :class:SearchResults[Flow] — iterate to walk every match across all pages, or use .page(n) for explicit access. See :meth:search_activities for the pagination contract.

Args: query: Substring matched case-insensitively against flow names. page / page_size: Web-style pagination; convert to wire-level offset / limit. limit / offset: Wire-level escape hatch.

Client.unload_database(db_name: str) -> dict
Section titled “Client.unload_database(db_name: str) -> dict”

Unload a database from memory to free RAM. The disk copy is kept.

Return a new client targeting a different database.

Shares the underlying HTTP session, dispatch table, and any other Client-level state with the original — only db is overridden. New fields added to :meth:Client.__init__ propagate automatically (no manual mirror to keep in sync).

Lifecycle state of a database in the engine.

UNLOADED — declared in the engine config but not yet loaded. PARTIALLY_LINKED — loaded, but some cross-DB flow references could not be resolved against currently-loaded dependencies. LOADED — loaded and fully linked.

Inherits from :class:str, so dataclasses.asdict(db)["status"] serialises as the bare wire string.

How a :class:ClassificationFilter value is compared against the entry.

EXACT — case-insensitive equality. CONTAINS — case-insensitive substring. Inherits from :class:str so json.dumps(MatchMode.EXACT) and dataclasses.asdict(filter)["mode"] both serialise as the bare string "exact" / "contains".

Manages the VoLCA server process.

Usage::

with Server(config="volca.toml") as srv:
client = Client(base_url=srv.base_url, db="agribalyse-3.2", password=srv.password)
activities = client.search_activities(name="at plant")

Constructor: Server(config: str = 'volca.toml', port: int = 0, binary: str = 'volca')

http://localhost:<port> — pass to :class:Client(base_url=…).

Always loopback: the managed server only listens locally.

Health check — GET /api/v1/db, return True if 200.

Server.start(idle_timeout: int = 300, wait_timeout: int = 120) -> None
Section titled “Server.start(idle_timeout: int = 300, wait_timeout: int = 120) -> None”

Spawn the engine process if it is not already serving, and wait until ready.

Args: idle_timeout: Seconds without an HTTP request before the engine shuts itself down. Default 5 min. wait_timeout: How long to poll for the server to become healthy before raising :class:TimeoutError.

No-op if a healthy server is already reachable on base_url.

Stop the server via shutdown endpoint, then terminate process.

Role a technosphere exchange plays within its host activity.

REFERENCE_PRODUCT — the activity’s reference output product. COPRODUCT — a secondary output (in allocated activities). REFERENCE_INPUT — the reference input (in waste-treatment activities). INPUT — any other technosphere input.

Raised when the download or verification fails.

Error from the VoLCA API.

Constructor: VoLCAError(message: str, status_code: int | None = None, body: str = '')

One activity in a database — the row returned by /activities search.

process_id is the engine’s canonical address (activityUUID_productUUID) and is what you pass to every detail endpoint (:meth:Client.get_activity, :meth:Client.get_supply_chain, :meth:Client.get_impacts, …). name is the activity name (e.g. "wheat flour, at plant"); product is the reference output product (e.g. "wheat flour"); product_amount and product_unit describe the functional unit (typically 1.0 of "kg" / "MJ" / etc.). location is the geography code ("FR", "GLO", "RoW"…).

FieldTypeDefault
process_idstr
namestr
locationstr
productstr
product_amountfloat
product_unitstr

One upstream activity’s contribution to an LCIA score.

Returned in :class:ContributingActivities.activities. share_pct is the percentage of the total impact this activity contributes (0..100).

FieldTypeDefault
process_idstr
activity_namestr
product_namestr
locationstr
contributionfloat
share_pctfloat

Typed wrapper around the JSON returned by GET /activity/{pid}.

Use the .inputs / .outputs / .technosphere_inputs convenience properties instead of walking the raw exchanges list.

FieldTypeDefault
process_idstr
namestr
locationstr
unitstr
descriptionlist[str]
classificationsdict[str, str]
reference_productstr | None
reference_product_amountfloat | None
reference_product_unitstr | None
all_productslist[Activity]
exchangeslist[Union[TechnosphereExchange, BiosphereExchange, WasteExchange]]

Result of compare_activities.

FieldTypeDefault
scopestr
group_bystr
matchedlist[ActivityDiffRow]list()
left_onlylist[ActivityDiffRow]list()
right_onlylist[ActivityDiffRow]list()

One matched or unmatched flow in an activity comparison.

FieldTypeDefault
keystr
leftfloat | None
rightfloat | None
unitstr | None

One bucket inside an AggregateResult.

FieldTypeDefault
keystr
quantityfloat
countint
unitstr | NoneNone
sharefloat | NoneNone

Result of a Client.aggregate() call.

filtered_total is the sum across all items matching the filters (the top-level number). groups is the per-bucket breakdown when group_by was set; empty otherwise.

FieldTypeDefault
scopeAggregateScope
filtered_totalfloat
filtered_unitstr | None
filtered_countint
groupslist[AggregateGroup]list()

An exchange with the environment (resource extraction or emission).

FieldTypeDefault
flow_namestr
compartmentCompartment | None
amountfloat
unitstr
directionBioDirection
commentstr | NoneNone
is_biosphereboolTrue
is_wasteboolFalse

One characterization factor matched against a database biosphere flow.

Returned in the factors list of :class:CharacterizationResult. match_strategy records how the CF was matched to the DB flow ("uuid", "cas", "name", "synonym", "fuzzy").

FieldTypeDefault
method_flow_namestr
cf_valuefloat
cf_unitstr
directionstr
db_flow_namestr
flow_idstr
flow_unitstr
categorystr
match_strategystr
compartmentstr | NoneNone

Result of :meth:Client.get_characterization.

The engine truncates factors to shown rows (server-side limit). matches is the unfiltered total: use :attr:has_more to detect when the slice is incomplete.

FieldTypeDefault
methodstr
unitstr
matchesint
shownint
factorslist[CharacterizationFactor]list()

Filter a supply-chain/consumers query by a classification (system, value, mode).

Matches one classification system entry, e.g. ClassificationFilter("Category", "Agricultural\\Food", "exact") or ClassificationFilter("Category", "Agricultural\\Food", MatchMode.EXACT). Multiple filters are AND-combined by the server.

FieldTypeDefault
systemstr
valuestr
modeMatchMode<MatchMode.CONTAINS: ‘contains’>

One classification system declared by a database.

values are the distinct entries in this system; activity_count is how many activities carry at least one classification under this system (helps callers pick a worthwhile filter dimension).

FieldTypeDefault
namestr
valueslist[str]list()
activity_countint0

Biosphere compartment (medium + optional subcompartment).

Frozen so it’s hashable and immutable — callers can use it as a dict key when grouping flows by compartment, and accidental mutation is rejected.

FieldTypeDefault
namestr
substr | NoneNone

Activity that consumes a given supplier, with BFS depth.

FieldTypeDefault
process_idstr
namestr
locationstr
productstr
product_amountfloat
product_unitstr
depthint
classificationsdict[str, str]dict()

Reverse supply chain (/consumers) — paginated consumer list plus optional edge set. Mirrors :class:SupplyChain so callers have a uniform {entries, edges} shape in both traversal directions.

consumers is a :class:SearchResults[ConsumerResult] — iterate it to walk every consumer across all pages. edges is populated only when include_edges=True.

FieldTypeDefault
consumersSearchResults[ConsumerResult]
edgeslist[SupplyChainEdge]list()

Top upstream activities driving an LCIA score.

Same engine-side limitation as :class:ContributingFlows: the server reports no total, so pyvolca cannot derive has_more. Pass a generous limit and inspect share_pct if exhaustive coverage matters.

FieldTypeDefault
methodstr
unitstr
total_scorefloat
activitieslist[ActivityContribution]list()

Top elementary flows driving an LCIA score.

Note: the engine does not report a total — top_flows is whatever the server returned under limit, but pyvolca cannot tell whether more flows were truncated. If you need exhaustive coverage, pass a generous limit and inspect share_pct totals.

FieldTypeDefault
methodstr
unitstr
total_scorefloat
top_flowslist[FlowContribution]list()

One entry of :meth:Client.list_databases.

depends_on names the databases this one links against for cross-DB flow resolution — mirrors the dependsOn list surfaced by the relink endpoint. Derived from the engine’s declared topology, not runtime state.

FieldTypeDefault
namestr
display_namestr
statusDatabaseStatus
pathstr
load_at_startupboolFalse
is_uploadedboolFalse
activity_countint0
descriptionstr | NoneNone
formatstr | NoneNone
depends_onlist[str]list()

A technosphere product or biosphere flow as returned by /flows.

Mirrors the server’s :code:FlowSearchResult. synonyms maps language code → list of synonym strings (empty when the database carries no synonym index).

FieldTypeDefault
idstr
namestr
categorystr
unit_namestr
synonymsdict[str, list[str]]dict()

Top contributing elementary flow for an impact category.

Emitted inside LCIAResult.top_contributors.

FieldTypeDefault
flow_namestr
contributionfloat
share_pctfloat
flow_idstr
categorystr
cf_valuefloat0.0
compartmentstr | NoneNone

CF-coverage report for one method against the current database.

matched_flows / total_flows is the coverage ratio: how many of the database’s biosphere flows have a CF in this method. Mirrors the engine response of :meth:Client.get_flow_mapping.

FieldTypeDefault
method_namestr
method_unitstr
total_flowsint
matched_flowsint
flowslist[FlowMappingEntry]list()

One DB biosphere flow and the CF (if any) assigned to it.

cf_value is None when this DB flow has no characterization factor in the method — that flow contributes 0 to the score for the method. match_strategy records how the mapping was resolved ("uuid", "cas", "name", "synonym", "fuzzy").

FieldTypeDefault
flow_idstr
flow_namestr
flow_categorystr
cf_valuefloat | NoneNone
cf_flow_namestr | NoneNone
match_strategystr | NoneNone

Result of :func:download.

FieldTypeDefault
binaryPath
data_dirPath
versionstr
data_versionstr

One row of an inventory: a biosphere flow scaled to the functional unit.

is_emission distinguishes outputs (releases) from inputs (resource extraction). flow_id is the database UUID; compartment is the medium label (e.g. "air/urban air") when the source dataset declared one. category is the engine-normalised category used for grouping.

FieldTypeDefault
flow_idstr
flow_namestr
quantityfloat
unit_namestr
is_emissionbool
categorystr
compartmentstr | NoneNone

Life-cycle inventory of an activity: cumulative biosphere flows.

Returned by :meth:Client.get_inventory. The engine does not paginate — flows is the full inventory (filtered by flow= substring when requested). statistics carries the per-direction roll-ups and the most-populated categories.

root is the activity the inventory was computed for. total_flows, emission_flows, resource_flows mirror the engine’s metadata block.

FieldTypeDefault
rootActivity
total_flowsint
emission_flowsint
resource_flowsint
flowslist[InventoryFlow]
statisticsInventoryStatistics

Roll-up totals of an inventory result.

emission_quantity and resource_quantity are sums by direction; total_quantity is the sum of absolute values. top_categories lists (category_name, flow_count) pairs ordered by frequency.

FieldTypeDefault
total_quantityfloat
emission_quantityfloat
resource_quantityfloat
top_categorieslist[tuple[str, int]]list()

Batch LCIA: every impact category in a method collection, for one activity.

Returned by :meth:Client.get_impacts_batch. Carries the per-method impact results plus any formula-based scoring sets configured in the engine TOML (PEF, ECS, or any named set).

scoring_indicators gives the per-variable normalized-weighted breakdown of each scoring set — already multiplied by the set’s displayMultiplier and expressed in its display unit (see :class:ScoringIndicator). Lets callers render per-indicator charts alongside the aggregate scoring_results.

FieldTypeDefault
resultslist[LCIAResult]
single_scorefloat | NoneNone
single_score_unitstr | NoneNone
norm_weight_set_namestr | NoneNone
available_nw_setslist[str]list()
scoring_resultsdict[str, dict[str, float]]dict()
scoring_unitsdict[str, str]dict()
scoring_indicatorsdict[str, dict[str, ScoringIndicator]]dict()

LCIA score for one impact category on one activity.

Returned directly by :meth:Client.get_impacts, and nested inside :class:LCIABatchResult.results (one entry per impact category).

FieldTypeDefault
method_idstr
method_namestr
categorystr
damage_categorystr
scorefloat
unitstr
mapped_flowsint
functional_unitstr
normalized_scorefloat | NoneNone
weighted_scorefloat | NoneNone
top_contributorslist[FlowContribution]list()

One LCIA method, returned by :meth:Client.list_methods.

Pass id to :meth:Client.get_impacts as method_id. collection is the parent method collection (e.g. "ef-31"), forwarded to :meth:Client.get_impacts / :meth:Client.get_impacts_batch as their collection argument.

FieldTypeDefault
idstr
namestr
categorystr
unitstr
factor_countint
collectionstr

Shortest upstream path from a root process to a matching activity.

FieldTypeDefault
pathlist[PathStep]
path_lengthint
total_ratiofloat

One step in the supply chain path returned by get_path_to.

Note: the /path endpoint emits snake_case JSON directly (built via aeson’s object [...] rather than generic ToJSON), so it bypasses the engine’s stripLowerPrefix transform.

FieldTypeDefault
process_idstr
namestr
locationstr
unitstr
cumulative_quantityfloat
scaling_factorfloat
local_step_ratiofloat | NoneNone

A named classification preset declared in the engine config.

Apply by passing preset=preset.name to filtering endpoints (the engine expands it server-side into the filters triples).

FieldTypeDefault
namestr
labelstr
descriptionstr | None
filterslist[PresetFilter]list()

One filter triple inside a :class:Preset.

FieldTypeDefault
systemstr
valuestr
modeMatchMode<MatchMode.CONTAINS: ‘contains’>

One per-variable entry inside LCIABatchResult.scoring_indicators.

value is pre-multiplied by the scoring set’s displayMultiplier (configured in the scoring TOML) and expressed in the set’s display unit. category names the impact category the variable was resolved from.

FieldTypeDefault
categorystr
valuefloat

Paginated wire envelope, mirrors Haskell SearchResults a.

Carries one page of results plus pagination metadata. Iterating walks every page lazily, fetching subsequent pages on demand via the _fetch callback. len() returns total — the server-reported count across all pages, not just the items currently held.

Wire fields (results, total, offset, limit, has_more, search_time_ms) mirror the server type exactly. Page-style helpers (page_size, page(n)) are client conveniences computed from them.

Pages fetched during iteration are cached on the instance — re-iterating replays the cache without hitting the server. Wrap in list(...) to materialise eagerly if you prefer.

FieldTypeDefault
resultslist[~T]
totalint
offsetint
limitint
has_morebool
search_time_msfloat
_fetchOptional[Callable[[int, int | None], dict]]None
_parseOptional[Callable[[dict], ~T]]None
_fetchedlist[~T]list()
_exhaustedboolFalse

Server build metadata returned by :meth:Client.get_version.

git_tag is None for untagged dev builds. build_target names the platform triple the binary was compiled for (e.g. "x86_64-linux").

FieldTypeDefault
versionstr
git_hashstr
git_tagstr | None
build_targetstr

Replace one supplier with another in the upstream supply chain.

All fields are process_ids. consumer identifies which downstream consumer’s input to rewrite, scoping the swap to one edge — the same upstream supplier can be replaced by different alternatives in different parts of the tree. Omit it (leave None) to apply the swap globally, replacing the supplier on every consumer at once.

Frozen so callers can put it in a set / dict key and re-use the same substitution across multiple calls without aliasing risk.

FieldTypeDefault
from_pidstr
to_pidstr
consumerstr | NoneNone

Flat supply chain of an activity.

total_activities is the unfiltered upstream count; filtered_activities is what remains after the server applies classification_filters / min_quantity / preset. entries is the slice the server actually returned — it may be shorter than filtered_activities when limit truncates. Use :attr:has_more to detect that case rather than comparing lengths by hand.

FieldTypeDefault
rootActivity
total_activitiesint
filtered_activitiesint
entrieslist[SupplyChainEntry]list()
edgeslist[SupplyChainEdge]list()

A consumer→supplier link in the supply chain.

from/to are Python keywords, so the process ids are stored under from_id/to_id. from_db/to_db carry each endpoint’s database name, which is required to route edges across databases (the same process id can exist in more than one loaded DB).

FieldTypeDefault
from_idstr
from_dbstr
to_idstr
to_dbstr
amountfloat

One activity in a :class:SupplyChain.entries list.

quantity is the cumulative amount of this activity’s reference product consumed per functional unit of the root activity, in unit. scaling_factor is the multiplier the solver applied to this activity to produce quantity — i.e. quantity = ref_output * scaling_factor. classifications mirrors the producing activity’s classifications (ISIC, CPC, Category, …) so callers can filter by taxonomy without a second :meth:Client.get_activity round trip.

FieldTypeDefault
process_idstr
namestr
locationstr
quantityfloat
unitstr
scaling_factorfloat
classificationsdict[str, str]dict()

An exchange with another activity. Carries no compartment — the producing activity’s classifications describe the product taxonomy.

FieldTypeDefault
flow_namestr
amountfloat
unitstr
roleTechRole
target_activitystr | None
target_locationstr | None
target_process_idstr | None
commentstr | NoneNone
is_biosphereboolFalse
is_wasteboolFalse

An exchange of a waste flow with a treatment activity.

Shares the technosphere matrix with product flows but tracked as its own kind so callers can tell a “waste sent to landfill” output apart from a product input. Orphan waste (no linked treatment) contributes zero impact — same cut-off semantics as an orphan technosphere input.

FieldTypeDefault
flow_namestr
amountfloat
unitstr
is_inputbool
target_activitystr | None
target_locationstr | None
target_process_idstr | None
commentstr | NoneNone
is_biosphereboolFalse
is_wasteboolTrue

compare_activities(client: Client, pid_left: str, pid_right: str, *, scope: str = 'direct', group_by: str = 'flow_id', is_input: bool | None = True, **aggregate_kwargs) -> ActivityDiff

Section titled “compare_activities(client: Client, pid_left: str, pid_right: str, *, scope: str = 'direct', group_by: str = 'flow_id', is_input: bool | None = True, **aggregate_kwargs) -> ActivityDiff”

Diff two activities by flow_id (default) at the requested scope.

Returns three lists:

  • matched: flows present in both activities (with left, right, delta).
  • left_only: flows present only in the left activity.
  • right_only: flows present only in the right activity.

Default is_input=True restricts the comparison to inputs, which is the common case for “what does this variant consume differently?”. Pass is_input=None to include outputs as well.

download(version: Optional[str] = None, repo: str = 'ccomb/volca', *, force: bool = False) -> Installed

Section titled “download(version: Optional[str] = None, repo: str = 'ccomb/volca', *, force: bool = False) -> Installed”

Download the volca binary + data bundle for the current platform.

Idempotent: if both artefacts are already extracted under the install root and force=False, returns immediately without network.

Args: version: GH Release tag (v0.7.0); None resolves the latest. repo: GitHub repo slug. Default ccomb/volca. force: Re-download even if the install root looks complete.

Returns: :class:Installed with the resolved paths and versions.

Type alias: Union[TechnosphereExchange, BiosphereExchange, WasteExchange].