Awesome
starfetch
A command line tool written in C++ that displays constellations.
Table of contents
- Description
- Demo visuals
- Installation
- Usage
- Available constellations
- JSON Format
- Credits & Dependencies
Description
starfetch is a tool that prints out a scheme of a given constellation and some information about it: its quadrant, its right ascension, its declination, ita area and its main stars number.
Demo visuals
<img width="1375" alt="1" src="https://user-images.githubusercontent.com/61376940/161760417-8ba116fc-71a6-4d0c-8219-1b76a4121ace.png">
Installation
To install starfetch, run these commands:
MacOS
git clone https://github.com/Haruno19/starfetch
cd starfetch
make
sudo make install_mac
Install directoy: /usr/local/opt/starfetch/
.
Others
git clone https://github.com/Haruno19/starfetch
cd starfetch
make
sudo make install
Install directoy: /usr/local/starfetch/
.
Usage
starfetch accepts parameters to tweak its behaviour:
starfetch [OPTION] [CONSTELLATION NAME]
-h Prints this help message.
-n Shows the selected constellation.
-r Shows a random constellation.
-l Prints the list of all the available constellations.
If launched with no arguments, the behaviour is the same as with '-r'.
Examples: starfetch -r
starfetch -n orion
starfetch
Available constellations
orion gemini
aries scorpio
cancer sagittarius
cygnus aquarius
cassiopeia ophiuchus
libra pisces
virgo antilia
leo ara
capricorn apus
taurus bootes
ursa_major crux
ursa_minor corona_borealis
lupus
I will add more and more constellations!
JSON format
All the constellation data is stored as JSON files in the res/constellations/
directory.
Here's a sample of the JSON format from the Orion constellation:
{
"title": "───── orion ─────",
"graph":
{
"line1": { },
"line2": { "11": "✦" },
"line3": { "7": "✦" },
"line4": { "14": "✦" },
"line5": { },
"line6": { "9": "✦", "11": "✦", "13": "✦"},
"line7": { },
"line8": { "15": "✦" },
"line9": { "8": "✦" },
"line10": { }
},
"name": "Orion",
"quadrant": "NQ1",
"right ascension": "5h",
"declination": "+5°",
"area": "594 sq.deg. (26th)",
"main stars": "7"
}
title
contains the first line of the constellation graph.graph
contains 10 lines keys, describing the constellation graph.line1
toline10
contain the X coordinate of the stars on the relative line (e.g. the 6th line of Orion's graph contains three stars: one at position9
, one at poistion11
and one at position13
).name
contains the name of the constellation, this time written with regular characters.quadrant
contains the quadrant of the constellation.right ascension
contains the right ascension of the constellation.declination
contains the declination of the constellation.area
contains the area of the constellation.main stars
contains the number of stars that compose the constellation.
Contribution guidelines
If you want to help this project grow by adding constellation files, here are some guidelines to write correct JSON files:
- The
"title"
field should contain the name of the constellation written with fullwidth Unicode characters.
Please, make sure to use them. Before and after the name, you have to put the box-drawing character U+2500 as many times as needed to make the line reach the right side of the graph.
Please, make sure to place the same number of box-drawing characters on both sides, in order to make the name appear at the center.
Between the constellation name and the box-drawing characters, you should place a whitespace.
(e.g."───── name ─────"
). - The
line1
toline10
fields should containd the X coordinates of the stars in each line. Please, make sure to center the graph both vertically and horizontally and please, make sure not to leave any star without an X coordinate (e.g. don't write this:"" : "✦"
). - The
"name"
field should contain the name of the constellation starting with the capital letter. - The
"quadrant"
field should contain the quadrant of the constellation, all in capital letters and without spaces. - The
"right ascension"
field should contain the right ascension of the constellation.
Please, make sure to separate each value with a whitespace, and in case a constellation has two right ascension values, separate them with a "to" (e.g."22h 57m 04.5897s to –03h 41m 14.0997s"
). - The
declination
field should contain the declination of the constellation.
Please, make sure to specify bot - and + symbols for negative and positive values. If there are two declination values, separate them with a "to" (e.g."+77.6923447° to –48.6632690°"
). - The
"area"
field should contain the area of the constellation.
Please, make sure to include the unit of measurement, written with lowercase letters (e.g."598 sq.deg. (25th)"
). - The
"main stars"
field should contain the number of stars that compose the constellation. Please, if there's more than a value for this field, make sure to separate them with a comma and a space, and place them in ascending order (e.g."9, 11, 20"
).
Your help is highly appreciated!
Credits & Dependencies
JSON for Modern C++
To work easly with JSON files, starfetch relies on JSON for Modern C++ by Niels Lohmann.
Although relying on external libraries, no dependencies are needed to install starfetch, since said library is already included in this repository (src/include/json.hpp
) via the single_include version provided by the author, in order to make it easier for you, the end user, to enjoy starfetch.
Contributions
- Credits to John Southern for creating the JSON files for the
gemini
,scorpio
,sagittarius
,aquarius
,ophiuchus
andpisces
constellations! - Credits to Hushm for creating the JSON files for the
antlia
,ara
andapus
constellations! - Credits to kbHoward2 for creating the JSON file for the
lupus
constellation!