All Projects → not-stirred → nextinspace

not-stirred / nextinspace

Licence: GPL-3.0 license
Never miss a launch. 🚀

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to nextinspace

Spacex Api
🚀 Open Source REST API for SpaceX launch, rocket, core, capsule, starlink, launchpad, and landing pad data.
Stars: ✭ 8,973 (+8784.16%)
Mutual labels:  space, spacex
Orekit
OREKIT is a free low level space dynamics library written in Java. Please visit our Gitlab instance for issues and contributions: https://gitlab.orekit.org
Stars: ✭ 110 (+8.91%)
Mutual labels:  space, spaceflight
SpaceX
PowerShell module to interact with api.spacexdata.com
Stars: ✭ 25 (-75.25%)
Mutual labels:  space, spacex
Nasa-And-Spacex-Cooperation
Theme Outer Space
Stars: ✭ 41 (-59.41%)
Mutual labels:  space, spacex
api
Open Source API for Launched Spacecrafts & Rockets data of ISRO🚀
Stars: ✭ 62 (-38.61%)
Mutual labels:  space, rockets
Moonwards-Virtual-Moon
Development continues on Unreal, in the MoonwardsUE repository
Stars: ✭ 97 (-3.96%)
Mutual labels:  space
pyuavcan
Python implementation of the Cyphal protocol stack.
Stars: ✭ 91 (-9.9%)
Mutual labels:  space
white-vest
White Vest is a project for collecting, logging, emitting, and visualizing telemetry from a model rocket containing an inboard Raspberry Pi Zero with an Arduino receiving telemetry.
Stars: ✭ 28 (-72.28%)
Mutual labels:  rocketry
perseverance-parachute-generator
Generate your own Perseverance parachute-style secret codes!
Stars: ✭ 17 (-83.17%)
Mutual labels:  space
Mercury-GS
An Open Source Program that allows users to interact with a Spacecraft in a lab environment, pre-launch.
Stars: ✭ 18 (-82.18%)
Mutual labels:  space
spacetech-ssa
IBM Space Tech - Space Situational Awareness
Stars: ✭ 89 (-11.88%)
Mutual labels:  space
orbiter-rs
A proof-of-concept for building Orbiter spaceflight simulator addons in Rust
Stars: ✭ 12 (-88.12%)
Mutual labels:  spaceflight
Space-Frontier
A reimagining of the game of my childhood - Stellar Frontier
Stars: ✭ 18 (-82.18%)
Mutual labels:  space
SpaceProject
A top-down 2D, procedurally generated space exploration and shooter game using libGDX. Kinda like Asteroids, only a little bigger.
Stars: ✭ 28 (-72.28%)
Mutual labels:  space
open-space-toolkit-astrodynamics
Flight profile, orbit, attitude, access.
Stars: ✭ 16 (-84.16%)
Mutual labels:  space
HPR-Rocket-Flight-Computer
A flight computer for high-powered rockets based on the Teensy platform. 4 programmable pyro outputs, Mach immune flight events, air-start & two-stage capable w/ tilt-sensing safety features, GPS & live telemetry. High-rate data logging at 1000 samples per second. 4.0in x 1.25in x 0.5in fits in a 38mm tube coupler.
Stars: ✭ 33 (-67.33%)
Mutual labels:  rocketry
lunar-theme
🌓 A minimal dark and light theme for Visual Studio Code. Handpicked colours, easy on the eyes, and perfect for coding in the day/night.
Stars: ✭ 24 (-76.24%)
Mutual labels:  space
Realistic-Atmosphere-Godot-and-UE4
A realistic atmosphere material for both the Godot game engine and Unreal Engine 4
Stars: ✭ 119 (+17.82%)
Mutual labels:  space
antares
A tactical space combat game
Stars: ✭ 80 (-20.79%)
Mutual labels:  space
WorkingGroup
Issues tracker for ideas, ongoing work, looking for mentors, mentors available. Join here!
Stars: ✭ 37 (-63.37%)
Mutual labels:  space

Nextinspace

Test Documentation Status PyPI GitHub release (latest by date) Downloads Pyversions License: GPL v3

“Never miss a launch.”

Overview

A command-line tool for seeing the latest in space. Nextinspace also supports use as a Python library, so you can integrate it into your application. You can also get data printed to the terminal in JSON, which can be piped into another program.

FeaturesInstallation and DocumentationUsing the Nextinspace Public APIUsing Nextinspace in Shell ScriptingCLI ReferenceCredits

Features

  • Get the next n items: Nextinspace by default prints the closest upcoming item, but you can request as many items as the LL2 API will provide.

  • Filter by type: Nextinspace allows you to filter upcoming-related by type. You can choose to only see launches, only see events, or both.

  • Toggle the verbosity: Nextinspace offers quiet, normal, and verbose modes. With --quiet, you can get a quick overview of upcoming items. With --verbose, you can see all of the important details such as description and launcher.

  • JSON output: Nextinspace provides a --json flag for output in JSON format. This can be parsed with tools like jq.

  • Pretty printing: Nextinspace prints upcoming items in formatted panels and with colored text.

Installation and Documentation

Nextinspace can be installed using pip:

pip install nextinspace

It can also be installed directly from Github:

pip install git+https://github.com/not-stirred/nextinspace

Or you can use your favorite package manager:

# Arch Linux
yay -S nextinspace

# Nix
nix-env -iA nixpkgs.nextinspace

Documentation can be found at Read the Docs.

Using the Nextinspace Public API

Nextinspace defines a public API of functions and classes that you can use in your code.

>>> import nextinspace

Example 1: Get the next upcoming space-related thing

>>> next_in_space = nextinspace.nextinspace(1)
>>> next_in_space
(nextinspace.Event('Starship SN9 Pressure Test', 'Boca Chica, Texas', datetime.datetime(2020, 12, 28, 21, 0, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=68400), 'EST')), 'SpaceX has conducted a pressure test on Starship SN9.', 'Ambient Pressure Test'),)
>>> print(next_in_space[0].date)
2020-12-28 21:00:00-05:00

Example 2: Get the next two upcoming events

>>> next_2_events = nextinspace.next_event(2)
>>> next_2_events
(nextinspace.Event('Starship SN9 Pressure Test', 'Boca Chica, Texas', datetime.datetime(2020, 12, 28, 21, 0, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=68400), 'EST')), 'SpaceX has conducted a pressure test on Starship SN9.', 'Ambient Pressure Test'), nextinspace.Event('Starship SN9 Cryoproof Test', 'Boca Chica, Texas', datetime.datetime(2020, 12, 29, 18, 0, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=68400), 'EST')), 'SpaceX will likely conduct a cryoproof test on Starship SN9. This is the first cryo test performed on the vehicle.', 'Cryoproof Test'))
>>> next_2_events[1].name
'Starship SN9 Cryoproof Test'

Example 3: Get the next upcoming launch

>>> next_space_launch = nextinspace.next_launch(1)
>>> next_space_launch
(nextinspace.Launch('Soyuz STA/Fregat | CSO-2', 'Soyuz Launch Complex, Kourou, French Guiana', datetime.datetime(2020, 12, 29, 11, 42, 7, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=68400), 'EST')), 'The CSO-2 (Composante Spatiale Optique-2) satellite is the second of three new-generation high-resolution optical imaging satellites for the French military, replacing the Helios 2 spy satellite series.', 'Government/Top Secret', None),)
>>> print(next_space_launch[0].launcher)
None

Example 4: Get the next two upcoming launches and their launchers

>>> next_2_launches = nextinspace.next_launch(2, include_launcher=True)
>>> next_2_launches
(nextinspace.Launch('Soyuz STA/Fregat | CSO-2', 'Soyuz Launch Complex, Kourou, French Guiana', datetime.datetime(2020, 12, 29, 11, 42, 7, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=68400), 'EST')), 'The CSO-2 (Composante Spatiale Optique-2) satellite is the second of three new-generation high-resolution optical imaging satellites for the French military, replacing the Helios 2 spy satellite series.', 'Government/Top Secret', nextinspace.Launcher('Soyuz STA/Fregat', 7020, 2810, None, 312, 3, 46.3, 8, 8, 0, datetime.datetime(2011, 12, 16, 19, 0, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=68400), 'EST')))), nextinspace.Launch('Falcon 9 Block 5 | Türksat 5A', 'Space Launch Complex 40, Cape Canaveral, FL, USA', datetime.datetime(2021, 1, 4, 20, 27, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=68400), 'EST')), 'Türksat 5A is the first of two Turkish next generation communications satellites, which will be operated by Türksat for commercial and military purposes.', 'Communications', nextinspace.Launcher('Falcon 9 Block 5', 22800, 8300, 7607, 549, 2, 70.0, 47, 47, 0, datetime.datetime(2018, 5, 10, 20, 0, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=72000), 'EDT')))))
>>> next_2_launches[0].launcher.failed_launches
0

Using Nextinspace in Shell Scripting

Nextinspace is capable of outputting structured JSON data that can be parsed by the likes of jq. As such, you can do something like this:

❯ next_3_in_space=$(nextinspace 3 --verbose --json)echo $next_3_in_space | jq "."
[
  {
    "type": "launch",
    "name": "Soyuz STA/Fregat | CSO-2",
    "location": "Soyuz Launch Complex, Kourou, French Guiana",
    "date": "2020-12-29T16:42:07Z",
    "description": "The CSO-2 (Composante Spatiale Optique-2) satellite is the second of three new-generation high-resolution optical imaging satellites for the French military, replacing the Helios 2 spy satellite series.",
    "subtype": "Government/Top Secret",
    "launcher": {
      "name": "Soyuz STA/Fregat",
      "payload_leo": 7020,
      "payload_gto": 2810,
      "liftoff_thrust": null,
      "liftoff_mass": 312,
      "max_stages": 3,
      "height": 46.3,
      "successful_launches": 8,
      "consecutive_successful_launches": 8,
      "failed_launches": 0,
      "maiden_flight_date": "2011-12-17"
    }
  },
  {
    "type": "event",
    "name": "Starship SN9 Cryoproof Test",
    "location": "Boca Chica, Texas",
    "date": "2020-12-29T23:00:00Z",
    "description": "SpaceX will likely conduct a cryoproof test on Starship SN9. This is the first cryo test performed on the vehicle.",
    "subtype": "Cryoproof Test"
  },
  {
    "type": "event",
    "name": "SLS Green Run Hot Fire",
    "location": "Stennis Space Center, Mississippi",
    "date": "2020-12-31T00:00:00Z",
    "description": "The core stage of the Space Launch System will undergo the final 'Green Run' test, where the core stage will be fired for 8 minutes, demonstrating performance similar to an actual launch.",
    "subtype": "Static Fire"
  }
]
❯ echo $next_3_in_space | jq ".[].name"
"Soyuz STA/Fregat | CSO-2"
"Starship SN9 Cryoproof Test"
"SLS Green Run Hot Fire"

The structure of the JSON outputted by nextinspace is basically demonstrated in the example above. The structure and values of the data reflect the relationships between the Launch, Event, and Launcher classes, with a few notable exceptions:

  • The type_ attribute: The type_ attribute of Nextinspace Event and Launch objects is stored in the subtype key. The type key actually holds the class of the Nextinspace object represented in the JSON object (either launch or event).
  • The date key: Internally, Nextinspace stores dates and times in local time, but for JSON output Nextinspace converts date and time values to UTC. Also, Nextinspace outputs date and time values in ISO 8601 format.

CLI Reference

❯ nextinspace --help
usage: nextinspace [-h] [-e | -l] [-v | -q] [--json] [--version] [number of items]

Never miss a launch.

positional arguments:
  number of items      The number of items to display.

optional arguments:
  -h, --help           show this help message and exit
  -e, --events-only    Only show events. These are typically not covered by standard launches. These events could be spacecraft landings, engine tests, or spacewalks.
  -l, --launches-only  Only display orbital and suborbital launches. Generally these will be all orbital launches and suborbital launches which aim to reach “space” or the Karman line.
  -v, --verbose        Display additional details about launches.
  -q, --quiet          Only display name, location, date, and type.
  --json               Output data in JSON format. Note that '--quiet' has no effect when this flag is set.
  --version            show program's version number and exit

Credits

This project would not have been possible without the Launch Library 2 API. Please consider sponsoring them on Patreon.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].