A wrapper that supports asynchronous.
This package is Asynchronous wrapping of the informal SpaceX REST API.
pip install spacexpyimport spacexpy
spacex = spacexpy.SpaceX()
cl = spacex.company()
print(cl.headquarters)
print(cl.headquarters.address)import asyncio
import spacexpy
async def main():
spacex = spacexpy.SpaceX()
cl = await spacex.company()
print(cl.headquarters)
print(cl.headquarters.address)
asyncio.run(main())Print:
{"address": "Rocket Road", "city": "Hawthorne", "state": "California"}
Rocket Roadimport spacexpy
spacex = spacexpy.SpaceX()
cl = spacex.capsules()
print(cl)import asyncio
import spacexpy
async def main():
spacex = spacexpy.SpaceX()
cl = await spacex.capsules()
print(cl)
asyncio.run(main())Print:
[
{
"reuse_count": 1,
"water_landings": 1,
"land_landings": 0,
"last_update": "Reentered after three weeks in orbit",
"launches": [
"5eb87cdeffd86e000604b330"
],
"serial": "C101",
"status": "retired",
"id": "5e9e2c5bf35918ed873b2664"
},
...
]Check this docs
- PR #10
- PR #9
- Now support Sync
- Change model
- PR #3
- Grammer fix 1.0.1: PR #1
- Released 1.0.0: All endpoints cover
You can Open an issue or submit PRs.