Giter Club home page Giter Club logo

spacexpy's Introduction

SpaceXPy

A wrapper that supports asynchronous.

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

Install

pip install spacexpy

Quick Example

Sync

import spacexpy

spacex = spacexpy.SpaceX()
cl = spacex.company()

print(cl.headquarters)
print(cl.headquarters.address)

Async

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 Road

Get all list

Sync

import spacexpy


spacex = spacexpy.SpaceX()
cl = spacex.capsules()

print(cl)

Async

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"
    },
    ...
]

Attribute

Check this docs

Patch note

2.0.2

2.0.1

2.0.0

  • Now support Sync
  • Change model
  • PR #3

1.0.1

  • Grammer fix 1.0.1: PR #1

1.0.0

  • Released 1.0.0: All endpoints cover

Contributing

You can Open an issue or submit PRs.

spacexpy's People

Contributors

akiacode avatar km6iau avatar navodissa avatar paulr909 avatar restyled-commits avatar saidbysolo avatar wonderlandpark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

spacexpy's Issues

Unnecesary code duplicate

image

This is unnecessary since all endpoints are declared on the client.
It looks good to delete http and add request method into the client.

maybe something wrong?

in the class _Spacex, the method starlink should return request_starlink,not request_ships

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.