python-launch-library
A simple python wrapper for the Launch Library web API. Can also be used asynchronously too.
Important: New projects should NOT use this library. Instead, use the OpenAPI definitions provided in https://ll.thespacedevs.com/2.0.0/swagger
Available models: Agency, Launch, Pad, Location, Rocket
The usage of the API is simple.
Usage
Proper documentation is available in Read The Docs.
To install, simply use pip: pip install python-launch-library
# First, import the library
import launchlibrary as ll
# Then, initialize an API object
api = ll.Api()
# And fetch whichever models you'd like.
# Either by an explicit API call
next_5_go_launches = api.fetch_launch(next=5, status=1)
# Or by one of the simpler methods available for some models.
next_5_go_launches = api.next_launches(5)
# Now, you can utilize whatever data you'd like. Data from the API is processed recursively, so if a Launch object
# contains a Location object, you'll have models for both.
launch_loc = next_5_go_launches[0].location
# Some properties, like status, are only represented by ID. You can call the appropriate methods to get a proper object from that ID
launch_status = next_5_go_launches[0].get_status()
# It's now possible to also use the regular API names as well as pythonic names.
vid_urls = next_5_go_launches[0].vid_urls
vid_urls_2 = next_5_go_launches[0].vidURLs
Changelog
Since version 1.0.1, the library is versioned according to semantic versioning rules.
Important: New projects should NOT use this library. Instead, use the OpenAPI definitions provided in https://ll.thespacedevs.com/2.0.0/swagger
-
2.0.0 - Update to LL2, aka
https://thespacedevs.com/llapi. There are some data changes, so this is a breaking change.This is a quickly hacked together attempt to add some compatibility to LL2 for current users, as there's no point in spending time creating a wrapper when OpenAPI definitions exist.
Breaking Changes:
- The AgencyType, LaunchStatus, and RocketFamily models have been eliminated.
- All instances, except in
Launchofinfo_urlshave been changed toinfo_url(this is compliant with the new API). - Many parameters might be unavailable as many names were changed.
- Modelizations might not work as well as many names were changed.
-
1.0.3, 1.0.4, 1.0.5, 1.0.6 - Fixed some bugs in the async variant
-
1.0.2 - Added an exception hierarchy. All exceptions now inherit from LlException
-
1.0.1 - Improved caching.
-
1.0 - Changed all fetch calls to be through the Api object. This is a breaking change.
# Porting guide import launchlibrary as ll api = ll.Api() # Before next_launch = ll.Launch.next(api, 1) # After next_launch = api.next_launches(1)
Todo
- Tidy up the repository
- Add exceptions to handle server timeout
- Handle nested models (i.e. a Pad model inside a Location model inside a Launch model)
- Handle times with the datetime class
- Package properly and upload to PyPI
- Add more abstraction methods for the api calls (open to suggestions)
- Add magic method comparisons (open to suggestions)
- Asynchronous operation
- Add aliases for actual API names with getattr
- Add tests
- Your suggestion here
Feel free to open issues and pull requests! I usually check Github daily.
Metadata
Release files for python-launch-library 2.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python-launch-library-2.0.3.tar.gz | 11.3 kB | Without provenance | Details for python-launch-library-2.0.3.tar.gz |
Release files / python-launch-library-2.0.3.tar.gz
| Download URL | python-launch-library-2.0.3.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
483dd7bdd851b318c9917aa95ae083b8e0f2b4f865ca90a363e9df6de002c230
|
|
BLAKE2b-256 checksum How to use checksums |
4bd4adb6d3c21f919dae25bef8b15a493da535a4007d4112964141f6d53c6a48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
|
Security for python-launch-library 2.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.