Skip to main content

SpaceX REST API wrapping with aiohttp

Project description

SpaceX-SimpleWrapper

A wrapper that supports asynchronous.

This package is Asynchronous wrapping of the informal SpaceX REST API.

Install

pip install spasexpy

Quick Example

import asyncio
import spacexpy

async def main():
    spacex = spacexpy.SpaceX()
    cl = await spacex.company()
    print(cl.name)
    print(cl.summary)

loop = asyncio.get_event_loop()
loop.run_until_complete(main())

Print:

SpaceX
SpaceX designs, manufactures and launches advanced rockets and spacecraft. The company was founded in 2002 to revolutionize space technology, with the ultimate goal of enabling people to live on other planets.

Get all list

import asyncio
import spacexpy

async def main():
    spacex = spacexpy.SpaceX()
    cl = await spacex.capsules(rawdata=True)
    print(cl.data)

loop = asyncio.get_event_loop()
loop.run_until_complete(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"
    },
    ...
]

Attribute

Check this docs

Patch note

1.0.0

  • Released 1.0.0: All endpoints corver

Contributing

You can Open an issue or submit PRs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spacexpy-1.0.0.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

spacexpy-1.0.0-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page