Capacities
get_capacity_id(capacity_name)
Retrieves the ID of a capacity by its name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
capacity_name
|
str
|
The name of the capacity. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
str | None: The ID of the capacity if found, otherwise None. |
Source code in src/pyfabricops/core/capacities.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
list_capacities(df=True)
Returns a list of capacities.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
Optional[bool]
|
If True or not provided, returns a DataFrame with flattened keys. If False, returns a list of dictionaries. |
True
|
Returns:
| Type | Description |
|---|---|
Union[DataFrame, List[Dict[str, Any]], None]
|
A DataFrame with the list of capacities. |
Union[DataFrame, List[Dict[str, Any]], None]
|
If |
Source code in src/pyfabricops/core/capacities.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
resolve_capacity(capacity)
Resolves a capacity name to its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
capacity
|
str
|
The name of the capacity. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
str | None: The ID of the capacity if found, otherwise None. |
Source code in src/pyfabricops/core/capacities.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |