Skip to content

Client reference

AvwxApiClient

Source code in pyavwx/avwx_client.py
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 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
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
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
class AvwxApiClient:
    def __init__(self, api_key):
        self.auth = AvwxApiAuth(api_key)

    def get_station(
        self,
        ident: str,
        remove: str = None,
        filter: str = None,
        url_modifier: str = "station/",
    ) -> Station:
        """Get station information for an airfield or other location by ICAO ident.

        :param ident: ICAO & IATA station code
        :type ident: str
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include these keys in the response, defaults to None
        :type filter: str, optional
        :return: Info for requested ``ident``
        :rtype: Station
        """
        args = locals()
        url = url_builder(
            url_modifier=url_modifier,
            base_url=BASE_URL,
            main_payload=args["ident"],
            args=args,
        )

        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True)
        return Station(**r[1])

    def get_near_stations(
        self,
        coords: str,
        n: int = None,
        airport: bool = True,
        remove: str = None,
        filter: str = None,
        url_modifier: str = "station/near/",
    ) -> list[NearStation]:
        """Get the nearest stations to a coordinate pair.

        :param coords: Coordinate pair Example: 28.1,-81.
        :type coords: str
        :param n: Number of stations to return, defaults to 10
        :type n: int, optional
        :param airport: Only include airports, defaults to True
        :type airport: bool, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include these keys in the response, defaults to None
        :type filter: str, optional
        :return: Nearest Stations
        :rtype: list[NearStation]
        """
        args = locals()
        url = url_builder(
            url_modifier=url_modifier,
            base_url=BASE_URL,
            main_payload=args["coords"],
            args=args,
        )

        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True)

        station_list = []
        for station in r[1]:
            station_list.append(NearStation(**station))
        return station_list

    def get_stations_text(
        self,
        text: str,
        n: int = None,
        remove: str = None,
        filter: str = None,
        url_modifier: str = "search/station",
    ) -> list[Station]:
        """Text search for stations by ICAO, IATA, name, city, and state

        :param text: Search text
        :type text: str
        :param n: Max results to return, defaults to ``10``
        :type n: int, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :return: Stations that match the requested ``text``
        :rtype: list[Station]
        """
        args = locals()
        url = url_builder(
            url_modifier=url_modifier,
            base_url=BASE_URL,
            main_payload="",
            args=args,
        )
        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True)

        station_list = []
        for station in r[1]:
            station_list.append(Station(**station))
        return station_list

    def get_stations_route(
        self,
        route: str,
        distance: int,
        remove: str = None,
        filter: str = None,
        url_modifier: str = "path/station",
    ) -> StationRoute:
        """Get reporting stations along a flight path.

        :param route: Flight route with ICAO, navaid, and coordinate, separated by a ``;``
        :type route: str
        :param distance: Distance in nautical miles from ``route` centerline
        :type distance: int
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :return: Stations around the given ``route``
        :rtype: StationRoute
        """
        args = locals()
        url = url_builder(
            url_modifier=url_modifier,
            base_url=BASE_URL,
            main_payload="",
            args=args,
        )
        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True)

        return StationRoute(**r[1])

    def get_summary(
        self,
        location: str,
        options: str = None,
        remove: str = None,
        filter: str = None,
        onfail: str = None,
        url_modifier: str = "summary/",
    ) -> Summary:
        """Get the current and forecasted flight conditions for a specific station by ICAO & IATA station code or a coordinate pair.

        :param location: ICAO & IATA station code or coordinate pair.
        :type location: str
        :param options: Additional options to include, defaults to None
        :type options: str, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to None
        :type onfail: str, optional
        :return: Summary for the requested ``ident``
        :rtype: Summary
        """
        args = locals()
        url = url_builder(
            url_modifier=url_modifier,
            base_url=BASE_URL,
            main_payload=location,
            args=args,
        )
        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True)
        return Summary(**r[1])

    def get_metar(
        self,
        location: str,
        options: str = None,
        airport: bool = True,
        reporting: bool = True,
        remove: str = None,
        filter: str = None,
        onfail: str = None,
        url_modifier: str = "metar/",
    ) -> Metar:
        """Get a METAR report for an airfield or other location by ICAO, IATA ident or coordinates.

        :param location: ICAO & IATA station code or coordinate pair.
        :type location: str
        :param options: Additional options to include, defaults to None
        :type options: str, optional
        :param airport: Only include airports, defaults to True
        :type airport: bool, optional
        :param reporting: Only include reporting stations when performing a coordinate search, defaults to True
        :type reporting: bool, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to None
        :type onfail: str, optional
        :return: Metar for the requested ``ident``
        :rtype: Metar
        """
        args = locals()
        url = url_builder(
            url_modifier=url_modifier,
            base_url=BASE_URL,
            main_payload=location,
            args=args,
        )

        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True)
        return Metar(**r[1])

    def parse_metar(
        self,
        metar: str,
        options: str = None,
        remove: str = None,
        filter: str = None,
        url_modifier: str = "parse/metar",
    ) -> Metar:
        """Parse a METAR report

        :param metar: METAR report to parse
        :type metar: str
        :param options: Additional options to include, defaults to None
        :type options: str, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :return: Parsed Metar for the given ``metar``
        :rtype: Metar
        """
        args = locals()
        url = url_builder(
            url_modifier=url_modifier,
            base_url=BASE_URL,
            main_payload=metar,
            include_main=False,
            args=args,
        )
        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True, data=metar, method="POST")
        return Metar(**r[1])

    def get_multiple_reports(
        self,
        report_type: str,
        locations: str,
        options: str = None,
        remove: str = None,
        filter: str = None,
        onfail: str = None,
        url_modifier: str = "multi/",
    ) -> Metar | Taf | Summary:
        """Get for multiple stations a given report type

        :param report_type: Weather report type (``summary``,``metar``,``taf``)
        :type report_type: str
        :param locations: Comma-separated string of up to 10 ICAO & IATA station codes
        :type locations: str
        :param options: Additional options to include, defaults to None
        :type options: str, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to None
        :type onfail: str, optional
        :return: Summary for the requested ``ident``
        :rtype: Metar | Taf | Summary
        """
        args = locals()
        url = url_builder(
            url_modifier=f"{url_modifier}{report_type}/",
            base_url=BASE_URL,
            main_payload=locations,
            args=args,
        )
        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True)
        match report_type:
            case "metar":
                return Metar(**r[1])
            case "taf":
                return Taf(**r[1])
            case "summary":
                return Summary(**r[1])

    def get_nearest_reports(
        self,
        report_type: str,
        coords: str,
        n: int = None,
        options: str = None,
        airport: bool = True,
        remove: str = None,
        filter: str = None,
        onfail: str = None,
        url_modifier: str = "near/",
    ) -> Metar | Taf:
        """Get the nearest weather reports to a coordinate pair

        :param report_type: Weather report type (``metar``,``taf``)
        :type report_type: str
        :param coords: Coordinate pair Example: 28.1,-81.
        :type coords: str
        :param n: Max results to return, defaults to ``10``
        :type n: int, optional
        :param options: Additional options to include, defaults to None
        :type options: str, optional
        :param airport: Only include airports, defaults to True
        :type airport: bool, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to None
        :type onfail: str, optional
        :return: Returns ``Metar`` or ``Taf`` depending on the chosen report type
        :rtype: Metar | Taf
        """
        args = locals()
        url = url_builder(
            url_modifier=f"{report_type}/{url_modifier}",
            base_url=BASE_URL,
            main_payload=coords,
            args=args,
        )
        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True)
        match report_type:
            case "metar":
                return Metar(**r[1])
            case "taf":
                return Taf(**r[1])

    def get_reports_text(
        self,
        report_type: str,
        text: str,
        n: int = None,
        options: str = None,
        remove: str = None,
        filter: str = None,
        url_modifier: str = "search/",
    ) -> list[Metar] | list[Taf]:
        """Get weather reports by searching for stations by ICAO, IATA, name, city, and state.

        :param report_type: Weather report type (``metar``,``taf``)
        :type report_type: str
        :param text: Search text
        :type text: str
        :param n: Max results to return, defaults to ``10``
        :type n: int, optional
        :param options: Additional options to include, defaults to None
        :type options: str, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :return: Returns a list of ``Metar`` or ``Taf`` depending on the chosen report type
        :rtype: list[Metar] | list[Taf]
        """
        args = locals()
        url = url_builder(
            url_modifier=f"{url_modifier}",
            base_url=BASE_URL,
            main_payload=report_type,
            args=args,
        )
        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True)

        report_list = []
        match report_type:
            case "metar":
                for metar in r[1]:
                    report_list.append(Metar(**metar))
            case "taf":
                for taf in r[1]:
                    report_list.append(Taf(**taf))
        return report_list

    def get_reports_route(
        self,
        report_type: str,
        route: str,
        distance: int,
        options: str = None,
        remove: str = None,
        filter: str = None,
        onfail: str = None,
        url_modifier: str = "path/",
    ) -> ReportsRoute:
        """Get weather reports along a flight path.

        :param report_type: Weather report type (``metar``,``taf``,``airsigmet``,``notam``)
        :type report_type: str
        :param route: Flight route with ICAO, navaid, and coordinate, separated by a ``;``
        :type route: str
        :param distance: Distance in nautical miles from ``route`` centerline
        :type distance: int
        :param options: Additional options to include, defaults to None
        :type options: str, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to None
        :type onfail: str, optional
        :return: Returns a ReportsRoute containing route info and list of report in the chosen type.
        :rtype: ReportsRoute
        """
        args = locals()
        url = url_builder(
            url_modifier=f"{url_modifier}",
            base_url=BASE_URL,
            main_payload=report_type,
            args=args,
        )
        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True)
        return ReportsRoute(**r[1])

    def get_taf(
        self,
        location: str,
        options: str = None,
        airport: bool = True,
        reporting: bool = True,
        remove: str = None,
        filter: str = None,
        onfail: str = None,
        url_modifier: str = "taf/",
    ) -> Taf:
        """Get the TAF for a specific station by ICAO & IATA station code or a coordinate pair.

        :param location: ICAO & IATA station code or coordinate pair.
        :type location: str
        :param options: Additional options to include, defaults to None
        :type options: str, optional
        :param airport: Only include airports, defaults to True
        :type airport: bool, optional
        :param reporting: Only include reporting stations when performing a coordinate search, defaults to True
        :type reporting: bool, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to None
        :type onfail: str, optional
        :return: Returns a ``Taf`` object containing the requested TAF report.
        :rtype: Taf
        """
        args = locals()
        url = url_builder(
            url_modifier=url_modifier,
            base_url=BASE_URL,
            main_payload=location,
            args=args,
        )
        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True)
        return Taf(**r[1])

    def parse_taf(
        self,
        taf: str,
        options: str = None,
        remove: str = None,
        filter: str = None,
        url_modifier: str = "parse/taf",
    ) -> Taf:
        """Parse a TAF report

        :param taf: TAF report to parse
        :type taf: str, optional
        :param options: Additional options to include, defaults to None
        :type options: str, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :return: Returns a ``Taf`` object containing the parsed report
        :rtype: Taf
        """
        args = locals()
        url = url_builder(
            url_modifier=url_modifier,
            base_url=BASE_URL,
            main_payload=taf,
            include_main=False,
            args=args,
        )
        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True, data=taf, method="POST")
        return Taf(**r[1])

    def get_pirep(
        self,
        location: str,
        options: str = None,
        remove: str = None,
        filter: str = None,
        onfail: str = None,
        url_modifier: str = "pirep/",
    ) -> Pirep:
        """Get PIREPs within 200 miles of a specific station by ICAO & IATA station code or coordinate pair.

        :param location: ICAO & IATA station code or coordinate pair.
        :type location: str
        :param options: Additional options to include, defaults to None
        :type options: str, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to None
        :type onfail: str, optional
        :return: Returns a ``Pirep`` object containing the requested Pirep
        :rtype: Pirep
        """
        args = locals()
        url = url_builder(
            url_modifier=url_modifier,
            base_url=BASE_URL,
            main_payload=location,
            args=args,
        )

        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True)
        return Pirep(**r[1])

    def parse_pirep(
        self,
        pirep: str,
        options: str = None,
        remove: str = None,
        filter: str = None,
        url_modifier: str = "parse/pirep",
    ) -> Pirep:
        """Parse a Pirep

        :param pirep: Pirep to parse
        :type pirep: str, optional
        :param options: Additional options to include, defaults to None
        :type options: str, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :return: Returns a ``Pirep`` object containing the parsed Pirep.
        :rtype: Pirep
        """
        args = locals()
        url = url_builder(
            url_modifier=url_modifier,
            base_url=BASE_URL,
            main_payload=pirep,
            include_main=False,
            args=args,
        )
        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True, data=pirep, method="POST")
        return Pirep(**r[1])

    def get_airsigmet(
        self,
        remove: str = None,
        filter: str = None,
        onfail: str = None,
        url_modifier: str = "airsigmet",
    ) -> AirSigmet:
        """Get all global AIRMET and SIGMET advisories.

        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to None
        :type onfail: str, optional
        :return: Returns a ``AirSigmet`` object containing the requested Air Sigmet.
        :rtype: AirSigmet
        """
        args = locals()
        url = url_builder(
            url_modifier=url_modifier,
            base_url=BASE_URL,
            main_payload="",
            args=args,
        )

        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True)
        return AirSigmet(**r[1])

    def parse_airsigmet(
        self,
        airsigmet: str,
        options: str = None,
        remove: str = None,
        filter: str = None,
        url_modifier: str = "parse/airsigmet",
    ) -> AirSigmet:
        """Parse an Air Sigmet

        :param airsigmet: Air Sigmet to parse.
        :type airsigmet: str, optional
        :param options: Additional options to include, defaults to None
        :type options: str, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :return: Returns a ``AirSigmet`` object containing the parsed Air Sigmet
        :rtype: AirSigmet
        """
        args = locals()
        url = url_builder(
            url_modifier=url_modifier,
            base_url=BASE_URL,
            main_payload=airsigmet,
            include_main=False,
            args=args,
        )
        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(
            url=url, auth=self.auth, rjson=True, data=airsigmet, method="POST"
        )
        return AirSigmet(**r[1])

    def get_notam(
        self,
        location: str,
        distance: int = None,
        remove: str = None,
        filter: str = None,
        onfail: str = "cache",
        url_modifier: str = "notam/",
    ) -> Notam:
        """Get NOTAMs that apply to a specific airport or within a specified distance of a coordinate.

        :param location: ICAO & IATA station code or coordinate pair.
        :type location: str
        :param distance: Distance in nautical miles from ``route`` centerline, defaults to None
        :type distance: int, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to "cache"
        :type onfail: str, optional
        :return: Returns a ``Notam`` object containing the requested Notam.
        :rtype: Notam
        """
        args = locals()
        url = url_builder(
            url_modifier=url_modifier,
            base_url=BASE_URL,
            main_payload=location,
            args=args,
        )

        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True)
        return Notam(**r[1])

    def parse_notam(
        self,
        notam: str,
        remove: str = None,
        filter: str = None,
        url_modifier: str = "parse/notam",
    ) -> Notam:
        """Parse a Notice to Airmen (NOTAM)

        :param notam: Notam to parse.
        :type notam: str
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :return: Returns a ``Notam`` object containing the parsed Notam.
        :rtype: Notam
        """
        args = locals()
        url = url_builder(
            url_modifier=url_modifier,
            base_url=BASE_URL,
            main_payload=notam,
            include_main=False,
            args=args,
        )
        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True, data=notam, method="POST")
        return Notam(**r[1])

    def get_nbm(
        self,
        report: str,
        location: str,
        options: str = None,
        airport: bool = True,
        reporting: bool = True,
        remove: str = None,
        filter: str = None,
        onfail: str = "cache",
        url_modifier: str = "nbm/",
    ) -> Nbm:
        """Get the NBM NBS report for a specific station by ICAO & IATA station code or a lat,lon coordinate pair

        :param report: NBM report type. Supported: (``nbh``, ``nbs``, ``nbe``)
        :type report: str
        :param location: ICAO & IATA station code or coordinate pair.
        :type location: str
        :param options: Additional options to include, defaults to None
        :type options: str, optional
        :param airport: Only include airports, defaults to True
        :type airport: bool, optional
        :param reporting: Only include reporting stations when performing a coordinate search, defaults to True
        :type reporting: bool, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to "cache"
        :type onfail: str, optional
        :return: Returns a ``Nbm`` object containing the requested NBM report.
        :rtype: Nbm
        """
        args = locals()
        url = url_builder(
            url_modifier=f"{url_modifier}{report}/",
            base_url=BASE_URL,
            main_payload=location,
            args=args,
        )
        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True)
        return Nbm(**r[1])

    def parse_nbm(
        self,
        nbm: str,
        report: str,
        options: str = None,
        remove: str = None,
        filter: str = None,
        url_modifier: str = "parse/nbm",
    ) -> Nbm:
        """Parse an NBM/NBS report

        :param nbm: NBM report to parse.
        :type nbm: str
        :param report: NBM report type. Supported: (``nbh``, ``nbs``, ``nbe``)
        :type report: str
        :param options: Additional options to include, defaults to None
        :type options: str, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :return: Returns a ``Nbm`` object containing the parsed Nbm report.
        :rtype: Nbm
        """
        args = locals()
        url = url_builder(
            url_modifier=url_modifier,
            base_url=BASE_URL,
            main_payload=report,
            include_main=True,
            args=args,
        )
        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True, data=nbm, method="POST")
        return Nbm(**r[1])

    def get_gfs(
        self,
        report: str,
        location: str,
        options: str = None,
        airport: bool = True,
        reporting: bool = True,
        remove: str = None,
        filter: str = None,
        onfail: str = "cache",
        url_modifier: str = "gfs/",
    ) -> Gfs:
        """Get the GFS MAV report for a specific station by ICAO & IATA station code or a coordinate pair.

        :param report: GFS report type. Supported: (``mav``, ``mex``)
        :type report: str
        :param location: ICAO & IATA station code or coordinate pair.
        :type location: str
        :param options: Additional options to include, defaults to None
        :type options: str, optional
        :param airport: Only include airports, defaults to True
        :type airport: bool, optional
        :param reporting: Only include reporting stations when performing a coordinate search, defaults to True
        :type reporting: bool, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to "cache"
        :type onfail: str, optional
        :return: Returns a ``Gfs`` object containing the requested GFS report.
        :rtype: Gfs
        """
        args = locals()
        url = url_builder(
            url_modifier=f"{url_modifier}{report}/",
            base_url=BASE_URL,
            main_payload=location,
            args=args,
        )
        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True)
        return Gfs(**r[1])

    def parse_gfs(
        self,
        gfs: str,
        report: str,
        options: str = None,
        remove: str = None,
        filter: str = None,
        url_modifier: str = "parse/gfs",
    ) -> Gfs:
        """Parse a GFS MAV Report

        :param gfs: GFS report to parse.
        :type gfs: str
        :param report: GFS report type. Supported: (``mav``, ``mex``)
        :type report: str
        :param options: Additional options to include, defaults to None
        :type options: str, optional
        :param remove: Remove unused keys from the response, defaults to None
        :type remove: str, optional
        :param filter: Only include the selected keys in the response, defaults to None
        :type filter: str, optional
        :return: Returns a ``Gfs`` object containing the parsed GFS report.
        :rtype: Gfs
        """
        args = locals()
        url = url_builder(
            url_modifier=url_modifier,
            base_url=BASE_URL,
            main_payload=report,
            include_main=True,
            args=args,
        )
        # We Make the request, evaluate the status code
        # And then cast the json response to the Metar Object.
        r = makeRequest(url=url, auth=self.auth, rjson=True, data=gfs, method="POST")
        return Gfs(**r[1])

get_airsigmet(remove=None, filter=None, onfail=None, url_modifier='airsigmet')

Get all global AIRMET and SIGMET advisories.

Parameters:

Name Type Description Default
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None
onfail str

use out-of-date cache, or check nearest station when unable to fetch report, defaults to None

None

Returns:

Type Description
AirSigmet

Returns a AirSigmet object containing the requested Air Sigmet.

Source code in pyavwx/avwx_client.py
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
def get_airsigmet(
    self,
    remove: str = None,
    filter: str = None,
    onfail: str = None,
    url_modifier: str = "airsigmet",
) -> AirSigmet:
    """Get all global AIRMET and SIGMET advisories.

    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to None
    :type onfail: str, optional
    :return: Returns a ``AirSigmet`` object containing the requested Air Sigmet.
    :rtype: AirSigmet
    """
    args = locals()
    url = url_builder(
        url_modifier=url_modifier,
        base_url=BASE_URL,
        main_payload="",
        args=args,
    )

    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True)
    return AirSigmet(**r[1])

get_gfs(report, location, options=None, airport=True, reporting=True, remove=None, filter=None, onfail='cache', url_modifier='gfs/')

Get the GFS MAV report for a specific station by ICAO & IATA station code or a coordinate pair.

Parameters:

Name Type Description Default
report str

GFS report type. Supported: (mav, mex)

required
location str

ICAO & IATA station code or coordinate pair.

required
options str

Additional options to include, defaults to None

None
airport bool

Only include airports, defaults to True

True
reporting bool

Only include reporting stations when performing a coordinate search, defaults to True

True
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None
onfail str

use out-of-date cache, or check nearest station when unable to fetch report, defaults to "cache"

'cache'

Returns:

Type Description
Gfs

Returns a Gfs object containing the requested GFS report.

Source code in pyavwx/avwx_client.py
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
def get_gfs(
    self,
    report: str,
    location: str,
    options: str = None,
    airport: bool = True,
    reporting: bool = True,
    remove: str = None,
    filter: str = None,
    onfail: str = "cache",
    url_modifier: str = "gfs/",
) -> Gfs:
    """Get the GFS MAV report for a specific station by ICAO & IATA station code or a coordinate pair.

    :param report: GFS report type. Supported: (``mav``, ``mex``)
    :type report: str
    :param location: ICAO & IATA station code or coordinate pair.
    :type location: str
    :param options: Additional options to include, defaults to None
    :type options: str, optional
    :param airport: Only include airports, defaults to True
    :type airport: bool, optional
    :param reporting: Only include reporting stations when performing a coordinate search, defaults to True
    :type reporting: bool, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to "cache"
    :type onfail: str, optional
    :return: Returns a ``Gfs`` object containing the requested GFS report.
    :rtype: Gfs
    """
    args = locals()
    url = url_builder(
        url_modifier=f"{url_modifier}{report}/",
        base_url=BASE_URL,
        main_payload=location,
        args=args,
    )
    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True)
    return Gfs(**r[1])

get_metar(location, options=None, airport=True, reporting=True, remove=None, filter=None, onfail=None, url_modifier='metar/')

Get a METAR report for an airfield or other location by ICAO, IATA ident or coordinates.

Parameters:

Name Type Description Default
location str

ICAO & IATA station code or coordinate pair.

required
options str

Additional options to include, defaults to None

None
airport bool

Only include airports, defaults to True

True
reporting bool

Only include reporting stations when performing a coordinate search, defaults to True

True
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None
onfail str

use out-of-date cache, or check nearest station when unable to fetch report, defaults to None

None

Returns:

Type Description
Metar

Metar for the requested ident

Source code in pyavwx/avwx_client.py
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
def get_metar(
    self,
    location: str,
    options: str = None,
    airport: bool = True,
    reporting: bool = True,
    remove: str = None,
    filter: str = None,
    onfail: str = None,
    url_modifier: str = "metar/",
) -> Metar:
    """Get a METAR report for an airfield or other location by ICAO, IATA ident or coordinates.

    :param location: ICAO & IATA station code or coordinate pair.
    :type location: str
    :param options: Additional options to include, defaults to None
    :type options: str, optional
    :param airport: Only include airports, defaults to True
    :type airport: bool, optional
    :param reporting: Only include reporting stations when performing a coordinate search, defaults to True
    :type reporting: bool, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to None
    :type onfail: str, optional
    :return: Metar for the requested ``ident``
    :rtype: Metar
    """
    args = locals()
    url = url_builder(
        url_modifier=url_modifier,
        base_url=BASE_URL,
        main_payload=location,
        args=args,
    )

    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True)
    return Metar(**r[1])

get_multiple_reports(report_type, locations, options=None, remove=None, filter=None, onfail=None, url_modifier='multi/')

Get for multiple stations a given report type

Parameters:

Name Type Description Default
report_type str

Weather report type (summary,metar,taf)

required
locations str

Comma-separated string of up to 10 ICAO & IATA station codes

required
options str

Additional options to include, defaults to None

None
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None
onfail str

use out-of-date cache, or check nearest station when unable to fetch report, defaults to None

None

Returns:

Type Description
Metar | Taf | Summary

Summary for the requested ident

Source code in pyavwx/avwx_client.py
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
def get_multiple_reports(
    self,
    report_type: str,
    locations: str,
    options: str = None,
    remove: str = None,
    filter: str = None,
    onfail: str = None,
    url_modifier: str = "multi/",
) -> Metar | Taf | Summary:
    """Get for multiple stations a given report type

    :param report_type: Weather report type (``summary``,``metar``,``taf``)
    :type report_type: str
    :param locations: Comma-separated string of up to 10 ICAO & IATA station codes
    :type locations: str
    :param options: Additional options to include, defaults to None
    :type options: str, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to None
    :type onfail: str, optional
    :return: Summary for the requested ``ident``
    :rtype: Metar | Taf | Summary
    """
    args = locals()
    url = url_builder(
        url_modifier=f"{url_modifier}{report_type}/",
        base_url=BASE_URL,
        main_payload=locations,
        args=args,
    )
    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True)
    match report_type:
        case "metar":
            return Metar(**r[1])
        case "taf":
            return Taf(**r[1])
        case "summary":
            return Summary(**r[1])

get_nbm(report, location, options=None, airport=True, reporting=True, remove=None, filter=None, onfail='cache', url_modifier='nbm/')

Get the NBM NBS report for a specific station by ICAO & IATA station code or a lat,lon coordinate pair

Parameters:

Name Type Description Default
report str

NBM report type. Supported: (nbh, nbs, nbe)

required
location str

ICAO & IATA station code or coordinate pair.

required
options str

Additional options to include, defaults to None

None
airport bool

Only include airports, defaults to True

True
reporting bool

Only include reporting stations when performing a coordinate search, defaults to True

True
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None
onfail str

use out-of-date cache, or check nearest station when unable to fetch report, defaults to "cache"

'cache'

Returns:

Type Description
Nbm

Returns a Nbm object containing the requested NBM report.

Source code in pyavwx/avwx_client.py
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
def get_nbm(
    self,
    report: str,
    location: str,
    options: str = None,
    airport: bool = True,
    reporting: bool = True,
    remove: str = None,
    filter: str = None,
    onfail: str = "cache",
    url_modifier: str = "nbm/",
) -> Nbm:
    """Get the NBM NBS report for a specific station by ICAO & IATA station code or a lat,lon coordinate pair

    :param report: NBM report type. Supported: (``nbh``, ``nbs``, ``nbe``)
    :type report: str
    :param location: ICAO & IATA station code or coordinate pair.
    :type location: str
    :param options: Additional options to include, defaults to None
    :type options: str, optional
    :param airport: Only include airports, defaults to True
    :type airport: bool, optional
    :param reporting: Only include reporting stations when performing a coordinate search, defaults to True
    :type reporting: bool, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to "cache"
    :type onfail: str, optional
    :return: Returns a ``Nbm`` object containing the requested NBM report.
    :rtype: Nbm
    """
    args = locals()
    url = url_builder(
        url_modifier=f"{url_modifier}{report}/",
        base_url=BASE_URL,
        main_payload=location,
        args=args,
    )
    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True)
    return Nbm(**r[1])

get_near_stations(coords, n=None, airport=True, remove=None, filter=None, url_modifier='station/near/')

Get the nearest stations to a coordinate pair.

Parameters:

Name Type Description Default
coords str

Coordinate pair Example: 28.1,-81.

required
n int

Number of stations to return, defaults to 10

None
airport bool

Only include airports, defaults to True

True
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include these keys in the response, defaults to None

None

Returns:

Type Description
list[NearStation]

Nearest Stations

Source code in pyavwx/avwx_client.py
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
def get_near_stations(
    self,
    coords: str,
    n: int = None,
    airport: bool = True,
    remove: str = None,
    filter: str = None,
    url_modifier: str = "station/near/",
) -> list[NearStation]:
    """Get the nearest stations to a coordinate pair.

    :param coords: Coordinate pair Example: 28.1,-81.
    :type coords: str
    :param n: Number of stations to return, defaults to 10
    :type n: int, optional
    :param airport: Only include airports, defaults to True
    :type airport: bool, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include these keys in the response, defaults to None
    :type filter: str, optional
    :return: Nearest Stations
    :rtype: list[NearStation]
    """
    args = locals()
    url = url_builder(
        url_modifier=url_modifier,
        base_url=BASE_URL,
        main_payload=args["coords"],
        args=args,
    )

    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True)

    station_list = []
    for station in r[1]:
        station_list.append(NearStation(**station))
    return station_list

get_nearest_reports(report_type, coords, n=None, options=None, airport=True, remove=None, filter=None, onfail=None, url_modifier='near/')

Get the nearest weather reports to a coordinate pair

Parameters:

Name Type Description Default
report_type str

Weather report type (metar,taf)

required
coords str

Coordinate pair Example: 28.1,-81.

required
n int

Max results to return, defaults to 10

None
options str

Additional options to include, defaults to None

None
airport bool

Only include airports, defaults to True

True
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None
onfail str

use out-of-date cache, or check nearest station when unable to fetch report, defaults to None

None

Returns:

Type Description
Metar | Taf

Returns Metar or Taf depending on the chosen report type

Source code in pyavwx/avwx_client.py
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
def get_nearest_reports(
    self,
    report_type: str,
    coords: str,
    n: int = None,
    options: str = None,
    airport: bool = True,
    remove: str = None,
    filter: str = None,
    onfail: str = None,
    url_modifier: str = "near/",
) -> Metar | Taf:
    """Get the nearest weather reports to a coordinate pair

    :param report_type: Weather report type (``metar``,``taf``)
    :type report_type: str
    :param coords: Coordinate pair Example: 28.1,-81.
    :type coords: str
    :param n: Max results to return, defaults to ``10``
    :type n: int, optional
    :param options: Additional options to include, defaults to None
    :type options: str, optional
    :param airport: Only include airports, defaults to True
    :type airport: bool, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to None
    :type onfail: str, optional
    :return: Returns ``Metar`` or ``Taf`` depending on the chosen report type
    :rtype: Metar | Taf
    """
    args = locals()
    url = url_builder(
        url_modifier=f"{report_type}/{url_modifier}",
        base_url=BASE_URL,
        main_payload=coords,
        args=args,
    )
    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True)
    match report_type:
        case "metar":
            return Metar(**r[1])
        case "taf":
            return Taf(**r[1])

get_notam(location, distance=None, remove=None, filter=None, onfail='cache', url_modifier='notam/')

Get NOTAMs that apply to a specific airport or within a specified distance of a coordinate.

Parameters:

Name Type Description Default
location str

ICAO & IATA station code or coordinate pair.

required
distance int

Distance in nautical miles from route centerline, defaults to None

None
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None
onfail str

use out-of-date cache, or check nearest station when unable to fetch report, defaults to "cache"

'cache'

Returns:

Type Description
Notam

Returns a Notam object containing the requested Notam.

Source code in pyavwx/avwx_client.py
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
def get_notam(
    self,
    location: str,
    distance: int = None,
    remove: str = None,
    filter: str = None,
    onfail: str = "cache",
    url_modifier: str = "notam/",
) -> Notam:
    """Get NOTAMs that apply to a specific airport or within a specified distance of a coordinate.

    :param location: ICAO & IATA station code or coordinate pair.
    :type location: str
    :param distance: Distance in nautical miles from ``route`` centerline, defaults to None
    :type distance: int, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to "cache"
    :type onfail: str, optional
    :return: Returns a ``Notam`` object containing the requested Notam.
    :rtype: Notam
    """
    args = locals()
    url = url_builder(
        url_modifier=url_modifier,
        base_url=BASE_URL,
        main_payload=location,
        args=args,
    )

    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True)
    return Notam(**r[1])

get_pirep(location, options=None, remove=None, filter=None, onfail=None, url_modifier='pirep/')

Get PIREPs within 200 miles of a specific station by ICAO & IATA station code or coordinate pair.

Parameters:

Name Type Description Default
location str

ICAO & IATA station code or coordinate pair.

required
options str

Additional options to include, defaults to None

None
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None
onfail str

use out-of-date cache, or check nearest station when unable to fetch report, defaults to None

None

Returns:

Type Description
Pirep

Returns a Pirep object containing the requested Pirep

Source code in pyavwx/avwx_client.py
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
def get_pirep(
    self,
    location: str,
    options: str = None,
    remove: str = None,
    filter: str = None,
    onfail: str = None,
    url_modifier: str = "pirep/",
) -> Pirep:
    """Get PIREPs within 200 miles of a specific station by ICAO & IATA station code or coordinate pair.

    :param location: ICAO & IATA station code or coordinate pair.
    :type location: str
    :param options: Additional options to include, defaults to None
    :type options: str, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to None
    :type onfail: str, optional
    :return: Returns a ``Pirep`` object containing the requested Pirep
    :rtype: Pirep
    """
    args = locals()
    url = url_builder(
        url_modifier=url_modifier,
        base_url=BASE_URL,
        main_payload=location,
        args=args,
    )

    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True)
    return Pirep(**r[1])

get_reports_route(report_type, route, distance, options=None, remove=None, filter=None, onfail=None, url_modifier='path/')

Get weather reports along a flight path.

Parameters:

Name Type Description Default
report_type str

Weather report type (metar,taf,airsigmet,notam)

required
route str

Flight route with ICAO, navaid, and coordinate, separated by a ;

required
distance int

Distance in nautical miles from route centerline

required
options str

Additional options to include, defaults to None

None
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None
onfail str

use out-of-date cache, or check nearest station when unable to fetch report, defaults to None

None

Returns:

Type Description
ReportsRoute

Returns a ReportsRoute containing route info and list of report in the chosen type.

Source code in pyavwx/avwx_client.py
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
def get_reports_route(
    self,
    report_type: str,
    route: str,
    distance: int,
    options: str = None,
    remove: str = None,
    filter: str = None,
    onfail: str = None,
    url_modifier: str = "path/",
) -> ReportsRoute:
    """Get weather reports along a flight path.

    :param report_type: Weather report type (``metar``,``taf``,``airsigmet``,``notam``)
    :type report_type: str
    :param route: Flight route with ICAO, navaid, and coordinate, separated by a ``;``
    :type route: str
    :param distance: Distance in nautical miles from ``route`` centerline
    :type distance: int
    :param options: Additional options to include, defaults to None
    :type options: str, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to None
    :type onfail: str, optional
    :return: Returns a ReportsRoute containing route info and list of report in the chosen type.
    :rtype: ReportsRoute
    """
    args = locals()
    url = url_builder(
        url_modifier=f"{url_modifier}",
        base_url=BASE_URL,
        main_payload=report_type,
        args=args,
    )
    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True)
    return ReportsRoute(**r[1])

get_reports_text(report_type, text, n=None, options=None, remove=None, filter=None, url_modifier='search/')

Get weather reports by searching for stations by ICAO, IATA, name, city, and state.

Parameters:

Name Type Description Default
report_type str

Weather report type (metar,taf)

required
text str

Search text

required
n int

Max results to return, defaults to 10

None
options str

Additional options to include, defaults to None

None
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None

Returns:

Type Description
list[Metar] | list[Taf]

Returns a list of Metar or Taf depending on the chosen report type

Source code in pyavwx/avwx_client.py
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
def get_reports_text(
    self,
    report_type: str,
    text: str,
    n: int = None,
    options: str = None,
    remove: str = None,
    filter: str = None,
    url_modifier: str = "search/",
) -> list[Metar] | list[Taf]:
    """Get weather reports by searching for stations by ICAO, IATA, name, city, and state.

    :param report_type: Weather report type (``metar``,``taf``)
    :type report_type: str
    :param text: Search text
    :type text: str
    :param n: Max results to return, defaults to ``10``
    :type n: int, optional
    :param options: Additional options to include, defaults to None
    :type options: str, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :return: Returns a list of ``Metar`` or ``Taf`` depending on the chosen report type
    :rtype: list[Metar] | list[Taf]
    """
    args = locals()
    url = url_builder(
        url_modifier=f"{url_modifier}",
        base_url=BASE_URL,
        main_payload=report_type,
        args=args,
    )
    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True)

    report_list = []
    match report_type:
        case "metar":
            for metar in r[1]:
                report_list.append(Metar(**metar))
        case "taf":
            for taf in r[1]:
                report_list.append(Taf(**taf))
    return report_list

get_station(ident, remove=None, filter=None, url_modifier='station/')

Get station information for an airfield or other location by ICAO ident.

Parameters:

Name Type Description Default
ident str

ICAO & IATA station code

required
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include these keys in the response, defaults to None

None

Returns:

Type Description
Station

Info for requested ident

Source code in pyavwx/avwx_client.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
def get_station(
    self,
    ident: str,
    remove: str = None,
    filter: str = None,
    url_modifier: str = "station/",
) -> Station:
    """Get station information for an airfield or other location by ICAO ident.

    :param ident: ICAO & IATA station code
    :type ident: str
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include these keys in the response, defaults to None
    :type filter: str, optional
    :return: Info for requested ``ident``
    :rtype: Station
    """
    args = locals()
    url = url_builder(
        url_modifier=url_modifier,
        base_url=BASE_URL,
        main_payload=args["ident"],
        args=args,
    )

    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True)
    return Station(**r[1])

get_stations_route(route, distance, remove=None, filter=None, url_modifier='path/station')

Get reporting stations along a flight path.

Parameters:

Name Type Description Default
route str

Flight route with ICAO, navaid, and coordinate, separated by a ;

required
distance int

Distance in nautical miles from `route centerline

required
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None

Returns:

Type Description
StationRoute

Stations around the given route

Source code in pyavwx/avwx_client.py
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
def get_stations_route(
    self,
    route: str,
    distance: int,
    remove: str = None,
    filter: str = None,
    url_modifier: str = "path/station",
) -> StationRoute:
    """Get reporting stations along a flight path.

    :param route: Flight route with ICAO, navaid, and coordinate, separated by a ``;``
    :type route: str
    :param distance: Distance in nautical miles from ``route` centerline
    :type distance: int
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :return: Stations around the given ``route``
    :rtype: StationRoute
    """
    args = locals()
    url = url_builder(
        url_modifier=url_modifier,
        base_url=BASE_URL,
        main_payload="",
        args=args,
    )
    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True)

    return StationRoute(**r[1])

get_stations_text(text, n=None, remove=None, filter=None, url_modifier='search/station')

Text search for stations by ICAO, IATA, name, city, and state

Parameters:

Name Type Description Default
text str

Search text

required
n int

Max results to return, defaults to 10

None
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None

Returns:

Type Description
list[Station]

Stations that match the requested text

Source code in pyavwx/avwx_client.py
 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
def get_stations_text(
    self,
    text: str,
    n: int = None,
    remove: str = None,
    filter: str = None,
    url_modifier: str = "search/station",
) -> list[Station]:
    """Text search for stations by ICAO, IATA, name, city, and state

    :param text: Search text
    :type text: str
    :param n: Max results to return, defaults to ``10``
    :type n: int, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :return: Stations that match the requested ``text``
    :rtype: list[Station]
    """
    args = locals()
    url = url_builder(
        url_modifier=url_modifier,
        base_url=BASE_URL,
        main_payload="",
        args=args,
    )
    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True)

    station_list = []
    for station in r[1]:
        station_list.append(Station(**station))
    return station_list

get_summary(location, options=None, remove=None, filter=None, onfail=None, url_modifier='summary/')

Get the current and forecasted flight conditions for a specific station by ICAO & IATA station code or a coordinate pair.

Parameters:

Name Type Description Default
location str

ICAO & IATA station code or coordinate pair.

required
options str

Additional options to include, defaults to None

None
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None
onfail str

use out-of-date cache, or check nearest station when unable to fetch report, defaults to None

None

Returns:

Type Description
Summary

Summary for the requested ident

Source code in pyavwx/avwx_client.py
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
def get_summary(
    self,
    location: str,
    options: str = None,
    remove: str = None,
    filter: str = None,
    onfail: str = None,
    url_modifier: str = "summary/",
) -> Summary:
    """Get the current and forecasted flight conditions for a specific station by ICAO & IATA station code or a coordinate pair.

    :param location: ICAO & IATA station code or coordinate pair.
    :type location: str
    :param options: Additional options to include, defaults to None
    :type options: str, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to None
    :type onfail: str, optional
    :return: Summary for the requested ``ident``
    :rtype: Summary
    """
    args = locals()
    url = url_builder(
        url_modifier=url_modifier,
        base_url=BASE_URL,
        main_payload=location,
        args=args,
    )
    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True)
    return Summary(**r[1])

get_taf(location, options=None, airport=True, reporting=True, remove=None, filter=None, onfail=None, url_modifier='taf/')

Get the TAF for a specific station by ICAO & IATA station code or a coordinate pair.

Parameters:

Name Type Description Default
location str

ICAO & IATA station code or coordinate pair.

required
options str

Additional options to include, defaults to None

None
airport bool

Only include airports, defaults to True

True
reporting bool

Only include reporting stations when performing a coordinate search, defaults to True

True
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None
onfail str

use out-of-date cache, or check nearest station when unable to fetch report, defaults to None

None

Returns:

Type Description
Taf

Returns a Taf object containing the requested TAF report.

Source code in pyavwx/avwx_client.py
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
def get_taf(
    self,
    location: str,
    options: str = None,
    airport: bool = True,
    reporting: bool = True,
    remove: str = None,
    filter: str = None,
    onfail: str = None,
    url_modifier: str = "taf/",
) -> Taf:
    """Get the TAF for a specific station by ICAO & IATA station code or a coordinate pair.

    :param location: ICAO & IATA station code or coordinate pair.
    :type location: str
    :param options: Additional options to include, defaults to None
    :type options: str, optional
    :param airport: Only include airports, defaults to True
    :type airport: bool, optional
    :param reporting: Only include reporting stations when performing a coordinate search, defaults to True
    :type reporting: bool, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :param onfail: use out-of-date cache, or check nearest station when unable to fetch report, defaults to None
    :type onfail: str, optional
    :return: Returns a ``Taf`` object containing the requested TAF report.
    :rtype: Taf
    """
    args = locals()
    url = url_builder(
        url_modifier=url_modifier,
        base_url=BASE_URL,
        main_payload=location,
        args=args,
    )
    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True)
    return Taf(**r[1])

parse_airsigmet(airsigmet, options=None, remove=None, filter=None, url_modifier='parse/airsigmet')

Parse an Air Sigmet

Parameters:

Name Type Description Default
airsigmet str

Air Sigmet to parse.

required
options str

Additional options to include, defaults to None

None
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None

Returns:

Type Description
AirSigmet

Returns a AirSigmet object containing the parsed Air Sigmet

Source code in pyavwx/avwx_client.py
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
def parse_airsigmet(
    self,
    airsigmet: str,
    options: str = None,
    remove: str = None,
    filter: str = None,
    url_modifier: str = "parse/airsigmet",
) -> AirSigmet:
    """Parse an Air Sigmet

    :param airsigmet: Air Sigmet to parse.
    :type airsigmet: str, optional
    :param options: Additional options to include, defaults to None
    :type options: str, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :return: Returns a ``AirSigmet`` object containing the parsed Air Sigmet
    :rtype: AirSigmet
    """
    args = locals()
    url = url_builder(
        url_modifier=url_modifier,
        base_url=BASE_URL,
        main_payload=airsigmet,
        include_main=False,
        args=args,
    )
    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(
        url=url, auth=self.auth, rjson=True, data=airsigmet, method="POST"
    )
    return AirSigmet(**r[1])

parse_gfs(gfs, report, options=None, remove=None, filter=None, url_modifier='parse/gfs')

Parse a GFS MAV Report

Parameters:

Name Type Description Default
gfs str

GFS report to parse.

required
report str

GFS report type. Supported: (mav, mex)

required
options str

Additional options to include, defaults to None

None
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None

Returns:

Type Description
Gfs

Returns a Gfs object containing the parsed GFS report.

Source code in pyavwx/avwx_client.py
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
def parse_gfs(
    self,
    gfs: str,
    report: str,
    options: str = None,
    remove: str = None,
    filter: str = None,
    url_modifier: str = "parse/gfs",
) -> Gfs:
    """Parse a GFS MAV Report

    :param gfs: GFS report to parse.
    :type gfs: str
    :param report: GFS report type. Supported: (``mav``, ``mex``)
    :type report: str
    :param options: Additional options to include, defaults to None
    :type options: str, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :return: Returns a ``Gfs`` object containing the parsed GFS report.
    :rtype: Gfs
    """
    args = locals()
    url = url_builder(
        url_modifier=url_modifier,
        base_url=BASE_URL,
        main_payload=report,
        include_main=True,
        args=args,
    )
    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True, data=gfs, method="POST")
    return Gfs(**r[1])

parse_metar(metar, options=None, remove=None, filter=None, url_modifier='parse/metar')

Parse a METAR report

Parameters:

Name Type Description Default
metar str

METAR report to parse

required
options str

Additional options to include, defaults to None

None
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None

Returns:

Type Description
Metar

Parsed Metar for the given metar

Source code in pyavwx/avwx_client.py
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
def parse_metar(
    self,
    metar: str,
    options: str = None,
    remove: str = None,
    filter: str = None,
    url_modifier: str = "parse/metar",
) -> Metar:
    """Parse a METAR report

    :param metar: METAR report to parse
    :type metar: str
    :param options: Additional options to include, defaults to None
    :type options: str, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :return: Parsed Metar for the given ``metar``
    :rtype: Metar
    """
    args = locals()
    url = url_builder(
        url_modifier=url_modifier,
        base_url=BASE_URL,
        main_payload=metar,
        include_main=False,
        args=args,
    )
    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True, data=metar, method="POST")
    return Metar(**r[1])

parse_nbm(nbm, report, options=None, remove=None, filter=None, url_modifier='parse/nbm')

Parse an NBM/NBS report

Parameters:

Name Type Description Default
nbm str

NBM report to parse.

required
report str

NBM report type. Supported: (nbh, nbs, nbe)

required
options str

Additional options to include, defaults to None

None
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None

Returns:

Type Description
Nbm

Returns a Nbm object containing the parsed Nbm report.

Source code in pyavwx/avwx_client.py
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
def parse_nbm(
    self,
    nbm: str,
    report: str,
    options: str = None,
    remove: str = None,
    filter: str = None,
    url_modifier: str = "parse/nbm",
) -> Nbm:
    """Parse an NBM/NBS report

    :param nbm: NBM report to parse.
    :type nbm: str
    :param report: NBM report type. Supported: (``nbh``, ``nbs``, ``nbe``)
    :type report: str
    :param options: Additional options to include, defaults to None
    :type options: str, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :return: Returns a ``Nbm`` object containing the parsed Nbm report.
    :rtype: Nbm
    """
    args = locals()
    url = url_builder(
        url_modifier=url_modifier,
        base_url=BASE_URL,
        main_payload=report,
        include_main=True,
        args=args,
    )
    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True, data=nbm, method="POST")
    return Nbm(**r[1])

parse_notam(notam, remove=None, filter=None, url_modifier='parse/notam')

Parse a Notice to Airmen (NOTAM)

Parameters:

Name Type Description Default
notam str

Notam to parse.

required
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None

Returns:

Type Description
Notam

Returns a Notam object containing the parsed Notam.

Source code in pyavwx/avwx_client.py
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
def parse_notam(
    self,
    notam: str,
    remove: str = None,
    filter: str = None,
    url_modifier: str = "parse/notam",
) -> Notam:
    """Parse a Notice to Airmen (NOTAM)

    :param notam: Notam to parse.
    :type notam: str
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :return: Returns a ``Notam`` object containing the parsed Notam.
    :rtype: Notam
    """
    args = locals()
    url = url_builder(
        url_modifier=url_modifier,
        base_url=BASE_URL,
        main_payload=notam,
        include_main=False,
        args=args,
    )
    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True, data=notam, method="POST")
    return Notam(**r[1])

parse_pirep(pirep, options=None, remove=None, filter=None, url_modifier='parse/pirep')

Parse a Pirep

Parameters:

Name Type Description Default
pirep str

Pirep to parse

required
options str

Additional options to include, defaults to None

None
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None

Returns:

Type Description
Pirep

Returns a Pirep object containing the parsed Pirep.

Source code in pyavwx/avwx_client.py
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
def parse_pirep(
    self,
    pirep: str,
    options: str = None,
    remove: str = None,
    filter: str = None,
    url_modifier: str = "parse/pirep",
) -> Pirep:
    """Parse a Pirep

    :param pirep: Pirep to parse
    :type pirep: str, optional
    :param options: Additional options to include, defaults to None
    :type options: str, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :return: Returns a ``Pirep`` object containing the parsed Pirep.
    :rtype: Pirep
    """
    args = locals()
    url = url_builder(
        url_modifier=url_modifier,
        base_url=BASE_URL,
        main_payload=pirep,
        include_main=False,
        args=args,
    )
    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True, data=pirep, method="POST")
    return Pirep(**r[1])

parse_taf(taf, options=None, remove=None, filter=None, url_modifier='parse/taf')

Parse a TAF report

Parameters:

Name Type Description Default
taf str

TAF report to parse

required
options str

Additional options to include, defaults to None

None
remove str

Remove unused keys from the response, defaults to None

None
filter str

Only include the selected keys in the response, defaults to None

None

Returns:

Type Description
Taf

Returns a Taf object containing the parsed report

Source code in pyavwx/avwx_client.py
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
def parse_taf(
    self,
    taf: str,
    options: str = None,
    remove: str = None,
    filter: str = None,
    url_modifier: str = "parse/taf",
) -> Taf:
    """Parse a TAF report

    :param taf: TAF report to parse
    :type taf: str, optional
    :param options: Additional options to include, defaults to None
    :type options: str, optional
    :param remove: Remove unused keys from the response, defaults to None
    :type remove: str, optional
    :param filter: Only include the selected keys in the response, defaults to None
    :type filter: str, optional
    :return: Returns a ``Taf`` object containing the parsed report
    :rtype: Taf
    """
    args = locals()
    url = url_builder(
        url_modifier=url_modifier,
        base_url=BASE_URL,
        main_payload=taf,
        include_main=False,
        args=args,
    )
    # We Make the request, evaluate the status code
    # And then cast the json response to the Metar Object.
    r = makeRequest(url=url, auth=self.auth, rjson=True, data=taf, method="POST")
    return Taf(**r[1])

Last update: November 15, 2023
Created: November 15, 2023