noaa_api.json_responses
This module defines JSON response schemas for various NOAA API endpoints (as opposed to all schemas in noaa_api.json_schemas).
Each schema represents a structured format returned by the NOAA API, allowing for type validation and easier integration when handling API responses. These schemas are derived from noaa_api.json_schemas and provide standardized representations of datasets, locations, stations, and other NOAA data.
Available Schemas:
- RateLimitJSON: Response format for API rate limits.
- DatasetIDJSON, DatasetsJSON: Schema for NOAA datasets.
- DatacategoryIDJSON, DatacategoriesJSON: Schema for data categories.
- DatatypeIDJSON, DatatypesJSON: Schema for data types.
- LocationcategoryIDJSON, LocationcategoriesJSON: Schema for location categories.
- LocationIDJSON, LocationsJSON: Schema for locations.
- StationIDJSON, StationsJSON: Schema for weather stations.
These schemas ensure structured API responses for reliable data handling.
1""" 2This module defines JSON response schemas for various NOAA API endpoints (as opposed to all schemas in `noaa_api.json_schemas`). 3 4Each schema represents a structured format returned by the NOAA API, allowing for type validation and easier integration when handling API responses. These schemas are derived from `noaa_api.json_schemas` and provide standardized representations of datasets, locations, stations, and other NOAA data. 5 6Available Schemas: 7 - RateLimitJSON: Response format for API rate limits. 8 - DatasetIDJSON, DatasetsJSON: Schema for NOAA datasets. 9 - DatacategoryIDJSON, DatacategoriesJSON: Schema for data categories. 10 - DatatypeIDJSON, DatatypesJSON: Schema for data types. 11 - LocationcategoryIDJSON, LocationcategoriesJSON: Schema for location categories. 12 - LocationIDJSON, LocationsJSON: Schema for locations. 13 - StationIDJSON, StationsJSON: Schema for weather stations. 14 15These schemas ensure structured API responses for reliable data handling. 16""" # noqa: E501 17 18import noaa_api.json_schemas as json_schemas 19 20RateLimitJSON = json_schemas.RateLimitJSON 21DatasetIDJSON = json_schemas.DatasetIDJSON 22DatasetsJSON = json_schemas.DatasetsJSON 23DatacategoryIDJSON = json_schemas.DatacategoryIDJSON 24DatacategoriesJSON = json_schemas.DatacategoriesJSON 25DatatypeIDJSON = json_schemas.DatatypeIDJSON 26DatatypesJSON = json_schemas.DatatypesJSON 27LocationcategoryIDJSON = json_schemas.LocationcategoryIDJSON 28LocationcategoriesJSON = json_schemas.LocationcategoriesJSON 29LocationIDJSON = json_schemas.LocationIDJSON 30LocationsJSON = json_schemas.LocationsJSON 31StationIDJSON = json_schemas.StationIDJSON 32StationsJSON = json_schemas.StationsJSON 33DataJSON = json_schemas.DataJSON 34 35AnyResponse = ( 36 RateLimitJSON 37 | DatasetIDJSON 38 | DatasetsJSON 39 | DatacategoryIDJSON 40 | DatacategoriesJSON 41 | DatatypeIDJSON 42 | DatatypesJSON 43 | LocationcategoryIDJSON 44 | LocationcategoriesJSON 45 | LocationIDJSON 46 | LocationsJSON 47 | StationIDJSON 48 | StationsJSON 49) 50""" 51Union type representing any possible response schema from the NOAA API from documented endpoints. 52""" # noqa: E501 53 54__all__ = [ 55 "RateLimitJSON", 56 "DatasetIDJSON", 57 "DatasetsJSON", 58 "DatacategoryIDJSON", 59 "DatacategoriesJSON", 60 "DatatypeIDJSON", 61 "DatatypesJSON", 62 "LocationcategoryIDJSON", 63 "LocationcategoriesJSON", 64 "LocationIDJSON", 65 "LocationsJSON", 66 "StationIDJSON", 67 "StationsJSON", 68 "AnyResponse", 69]
124class RateLimitJSON(TypedDict): 125 """ 126 Represents the JSON response structure for rate limit information. 127 """ # noqa: E501 128 129 status: str 130 """ 131 The status of the rate limit (e.g., 'error'). 132 """ # noqa: E501 133 134 message: str 135 """ 136 A descriptive message regarding the rate limit status. 137 """ # noqa: E501
Represents the JSON response structure for rate limit information.
144class DatasetIDJSON(TypedDict): 145 """ 146 Endpoint '/datasets/{id}' 147 Represents the JSON response structure for a specific dataset identified by its ID. 148 """ # noqa: E501 149 150 mindate: str # Date as "YYYY-MM-DD" 151 """ 152 The earliest date for which data is available, formatted as 'YYYY-MM-DD'. 153 """ 154 155 maxdate: str # Date as "YYYY-MM-DD" 156 """ 157 The latest date for which data is available, formatted as 'YYYY-MM-DD'. 158 """ 159 160 name: str 161 """ 162 The name of the dataset. 163 """ 164 165 datacoverage: float | int 166 """ 167 The proportion of data coverage, ranging from 0 to 1. 168 """ 169 170 id: str 171 """ 172 The unique identifier for the dataset. 173 """
Endpoint '/datasets/{id}' Represents the JSON response structure for a specific dataset identified by its ID.
217class DatasetsJSON(TypedDict): 218 """ 219 Endpoint '/datasets' 220 Represents the JSON response structure for the '/datasets' endpoint. 221 """ # noqa: E501 222 223 metadata: MetadataJSON 224 """ 225 Metadata information about the response. 226 """ 227 228 results: list[DatasetJSON] 229 """ 230 A list of datasets returned in the response. 231 """
Endpoint '/datasets' Represents the JSON response structure for the '/datasets' endpoint.
237class DatacategoryIDJSON(TypedDict): 238 """ 239 Endpoint '/datacategories/{id}' 240 Represents the JSON response structure for a specific data category identified by its ID. 241 """ # noqa: E501 242 243 name: str 244 """ 245 The name of the data category. 246 """ 247 248 id: str 249 """ 250 The unique identifier for the data category. 251 """
Endpoint '/datacategories/{id}' Represents the JSON response structure for a specific data category identified by its ID.
257class DatacategoriesJSON(TypedDict): 258 """ 259 Endpoint '/datacategories' 260 Represents the JSON response structure for the '/datacategories' endpoint. 261 """ # noqa: E501 262 263 metadata: MetadataJSON 264 """ 265 Metadata information about the response. 266 """ 267 268 results: list[DatacategoryIDJSON] 269 """ 270 A list of data categories returned in the response. 271 """
Endpoint '/datacategories' Represents the JSON response structure for the '/datacategories' endpoint.
277class DatatypeIDJSON(TypedDict): 278 """ 279 Endpoint '/datatypes/{id}' 280 Represents the JSON response structure for a specific data type identified by its ID. 281 """ # noqa: E501 282 283 mindate: str # Date as "YYYY-MM-DD" 284 """ 285 The earliest date for which the data type is available, formatted as 'YYYY-MM-DD'. 286 """ 287 288 maxdate: str # Date as "YYYY-MM-DD" 289 """ 290 The latest date for which the data type is available, formatted as 'YYYY-MM-DD'. 291 """ 292 293 datacoverage: float | int 294 """ 295 The proportion of data coverage for the data type. 296 """ 297 298 id: str 299 """ 300 The unique identifier for the data type. 301 """
Endpoint '/datatypes/{id}' Represents the JSON response structure for a specific data type identified by its ID.
339class DatatypesJSON(TypedDict): 340 """ 341 Endpoint '/datatypes' 342 Represents the JSON response structure for the '/datatypes' endpoint. 343 """ # noqa: E501 344 345 metadata: MetadataJSON 346 """ 347 Metadata information about the response. 348 """ 349 350 results: list[DatatypeJSON] 351 """ 352 A list of data types returned in the response. 353 """
Endpoint '/datatypes' Represents the JSON response structure for the '/datatypes' endpoint.
359class LocationcategoryIDJSON(TypedDict): 360 """ 361 Endpoint '/locationcategories/{id}' 362 Represents the JSON response structure for a specific location category identified by its ID. 363 """ # noqa: E501 364 365 name: str 366 """ 367 The name of the location category. 368 """ 369 370 id: str 371 """ 372 The unique identifier for the location category. 373 """
Endpoint '/locationcategories/{id}' Represents the JSON response structure for a specific location category identified by its ID.
379class LocationcategoriesJSON(TypedDict): 380 """ 381 Endpoint '/locationcategories' 382 Represents the JSON response structure for the '/locationcategories' endpoint. 383 """ # noqa: E501 384 385 metadata: MetadataJSON 386 """ 387 Metadata information about the response. 388 """ 389 390 results: list[LocationcategoryIDJSON] 391 """ 392 A list of location categories returned in the response. 393 """
Endpoint '/locationcategories' Represents the JSON response structure for the '/locationcategories' endpoint.
399class LocationIDJSON(TypedDict): 400 """ 401 Endpoint '/locations/{id}' 402 Represents the JSON response structure for a specific location identified by its ID. 403 """ # noqa: E501 404 405 mindate: str # Date as "YYYY-MM-DD" 406 """ 407 The earliest date for which data is available for the location, formatted as 'YYYY-MM-DD'. 408 """ # noqa: E501 409 410 maxdate: str # Date as "YYYY-MM-DD" 411 """ 412 The latest date for which data is available for the location, formatted as 'YYYY-MM-DD'. 413 """ # noqa: E501 414 415 name: str 416 """ 417 The name of the location. 418 """ 419 420 datacoverage: float | int 421 """ 422 The proportion of data coverage for the location. 423 """ 424 425 id: str 426 """ 427 The unique identifier for the location. 428 """
Endpoint '/locations/{id}' Represents the JSON response structure for a specific location identified by its ID.
The earliest date for which data is available for the location, formatted as 'YYYY-MM-DD'.
434class LocationsJSON(TypedDict): 435 """ 436 Endpoint '/locations' 437 Represents the JSON response structure for the '/locations' endpoint. 438 """ # noqa: E501 439 440 metadata: MetadataJSON 441 """ 442 Metadata information about the response, including pagination details. 443 """ 444 445 results: list[LocationIDJSON] 446 """ 447 A list of location records returned by the query. 448 """
Endpoint '/locations' Represents the JSON response structure for the '/locations' endpoint.
Metadata information about the response, including pagination details.
454class StationIDJSON(TypedDict): 455 """ 456 Endpoint '/stations/{id}' 457 Represents the JSON response structure for a specific station identified by its ID from the '/stations/{id}' endpoint. 458 """ # noqa: E501 459 460 elevation: int | float 461 """ 462 The elevation of the station in meters. 463 """ 464 465 mindate: str # Date as "YYYY-MM-DD" 466 """ 467 The earliest date for which data is available, formatted as 'YYYY-MM-DD'. 468 """ 469 470 maxdate: str # Date as "YYYY-MM-DD" 471 """ 472 The latest date for which data is available, formatted as 'YYYY-MM-DD'. 473 """ 474 475 latitude: float | int 476 """ 477 The latitude coordinate of the station. 478 """ 479 480 name: str 481 """ 482 The name of the station. 483 """ 484 485 datacoverage: float | int 486 """ 487 The proportion of data coverage, ranging from 0 to 1. 488 """ 489 490 id: str 491 """ 492 The unique identifier for the station. 493 """ 494 495 elevationUnit: str 496 """ 497 The unit of measurement for elevation (e.g., 'METERS'). 498 """ 499 500 longitude: float | int 501 """ 502 The longitude coordinate of the station. 503 """
Endpoint '/stations/{id}' Represents the JSON response structure for a specific station identified by its ID from the '/stations/{id}' endpoint.
509class StationsJSON(TypedDict): 510 """ 511 Endpoint '/stations' 512 Represents the JSON response structure for the '/stations' endpoint. 513 """ # noqa: E501 514 515 metadata: MetadataJSON 516 """ 517 Metadata information about the response, including pagination details. 518 """ 519 520 results: list[StationIDJSON] 521 """ 522 A list of station records returned by the query. 523 """
Endpoint '/stations' Represents the JSON response structure for the '/stations' endpoint.
Metadata information about the response, including pagination details.
Union type representing any possible response schema from the NOAA API from documented endpoints.