https://github.com/hikaylum/spacex-py
Python wrapper for the SpaceX API
https://github.com/hikaylum/spacex-py
python python3 space spacex spacex-api spacex-launches
Last synced: 8 months ago
JSON representation
Python wrapper for the SpaceX API
- Host: GitHub
- URL: https://github.com/hikaylum/spacex-py
- Owner: HiKaylum
- License: mit
- Created: 2018-08-16T17:55:02.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-01T04:55:38.000Z (over 1 year ago)
- Last Synced: 2025-02-12T11:08:07.802Z (8 months ago)
- Topics: python, python3, space, spacex, spacex-api, spacex-launches
- Language: Python
- Size: 32.2 KB
- Stars: 18
- Watchers: 2
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
SpaceX-PY[](https://travis-ci.org/TheDigitalTaste/digitalt-cli)
[](https://github.com/HiKaylum/SpaceX-PY/issues)
[](https://github.com/HiKaylum/SpaceX-PY/blob/master/LICENSE)
[](https://github.com/HiKaylum/SpaceX-PY/stargazers)## About
Python wrapper for the unofficial SpaceX REST API. All information on such can be found [here](https://github.com/r-spacex/SpaceX-API). Used for retrieving information about:* Capsules
* Cores
* Launches
* Launchpads
* Rockets
* Miscellaneous data## Installation
Command to install the package into your environment:
```BASH
pip install spacex-py
```## Usage
Documentation for all queries can be found in their respective source files.
This wrapper matches the [SpaceX API](https://github.com/r-spacex/SpaceX-API), allowing for ease uf use. Let's go through some examples:```PYTHON
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:
```PYTHON
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)
```## License
This project uses the [MIT License](https://opensource.org/licenses/MIT).
More information can be found in [LICENSE](https://github.com/HiKaylum/SpaceX-PY/blob/master/LICENSE).