Skip to main content

FAA TFR Scraper

Project description

TFR-Scraper

Scrapes TFRs from FAA site https://tfr.faa.gov/ and details for each TFR.

Requirements

Functions

tfr_list() #Returns the basic list of TFRs
parse_tfr(notam_number) #Parses a notam number in full format like (1/8339) and will return the details of the tfr. 
get_list_and_parse_all() #Downloads TFR list and parses all combines details with list and returns it.
all(filepath) #Does get_list_and_parse_all() and saves as a json, filepath is optional default is ./detailed_tfrs.json

TFR/Shape types

  • TFRs have many types wether it be just a circle or a polygon or a TFR can have multiple circles/polygons, this scraper will parse each.
  • Below is an example of each and the type of shapes the parser will return in the shapes list for each when the details are parsed

Single Circle

!

            "shapes": [
                {
                    "type": "circle",
                    "radius": "5.0",
                    "lat": "40.74388889N",
                    "lon": "111.65527778W",
                    "up_to": "12500"
                }

Single Polygon

!

            "shapes": [
                {
                    "type": "poly",
                    "points": [
                        [
                            "46.59583333N",
                            "116.54111111W"
                        ],
                        [
                            "46.61666667N",
                            "116.47388889W"
                        ],
                        [
                            "46.55833333N",
                            "116.40638889W"
                        ],
                        [
                            "46.5125N",
                            "116.42416667W"
                        ],
                        [
                            "46.50055556N",
                            "116.53722222W"
                        ],
                        [
                            "46.51416667N",
                            "116.62916667W"
                        ]
                    ],
                    "up_to": "8500"

Multi Circle

!

            "shapes": [
                {
                    "type": "circle",
                    "radius": "10.0",
                    "lat": "39.64805556N",
                    "lon": "077.46666667W",
                    "up_to": "17999"
                },
                {
                    "type": "circle",
                    "radius": "5.0",
                    "lat": "39.64805556N",
                    "lon": "077.46666667W",
                    "up_to": "17999"
                }
            ]

TFR JSON objects

Single TFR object from list w/o details parsed

    {
        "Date": "08/13/2021",
        "NOTAM": "1/7932",
        "Facility": "ZSE",
        "State": "CA",
        "Type": "HAZARDS",
        "Description": "35NM SE YREKA, CA, Friday, August 13, 2021 through Sunday, September 05, 2021 UTC New",
        "Zoom": ""
    },

A detailed object when combined with info from list

    {
        "Date": "08/13/2021",
        "NOTAM": "1/7932",
        "Facility": "ZSE",
        "State": "CA",
        "Type": "HAZARDS",
        "Description": "35NM SE YREKA, CA, Friday, August 13, 2021 through Sunday, September 05, 2021 UTC New",
        "Zoom": "",
        "details": {
            "txtDescrPurpose": "TO PROVIDE A SAFE ENVIRONMENT FOR FIRE FIGHTING AVIATION OPS",
            "txtLocalName": "1/7932",
            "dateEffective": "2021-08-13T18:15:00",
            "dateExpire": "2021-09-05T05:00:00",
            "codeTimeZone": "UTC",
            "codeExpirationTimeZone": "UTC",
            "shapes": [
                {
                    "type": "poly",
                    "points": [
                        [
                            "41.4N",
                            "122.13333333W"
                        ],
                        [
                            "41.72083333N",
                            "121.94166667W"
                        ],
                        [
                            "41.625N",
                            "121.7W"
                        ],
                        [
                            "41.43333333N",
                            "121.78333333W"
                        ],
                        [
                            "41.4N",
                            "122.13333333W"
                        ]
                    ],
                    "up_to": "10500"
                }
            ]
        }
    }

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tfr_scraper-0.0.5.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tfr_scraper-0.0.5-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file tfr_scraper-0.0.5.tar.gz.

File metadata

  • Download URL: tfr_scraper-0.0.5.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for tfr_scraper-0.0.5.tar.gz
Algorithm Hash digest
SHA256 df9e65cd4caab6067788590f59dd9e0bef52b90e028bca8e441852f316ce57d2
MD5 e91cbe0317759bcc1fd51aa5a3fc6c99
BLAKE2b-256 6d8d8dc52388c3e7188f3ca05c0b8ed7bc206171a325458118f381b75f2316c5

See more details on using hashes here.

File details

Details for the file tfr_scraper-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: tfr_scraper-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for tfr_scraper-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bf3ec1d1f73000949743c3bafe22aa763f4f124555a4c8827162b3f33eddb9f1
MD5 33c777c88c1aa86b42c73e19285406d0
BLAKE2b-256 0c4afd78a39100b538c03631c848b9c20212daaae5496533dd70fde4e2008780

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page