Package: pihello
pihellopihellois a simple and configurable
    command-line tool used to display statistics of your Pi-hole.No additional dependencies required.What's this used for?You frequently work in the terminal or ssh into your pi-hole host? Wouldn't it be nice to have a useful greeting message?Just install and add thepihello <your.pihole.address> <your.pihole.api-token>command to your shell's startup script (.bash_profile,.zshenv,fish_greeting.fish, etc.). Next time you open the terminal you'll be greeted by the default(or your own)fancy message!InstallationRequirementsA runningpi-holeinstancePython >=3.8QuickstartInstall:pip install pihelloRun a preconfigured display (as seen above):pihello <your.pihole.address> <your.pihole.api-token>UsageExamplesTo run from the command line for standard HTTP Pi-hole installs:pihello <your.pihole.address> <your.pihole.api-token>To run from the command line with a custom configuration file:pihello <your.pihole.address> <your.pihole.api-token> -f /path/to/config.txtTo run from the command line for HTTPS Pi-hole installs:pihello <your.pihole.address> <your.pihole.api-token> -pTo run from the command line for HTTPS Pi-hole installs w/custom path to pihole (e.g./piholeinstead of the default/admin) :pihello <your.pihole.address> <your.pihole.api-token> -p -u /piholeFull command options:$ pihello -h
usage: pihello [-h] [-v] [-i INDENT] [-f FILE] [-c] [-W WIDTH] [-H HEIGHT] [-ts [TIMESTAMP]] [-p] [-u URI] addr token

positional arguments:
  addr                  the address of your Pi-hole
  token                 your Pi-hole API Token from settings

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -i INDENT, --indent INDENT
                        set the indentation step (default: 4)
  -f FILE, --file FILE  specify path to the output config file
  -c, --clip            set whether overflowing text will be discarded or added to the next line
  -W WIDTH, --width WIDTH
                        set the screen width (0 = no limit). (default: 80)
  -H HEIGHT, --height HEIGHT
                        set the screen height (0 = no limit). (default: 25)
  -ts [TIMESTAMP], --timestamp [TIMESTAMP]
                        add a timestamp as the first line. Pass optional strftime format string. Example "%H:%M - %a %d/%m/%y"
  -p, --proto           use HTTPS instead of HTTP.
  -u URI, --uri URI     set a different path (URI) for pihole. (default: /admin)ConfigurationCreate a configuration text file anywhere in your userspace.example.txtMore example configurations can be found indocs/SHOWCASE.md.[cyan2]─────────────────────────────────────────────────────[]
[white]PiHole[] ([green4]{status}[]) [lightgreen]{core_current}[white], Web [lightgreen]{web_current}[white], FTL [lightgreen]{FTL_current}
[cyan2]─────────────────────────────────────────────────────[]
Blocking [darkcyan]{domains_being_blocked}[] domains for [steelblue]{unique_clients}[] clients
Blocked [fuchsia]{ads_blocked_today}[] out of [lightgreen]{dns_queries_today}[] queries [underline]today[] ([steelblue]{ads_percentage_today}%[])
[grey37]Gravity last updated [bold grey50]{gravity_last_updated.relative.days}[grey37] days [bold grey50]{gravity_last_updated.relative.hours}[grey37] hours and [bold grey50]{gravity_last_updated.relative.minutes}[grey37] minutes agoRunpihellowith the-fflag pointing to the configuration file:pihello <your.pihole.address> <your.pihole.api-token> -f /home/username/path_to/example.txtVariable injectionPiHole API's variables can be easily injected by using curly braces{ }.Syntax:{variable_name}Example:"PiHole {core_current} (FTL: {FTL_current})"Notes:Variable names are case-sensitiveOpen curly brace, which is not part of a variable injection, should be escaped like so\{Available variablesKeyExample valueTyperecent_blockedssl.google-analytics.comstrcore_updateFalseboolweb_updateFalseboolFTL_updateFalseboolcore_currentv5.1.2strweb_currentv5.1.1strFTL_currentv5.2strcore_latestv5.1.2strweb_latestv5.1.1strFTL_latestv5.2strcore_branchmasterstrweb_branchmasterstrFTL_branchmasterstrdomains_being_blocked94541intdns_queries_today14324intads_blocked_today3917intads_percentage_today27.345713floatunique_domains5967intqueries_forwarded7942intqueries_cached2465intclients_ever_seen12intunique_clients9intdns_queries_all_types14324intreply_NODATA423intreply_NXDOMAIN223intreply_CNAME3784intreply_IP8768intprivacy_level0intstatusenabledstrgravity_last_updated.file_existsTrueboolgravity_last_updated.absolute1602374786intgravity_last_updated.relative.days1intgravity_last_updated.relative.hours12intgravity_last_updated.relative.minutes29intStylingText styling is done by inserting style tags[ ]Color prepended by a semicolon:indicates abackground colorColor prepended by an underline_indicates anunderlined colorAFAIK, only supported in Kitty, VTE, mintty and iTerm2.Syntax:[<style> <foreground_color> :<background_color> _<underline_color>]Example:"[italic navy]Hello [underline maroon :green]World[bold]!"Notes:Open square bracket, which is not part of a style, must be escaped like so\[Empty square brackets,[], can be used to reset the styleOrder of the parameters does not matterExtra whitespace and letter's case is ignoredAvailable stylesStyleFormat stringNotesNormalnormalReset the font to normal.BoldboldFaintfaintItalicitalicUnderlineunderlineDouble underlinedunderlineUsually just a single underline.BlinkblinkUsually not supported.Fast blinkfblinkUsually not supported.StrikethroughstrikeUsually not supported.ColorsThere is a number of ways to define a color:DefinitionMatching regexExampleNotesColor name[0-9a-z]+blackPreferred way to define a color.Color numbercolor\([0-9]{1,3}\)color(0)Good way to ensure compatibility withold or simple terminal emulators/displays.Hex value\#[0-9a-f]{6}#000000RGB valuesrgb\([\d\s,]+\)rgb(0, 0, 0)Available color namesThese areXtermcolor names.
Duplicate color names have been removed keeping the last (usually brightest) occurence.
This list has currently 202 rows.Color #Color nameHEXRGB0black#000000rgb(0,0,0)1maroon#800000rgb(128,0,0)2green#008000rgb(0,128,0)3olive#808000rgb(128,128,0)4navy#000080rgb(0,0,128)6teal#008080rgb(0,128,128)7silver#c0c0c0rgb(192,192,192)8grey#808080rgb(128,128,128)9red#ff0000rgb(255,0,0)10lime#00ff00rgb(0,255,0)11yellow#ffff00rgb(255,255,0)12blue#0000ffrgb(0,0,255)13fuchsia#ff00ffrgb(255,0,255)14aqua#00ffffrgb(0,255,255)15white#ffffffrgb(255,255,255)16grey0#000000rgb(0,0,0)17navyblue#00005frgb(0,0,95)18darkblue#000087rgb(0,0,135)20blue3#0000d7rgb(0,0,215)21blue1#0000ffrgb(0,0,255)22darkgreen#005f00rgb(0,95,0)25deepskyblue4#005fafrgb(0,95,175)26dodgerblue3#005fd7rgb(0,95,215)27dodgerblue2#005fffrgb(0,95,255)28green4#008700rgb(0,135,0)29springgreen4#00875frgb(0,135,95)30turquoise4#008787rgb(0,135,135)32deepskyblue3#0087d7rgb(0,135,215)33dodgerblue1#0087ffrgb(0,135,255)36darkcyan#00af87rgb(0,175,135)37lightseagreen#00afafrgb(0,175,175)38deepskyblue2#00afd7rgb(0,175,215)39deepskyblue1#00afffrgb(0,175,255)40green3#00d700rgb(0,215,0)41springgreen3#00d75frgb(0,215,95)43cyan3#00d7afrgb(0,215,175)44darkturquoise#00d7d7rgb(0,215,215)45turquoise2#00d7ffrgb(0,215,255)46green1#00ff00rgb(0,255,0)47springgreen2#00ff5frgb(0,255,95)48springgreen1#00ff87rgb(0,255,135)49mediumspringgreen#00ffafrgb(0,255,175)50cyan2#00ffd7rgb(0,255,215)51cyan1#00ffffrgb(0,255,255)55purple4#5f00afrgb(95,0,175)56purple3#5f00d7rgb(95,0,215)57blueviolet#5f00ffrgb(95,0,255)59grey37#5f5f5frgb(95,95,95)60mediumpurple4#5f5f87rgb(95,95,135)62slateblue3#5f5fd7rgb(95,95,215)63royalblue1#5f5fffrgb(95,95,255)64chartreuse4#5f8700rgb(95,135,0)66paleturquoise4#5f8787rgb(95,135,135)67steelblue#5f87afrgb(95,135,175)68steelblue3#5f87d7rgb(95,135,215)69cornflowerblue#5f87ffrgb(95,135,255)71darkseagreen4#5faf5frgb(95,175,95)73cadetblue#5fafafrgb(95,175,175)74skyblue3#5fafd7rgb(95,175,215)76chartreuse3#5fd700rgb(95,215,0)78seagreen3#5fd787rgb(95,215,135)79aquamarine3#5fd7afrgb(95,215,175)80mediumturquoise#5fd7d7rgb(95,215,215)81steelblue1#5fd7ffrgb(95,215,255)83seagreen2#5fff5frgb(95,255,95)85seagreen1#5fffafrgb(95,255,175)87darkslategray2#5fffffrgb(95,255,255)88darkred#870000rgb(135,0,0)91darkmagenta#8700afrgb(135,0,175)94orange4#875f00rgb(135,95,0)95lightpink4#875f5frgb(135,95,95)96plum4#875f87rgb(135,95,135)98mediumpurple3#875fd7rgb(135,95,215)99slateblue1#875fffrgb(135,95,255)101wheat4#87875frgb(135,135,95)102grey53#878787rgb(135,135,135)103lightslategrey#8787afrgb(135,135,175)104mediumpurple#8787d7rgb(135,135,215)105lightslateblue#8787ffrgb(135,135,255)106yellow4#87af00rgb(135,175,0)108darkseagreen#87af87rgb(135,175,135)110lightskyblue3#87afd7rgb(135,175,215)111skyblue2#87afffrgb(135,175,255)112chartreuse2#87d700rgb(135,215,0)114palegreen3#87d787rgb(135,215,135)116darkslategray3#87d7d7rgb(135,215,215)117skyblue1#87d7ffrgb(135,215,255)118chartreuse1#87ff00rgb(135,255,0)120lightgreen#87ff87rgb(135,255,135)122aquamarine1#87ffd7rgb(135,255,215)123darkslategray1#87ffffrgb(135,255,255)125deeppink4#af005frgb(175,0,95)126mediumvioletred#af0087rgb(175,0,135)128darkviolet#af00d7rgb(175,0,215)129purple#af00ffrgb(175,0,255)133mediumorchid3#af5fafrgb(175,95,175)134mediumorchid#af5fd7rgb(175,95,215)136darkgoldenrod#af8700rgb(175,135,0)138rosybrown#af8787rgb(175,135,135)139grey63#af87afrgb(175,135,175)140mediumpurple2#af87d7rgb(175,135,215)141mediumpurple1#af87ffrgb(175,135,255)143darkkhaki#afaf5frgb(175,175,95)144navajowhite3#afaf87rgb(175,175,135)145grey69#afafafrgb(175,175,175)146lightsteelblue3#afafd7rgb(175,175,215)147lightsteelblue#afafffrgb(175,175,255)149darkolivegreen3#afd75frgb(175,215,95)150darkseagreen3#afd787rgb(175,215,135)152lightcyan3#afd7d7rgb(175,215,215)153lightskyblue1#afd7ffrgb(175,215,255)154greenyellow#afff00rgb(175,255,0)155darkolivegreen2#afff5frgb(175,255,95)156palegreen1#afff87rgb(175,255,135)157darkseagreen2#afffafrgb(175,255,175)159paleturquoise1#afffffrgb(175,255,255)160red3#d70000rgb(215,0,0)162deeppink3#d70087rgb(215,0,135)164magenta3#d700d7rgb(215,0,215)166darkorange3#d75f00rgb(215,95,0)167indianred#d75f5frgb(215,95,95)168hotpink3#d75f87rgb(215,95,135)169hotpink2#d75fafrgb(215,95,175)170orchid#d75fd7rgb(215,95,215)172orange3#d78700rgb(215,135,0)173lightsalmon3#d7875frgb(215,135,95)174lightpink3#d78787rgb(215,135,135)175pink3#d787afrgb(215,135,175)176plum3#d787d7rgb(215,135,215)177violet#d787ffrgb(215,135,255)178gold3#d7af00rgb(215,175,0)179lightgoldenrod3#d7af5frgb(215,175,95)180tan#d7af87rgb(215,175,135)181mistyrose3#d7afafrgb(215,175,175)182thistle3#d7afd7rgb(215,175,215)183plum2#d7afffrgb(215,175,255)184yellow3#d7d700rgb(215,215,0)185khaki3#d7d75frgb(215,215,95)187lightyellow3#d7d7afrgb(215,215,175)188grey84#d7d7d7rgb(215,215,215)189lightsteelblue1#d7d7ffrgb(215,215,255)190yellow2#d7ff00rgb(215,255,0)192darkolivegreen1#d7ff87rgb(215,255,135)193darkseagreen1#d7ffafrgb(215,255,175)194honeydew2#d7ffd7rgb(215,255,215)195lightcyan1#d7ffffrgb(215,255,255)196red1#ff0000rgb(255,0,0)197deeppink2#ff005frgb(255,0,95)199deeppink1#ff00afrgb(255,0,175)200magenta2#ff00d7rgb(255,0,215)201magenta1#ff00ffrgb(255,0,255)202orangered1#ff5f00rgb(255,95,0)204indianred1#ff5f87rgb(255,95,135)206hotpink#ff5fd7rgb(255,95,215)207mediumorchid1#ff5fffrgb(255,95,255)208darkorange#ff8700rgb(255,135,0)209salmon1#ff875frgb(255,135,95)210lightcoral#ff8787rgb(255,135,135)211palevioletred1#ff87afrgb(255,135,175)212orchid2#ff87d7rgb(255,135,215)213orchid1#ff87ffrgb(255,135,255)214orange1#ffaf00rgb(255,175,0)215sandybrown#ffaf5frgb(255,175,95)216lightsalmon1#ffaf87rgb(255,175,135)217lightpink1#ffafafrgb(255,175,175)218pink1#ffafd7rgb(255,175,215)219plum1#ffafffrgb(255,175,255)220gold1#ffd700rgb(255,215,0)222lightgoldenrod2#ffd787rgb(255,215,135)223navajowhite1#ffd7afrgb(255,215,175)224mistyrose1#ffd7d7rgb(255,215,215)225thistle1#ffd7ffrgb(255,215,255)226yellow1#ffff00rgb(255,255,0)227lightgoldenrod1#ffff5frgb(255,255,95)228khaki1#ffff87rgb(255,255,135)229wheat1#ffffafrgb(255,255,175)230cornsilk1#ffffd7rgb(255,255,215)231grey100#ffffffrgb(255,255,255)232grey3#080808rgb(8,8,8)233grey7#121212rgb(18,18,18)234grey11#1c1c1crgb(28,28,28)235grey15#262626rgb(38,38,38)236grey19#303030rgb(48,48,48)237grey23#3a3a3argb(58,58,58)238grey27#444444rgb(68,68,68)239grey30#4e4e4ergb(78,78,78)240grey35#585858rgb(88,88,88)241grey39#626262rgb(98,98,98)242grey42#6c6c6crgb(108,108,108)243grey46#767676rgb(118,118,118)244grey50#808080rgb(128,128,128)245grey54#8a8a8argb(138,138,138)246grey58#949494rgb(148,148,148)247grey62#9e9e9ergb(158,158,158)248grey66#a8a8a8rgb(168,168,168)249grey70#b2b2b2rgb(178,178,178)250grey74#bcbcbcrgb(188,188,188)251grey78#c6c6c6rgb(198,198,198)252grey82#d0d0d0rgb(208,208,208)253grey85#dadadargb(218,218,218)254grey89#e4e4e4rgb(228,228,228)255grey93#eeeeeergb(238,238,238)DevelopmentPRs welcome!Showcase your configuration!
Submit a PR with your configuration and a screenshot.InstallationInstallPoetryClone or fork the repoInstall the dependenciespoetry installThis creates a virtual environment and installs the project into it.Activate the virtual environmentpoetry shellRun the projectpihello ...TODO-listIn no particular orderAuthentication for access to more variablesStart accessing more variablesJustification styling similar to Python'sljust()andrjust()Use the screen width and height to break up the textAdd actual support for indentationConditional formatting/stylingPeriodic updates (as if usingwatchcommand) but withworking colorsStructured config using.yamlor some other typeChangelogChangelog can be found inCHANGELOG.mdLicenceMIT Licence