Python wrapper for the unofficial SpaceX REST API. All information on such can be found here. Used for retrieving information about:
- Capsules
- Cores
- Launches
- Launchpads
- Rockets
- Miscellaneous data
Command to install the package into your environment:
pip install spacex-py
Documentation for all queries can be found in their respective source files. This wrapper matches the SpaceX API, allowing for ease uf use. Let's go through some examples:
from spacex_py import launches
# Returns a tuple
got_launches, header = launches.get_launches()
# PyLint being a pain about header? use the following:
got_launches, _ = launches.get_launches()
# Prints a list of launches
print(got_launches)
Now let's get launches using a query:
from spacex_py import launches
#Queries launches using the specific site id
got_launches, _ = launches.get_launches(site_id="ksc_lc_39a")
#Example query using multiple parameters
got_launches, _ = launches.get_launches(site_id="ksc_lc_39a", payload_type='Satellite')
#Prints a list of launches fitting the above parameters
print(got_launches)
This project uses the MIT License. More information can be found in LICENSE.