Over the weekend, I published a Python package called xplane_airports. This serves two major use cases:

  1. Parsing the airport data (apt.dat) files used by X-Plane, and asking questions like “does <some airport> support <some feature>?”
  2. Nicely wrapping the X-Plane Scenery Gateway’s API to get information about the airports available there. This includes the ability to download scenery packs and manipulate them just like you would an apt.dat on disk.

If you’re doing any sort of automated analysis or manipulation of X-Plane airports, this should be a huge help.

It’s available via pip now:

$ pip install xplane_airports

And there’s a ton of documentation in the project’s README on GitHub.

Bug reports, feature requests, & pull requests are all welcome. 🙂

About Tyler Young

Tyler is a software developer for X-Plane. Among other projects, he was in charge of the new X-Plane 11 user interface.

20 comments on “New Python tools for working with airport data

    1. b3 has a nasty bug where whole airports disappear. We’re cutting b4 today with JUST fixes for that so we can get a build that is (1) steam ready and (2) not crap. So…we’re not there yet cuz of my bug, but we’re locking down the process to keep steam from slipping forever.

      1. b3 feels much smoother than any other version before on my system (i5-7300HQ, 1050ti, 16GB RAM).

        So, good work anyway, I definitely can live with some airports missing… ; )

        (You didn’t mention anything related to performance in the b3 fixes, so is it just placebo?)

      2. Complete airports disappearing… I just hope that you are not testing a new “pay per use” feature for airports 😉
        Following the license Model of Microsoft you could buy then:
        Joystick licenses,
        Axis licenses,
        Plane licenses,
        Scenery detail licenses,
        Frame rate licenses,
        Airport licenses,
        Real weather licenses,
        ATC licenses (once ATC really works),
        Settings licenses,
        Fuel licenses,

        Sorry, just a joke…

  1. One glaring error I see concerning a aircraft in X-Plane 11, you have the B-52 listed as a “B-52G”, it’s nose is a B-52G, but the actual aircraft your trying to recreate is the NB-52B, specifically the “Balls Eight” mothership for the X-15 rocket plane, HL-10, M2-F2/3, & X-24A, B, & C Lifting bodies all tested at Edwards during the 60’s and early 70’s, look for “Balls Eight” on the internet, you’ll see what I mean.

    1. That indeed is a glaring glaring error and I have deleted X-Plane from my hard drive for that! I brought out my old C64 with Sublogic´s FSII on it and will play that one instead until this is fixed (AND on steam, too). At least they got their aircraft right!

      Seriously?

      Oh, and expect some more bug reports from me on this comments – sections in the near future – real men don´t file on the X-Plane Bug Reporter (or ask for directions – ever!).

      Plus my framerates more than doubled for beta 3 (I do fly out of the Bermuda islands now instead of Chicago, but that has nothing to do with it, I think!)

      Oh, and back to the original subject of this post – I have no idea what that Python package is for or what pip actually is – but knowing Tyler´s work it is ingenious and will come in very handy at some point in time! Thanks!

      ;-)) Jan

  2. Let’s calm down guys..

    Regarding beta3 I only have one word “Stunning”

    Thanks to all at LR & keep up this leading edge development.

  3. What is the general intent or end state for this? Is this the beginnings of or could it eventually turn into a live airport update system that pulls Gateway scenery on demand?

    1. The primary target is people who are doing analysis or automated manipulation of airports. E.g., Markku Uttula built this awesome map visualization of all 35,000+ airports… complete with a rendering of the runways when you click on an individual airport. Someone who wanted to build something similar in Python could get quite a head start using this library.

      While it wasn’t my primary goal, it’s certainly the case that an ambitious user could use this to build an add-on that downloads you the latest copy of every airport, every day. (There are a few sharp edges to this—you’d need to make sure the scenery.ini de-prioritizes the Gateway airports, for instance. But it’s certainly possible.)

      (If you’re a third party dev interested in doing this, please give me a shout—I’d like to run some back-of-the-envelope calculations on your proposed design to make sure the server load won’t be too crazy.)

      1. I’m not a developer who could do that unfortunately so I’ll defer to much better folks. However the stretch goal of making a system work like that is intriguing. One of the few downsides of the Gateway is that updated scenery is only pushed with updates to X-Plane itself. My thought was that perhaps a system to query and pull updated airports automagically, maybe even built into XP11 itself, could someday be possible and thus make the Gateway a practically live scenery database (upon airport approvals by Julian of course).

        1. We too would like to see more frequent Gateway releases. It’s a little bit scary because it’s always possible that a new Gateway airport could introduce issues with the sim—for instance, I remember a particular scenery pack in the Portland area that would take upwards of 10 minutes to load in 10.50! And of course it’s always possible (albeit unlikely) that some airport could cause an outright crash.

          That’s part of the reason we’ve been making Gateway releases a part of the normal beta process. (The other reason, of course, is that doing so requires no new infrastructure on our end! 😀 ) Thus, any plan on our end to decouple Gateway releases from the betas would have to figure out how we handle problem airports.

          But yeah, it’s definitely a long-term goal of ours to push Gateway airports more frequently!

          1. Gateway airports need to be approved before they are “released for inclusion in the next release”, so this should be enough to have it whitelisted to be “automagically” updated in the sim.

            Maybe the process to get an approval would need to expanded with more checks to make sure it would not crash everyone’s sim worldwide, but I’m guessing this approval should be enough… no?

  4. pip install x-plane_airports
    Collecting x-plane_airports
    Could not find a version that satisfies the requirement x-plane_airports (from versions: )
    No matching distribution found for x-plane_airports

    1. Ah, remove the hyphen—try xplane_airports not x-plane_airports. (This is “wrong” in the sense that 100% of our marketing materials use the hyphen, but it conforms to Python naming conventions.)

      Also make sure you’re on Python 3.7! (I’m lazy, and this is an offshoot of an internal tool, so I’m not keen on removing the 3.7 dependencies… plus, once you use some of the new 3.7 tools, you’ll never look back to 3.6 or earlier.)

      1. I tried of the no hyphen with same results, just forgot to mention it. However Python version was the angry cat, I am on 3.6.6 due to me using the pyinstaller, which only works in that..

        Case solved.

  5. Is there anywhere to submit feature requests? Not so much a bug, but a functionality that would vastly improve experience. Thanks for pointing me in the right direction.

Comments are closed.