Metobs reference
smhi.metobs.BaseMetobs
BaseMetobs class.
Source code in smhi/metobs.py
__init__()
Initialise base class.
Source code in smhi/metobs.py
smhi.metobs.Versions
Bases: BaseMetobs
Get available versions of Metobs API.
Source code in smhi/metobs.py
__init__(data_type='json')
Get versions.
Currently, only supports json
and version 1.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_type |
str
|
data_type of request |
'json'
|
Raises:
Type | Description |
---|---|
TypeError
|
data_type not supported |
Source code in smhi/metobs.py
smhi.metobs.Parameters
Bases: BaseMetobs
Get parameters for version 1 of Metobs API.
Source code in smhi/metobs.py
__init__(versions_object=None, version='1.0', data_type='json')
Get parameters from version.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
versions_object |
Optional[Versions]
|
versions object |
None
|
version |
Union[str, int]
|
selected version |
'1.0'
|
data_type |
str
|
data_type of request |
'json'
|
Raises:
Type | Description |
---|---|
TypeError
|
data_type not supported |
NotImplementedError
|
version not implemented |
Source code in smhi/metobs.py
smhi.metobs.Stations
Bases: BaseMetobs
Get stations from parameter for version 1 of Metobs API.
Source code in smhi/metobs.py
__init__(parameters_in_version, parameter=None, parameter_title=None, data_type='json')
Get stations from parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameters_in_version |
Parameters
|
parameters object |
required |
parameter |
Optional[int]
|
integer parameter key to get |
None
|
parameter_title |
Optional[str]
|
exact parameter title to get |
None
|
data_type |
str
|
data_type of request |
'json'
|
Raises:
Type | Description |
---|---|
TypeError
|
data_type not supported |
NotImplementedError
|
parameter not implemented |
Source code in smhi/metobs.py
smhi.metobs.Periods
Bases: BaseMetobs
Get periods from station for version 1 of Metobs API.
Note that stationset_title is not supported
Source code in smhi/metobs.py
__init__(stations_in_parameter, station=None, station_name=None, station_set=None, data_type='json')
Get periods from station.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stations_in_parameter |
Stations
|
stations object |
required |
station |
Optional[int]
|
integer station key to get |
None
|
station_name |
Optional[str]
|
exact station name to get |
None
|
station_set |
Optional[str]
|
station set to get |
None
|
data_type |
str
|
data_type of request |
'json'
|
Raises:
Type | Description |
---|---|
TypeError
|
data_type not supported |
NotImplementedError
|
station not implemented |
Source code in smhi/metobs.py
smhi.metobs.Data
Bases: BaseMetobs
Get data from period for version 1 of Metobs API.
Source code in smhi/metobs.py
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 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 |
|
__init__(periods_in_station, period=None, data_type='json')
Get data from period.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
periods_in_station |
Periods
|
periods object |
required |
period |
Optional[str]
|
select period from: latest-hour, latest-day, latest-months or corrected-archive |
None
|
data_type |
str
|
data_type of request |
'json'
|
Raises:
Type | Description |
---|---|
TypeError
|
data_type not supported |
NotImplementedError
|
period not implemented |