A Ruby gem for interacting with the FAA's Aeronautical Products Release API (APRA).
Add this line to your application's Gemfile:
gem 'faa_apra'And then execute:
$ bundle installOr install it yourself as:
$ gem install faa_apraFirst, obtain your API credentials from the FAA External API Portal.
require 'faa_apra'
# Initialize with client credentials
client = FaaApra.new(
'your_client_id',
'your_client_secret'
)
# Or use environment variables
# export FAA_APRA_CLIENT_ID=your_client_id
# export FAA_APRA_CLIENT_SECRET=your_client_secret
client = FaaApra.new
# Get Coded Instrument Flight Procedures (CIFP)
cifp_data = client.cifp_chart
cifp_info = client.cifp_info(edition: 'current')
# Get Terminal Procedure Publication (TPP) chart
tpp_data = client.dtpp_chart(
edition: 'current',
area: 'US',
format: 'all'
)
# Get Sectional Chart data
chart_data = client.sectional_chart(
edition: 'current',
geoname: 'NEW_YORK',
format: 'pdf'
)
# Get IFR Enroute Chart data
ifr_data = client.ifr_enroute_chart(
edition: 'current',
altitude: 'high',
format: 'pdf'
)The gem provides access to the following FAA APRA API endpoints:
cifp_chart(edition: 'current')- Get CIFP chart download linkcifp_info(edition: 'current')- Get CIFP edition information
ddof_chart- Get DDOF download linkddof_info- Get DDOF edition information
dec_chart(edition: 'current')- Get DEC chart download linkdec_info(edition: 'current')- Get DEC edition information
dtpp_chart(edition: 'current', area: 'US', format: 'all')- Get TPP chart download linkdtpp_info(edition: 'current', area: 'US')- Get TPP edition information
sectional_chart(edition: 'current', geoname: nil, format: 'pdf')- Get Sectional Chart download linksectional_info(edition: 'current', geoname: nil, format: 'pdf')- Get Sectional Chart edition information
grand_canyon_chart(edition: 'current', format: 'pdf')- Get Grand Canyon VFR Chart download linkgrand_canyon_info(edition: 'current', format: 'pdf')- Get Grand Canyon VFR Chart edition information
ifr_enroute_chart(edition: 'current', geoname: nil, altitude:, format: 'pdf')- Get IFR Enroute Chart download linkifr_enroute_info(edition: 'current', geoname: nil, altitude:, format: 'pdf')- Get IFR Enroute Chart edition information
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/yourusername/faa_apra. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the FaaApra project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.