Assurance
This part of the project documentation focuses on
an information-oriented approach. Use it as a
reference for the technical implementation of the
pact_methodology
project code.
Assurance
Represents an assurance in conformance with PACT Methodology chapter 5 and appendix B.
This class represents the assurance information for a product carbon footprint calculation, including details about the assurance provider, coverage, level, and other relevant metadata.
Attributes:
Name | Type | Description |
---|---|---|
assurance |
bool
|
A boolean flag indicating whether the CarbonFootprint has been assured in line with PACT Methodology requirements (section 5). |
provider_name |
str
|
The non-empty name of the independent third party engaged to undertake the assurance. |
coverage |
Coverage | None
|
Level of granularity of the emissions data assured. |
level |
Level | None
|
Level of assurance applicable to the PCF. |
boundary |
Boundary | None
|
Boundary of the assurance. |
completed_at |
DateTime | None
|
The date at which the assurance was completed. |
standard_name |
str | None
|
Name of the standard against which the PCF was assured. |
comments |
str | None
|
Any additional comments that will clarify the interpretation of the assurance. |
Examples:
Create a basic assurance record:
>>> assurance = Assurance(
... assurance=True,
... provider_name="Assurance Corp"
... )
Create a detailed assurance record:
>>> from pact_methodology.datetime import DateTime
>>> detailed = Assurance(
... assurance=True,
... provider_name="Assurance Corp",
... coverage=Coverage.PRODUCT_LEVEL,
... level=Level.REASONABLE,
... boundary=Boundary.CRADLE_TO_GATE,
... completed_at=DateTime(2023, 1, 1),
... standard_name="ISO 14064-3:2019",
... comments="Full product lifecycle assessment"
... )
Convert assurance to dictionary format:
>>> assurance.to_dict()
{
'assurance': True,
'provider_name': 'Assurance Corp'
}
Raises:
Type | Description |
---|---|
ValueError
|
If assurance is not a boolean, if provider_name is not a string, if coverage is not None and not an instance of Coverage, if level is not None and not an instance of Level, if boundary is not None and not an instance of Boundary, if completed_at is not None and not an instance of DateTime, if standard_name is not None and not a string, if comments is not None and not a string. |
TypeError
|
If required arguments are missing during initialization. |
Note
Only assurance and provider_name are required fields. All other attributes are optional but must conform to their specified types when provided.
Source code in pact_methodology/assurance/assurance.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 |
|
assurance: bool
property
writable
Get the assurance flag.
Returns:
Type | Description |
---|---|
bool
|
The boolean assurance status |
boundary: Boundary | None
property
writable
Get the assurance boundary.
Returns:
Type | Description |
---|---|
Boundary | None
|
The Boundary enum value or None |
comments: str | None
property
writable
Get the assurance comments.
Returns:
Type | Description |
---|---|
str | None
|
The comments string or None |
completed_at: DateTime | None
property
writable
Get the assurance completion date.
Returns:
Type | Description |
---|---|
DateTime | None
|
The DateTime instance or None |
coverage: Coverage | None
property
writable
Get the assurance coverage level.
Returns:
Type | Description |
---|---|
Coverage | None
|
The Coverage enum value or None |
level: Level | None
property
writable
Get the assurance level.
Returns:
Type | Description |
---|---|
Level | None
|
The Level enum value or None |
provider_name: str
property
writable
Get the assurance provider name.
Returns:
Type | Description |
---|---|
str
|
The provider name string |
standard_name: str | None
property
writable
Get the assurance standard name.
Returns:
Type | Description |
---|---|
str | None
|
The standard name string or None |
__init__(assurance, provider_name, coverage=None, level=None, boundary=None, completed_at=None, standard_name=None, comments=None)
Initialize an Assurance instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
assurance
|
bool
|
Boolean indicating if CarbonFootprint is assured |
required |
provider_name
|
str
|
Name of the assurance provider |
required |
coverage
|
Coverage | None
|
Level of granularity of assured emissions data |
None
|
level
|
Level | None
|
Level of assurance for the PCF |
None
|
boundary
|
Boundary | None
|
Boundary of the assurance |
None
|
completed_at
|
DateTime | None
|
Date of assurance completion |
None
|
standard_name
|
str | None
|
Name of assurance standard used |
None
|
comments
|
str | None
|
Additional clarifying comments |
None
|
Raises:
Type | Description |
---|---|
ValueError
|
If arguments are invalid |
TypeError
|
If required arguments are missing |
Source code in pact_methodology/assurance/assurance.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
to_dict()
Convert the assurance to a dictionary representation.
Returns:
Type | Description |
---|---|
dict
|
A dictionary with the following structure: |
dict
|
{ "assurance": bool, # The assurance status "provider_name": str, # Name of assurance provider "coverage": str | None, # Coverage level if set "level": str | None, # Assurance level if set "boundary": str | None, # Assurance boundary if set "completed_at": str | None, # Completion date if set "standard_name": str | None, # Standard name if set "comments": str | None # Comments if set |
dict
|
} |
Source code in pact_methodology/assurance/assurance.py
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
|