From a9fd7f538d1deaa36f1e4f443c0b86738819589a Mon Sep 17 00:00:00 2001 From: "Bora M. Alper" Date: Thu, 13 Oct 2016 15:40:19 +0400 Subject: [PATCH] initial commit of v2! This is a huge step in fixing many of the mistakes that we've done in the past and making himawaripy awesome again. * No more `config.py` madness. It was the stupidest mistake I've ever done. Configuration file was unnecessary after all and worse still, it was a native Python script that went into the installation directory, making it impossible for different users sharing the same system have different configs. Now there are only command line arguments. Many thanks to @p4block for raising the issue. * Time offset confusion Maybe it is just me but I think we thought what `hour_offset` was. There is nothing useful (literally) in documentation indicating what it is (except its name). Is it offset from GMT, offset from himawari (which orbits GMT+10:00)? It also caused many errors, such as requesting the image of Earth from the future: #85, #82... Now you can either let himawaripy automatically detect it for you or you can give _your offset from GMT_ to let the script fetch right images. * Save battery You might not want himawaripy to drain your battery by downloading 64 tiles in every 10 minutes. Now you can stop himawaripy from refreshing when on battery by passing `--save-battery` argument. Thanks to @vician's suggestion. * Retry on failure Internet sometimes does not just work. Retry up to 3 times for each file before giving up so that not the whole process stops because of a small temporary error. Thanks to @cameronleger. * Output directory Now you can set the output directory for himawaripy if you would like to. ... besides general cleanup, improvements bla bla bla. Sincerely, Bora --- README.md | 93 +++++---- himawaripy/__main__.py | 194 ++++++++++++++++++ himawaripy/config.py | 18 -- himawaripy/himawaripy.py | 119 ----------- himawaripy/utils.py | 20 +- ....plist => org.boramalper.himawaripy.plist} | 2 +- setup.py | 22 +- 7 files changed, 271 insertions(+), 197 deletions(-) create mode 100755 himawaripy/__main__.py delete mode 100644 himawaripy/config.py delete mode 100755 himawaripy/himawaripy.py rename osx/{com.user.himawaripy.plist => org.boramalper.himawaripy.plist} (92%) diff --git a/README.md b/README.md index bb0f5cd..98b7854 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ # himawaripy *Put near-realtime picture of Earth as your desktop background* +![By /u/hardypart](https://i.imgur.com/UoZMp5Y.gif) + himawaripy is a Python 3 script that fetches near-realtime (10 minutes delayed) picture of Earth as its taken by [Himawari 8 (ひまわり8号)](https://en.wikipedia.org/wiki/Himawari_8) and sets it as your desktop background. -Set a cronjob that runs in every 10 minutes to automatically get the +Set a cronjob (or systemd service) that runs in every 10 minutes to automatically get the near-realtime picture of Earth. ## Supported Desktop Environments @@ -24,13 +26,40 @@ near-realtime picture of Earth. * any other desktop environments that are not mentioned above. ## Configuration -You can configure the level of detail, by modifying the script. You can set the -global variable `level` to `4`, `8`, `16`, or `20` to increase the quality (and -thus the file size as well). Please keep in mind that it will also take more -time to download the tiles. - -You can also change the path of the latest picture, which is by default -`~/.himawari/himawari-latest.png`, by changing the `output_file` variable. + usage: [-h] [--version] [--auto-offset | -o OFFSET] [-l {4,8,16,20}] + [-d DEADLINE] [--save-battery] [--output-dir OUTPUT_DIR] + + set (near-realtime) picture of Earth as your desktop background + + optional arguments: + -h, --help show this help message and exit + --version show program's version number and exit + --auto-offset determine offset automatically + -o OFFSET, --offset OFFSET + UTC time offset in hours, must be less than or equal + to +10 + -l {4,8,16,20}, --level {4,8,16,20} + increases the quality (and the size) of each tile. + possible values are 4, 8, 16, 20 + -d DEADLINE, --deadline DEADLINE + deadline in minutes to download all the tiles, set 0 + to cancel + --save-battery stop updating on battery + --output-dir OUTPUT_DIR + directory to save the temporary background image + +Most of the time himawaripy can accurately detect your timezone if you pass the flag `--auto-offset`, although you may +also set it manually by `-o` (or `--offset`) flag. If your timezone is beyond GMT by more than 10 hours, use the closest +one (either `+10` or `-12`). + +Increasing the level will increase the quality of the image as well as the time taken to download all the tiles and the +memory consumption. For instance choosing 20 will make himawaripy use ~700 MiB of memory at its peak and the image will +be around ~200 MB. + +You should set a deadline compatible with your cronjob (or timer) settings to assure that script will terminate in X +minutes before it is started again. + +You might use `--save-battery` to disable refreshing while running on battery power. ### Nitrogen If you use nitrogen for setting your wallpaper, you have to enter this in your @@ -40,28 +69,19 @@ If you use nitrogen for setting your wallpaper, you have to enter this in your file=/home/USERNAME/.himawari/himawari-latest.png mode=4 bgcolor=#000000 - -## Prerequisites - -You need a valid python3 installation including the python3-setuptools package: - - sudo apt install python3 - sudo apt install python3-setuptools ## Installation +* You need a valid python3 installation including the python3-setuptools package + cd ~ git clone https://github.com/boramalper/himawaripy.git - # configure - cd ~/himawaripy/ - vi himawaripy/config.py - # install sudo python3 setup.py install # test whether it's working - himawaripy + himawaripy --auto-offset # Get the installation path of himawaripy by running the command which -- himawaripy @@ -72,26 +92,28 @@ You need a valid python3 installation including the python3-setuptools package: crontab -e ### Add the line: - */10 * * * * + */10 * * * * # command line arguments here ## OR, alternatively use the provided systemd timer ### Configure vi systemd/himawaripy.service - # Replace "" with the output of the aforementioned command. + # Replace "" with the output of the aforementioned command and command line arguments ### Copy systemd configuration - cp systemd/himawaripy.{service,timer} $HOME/.config/systemd/user/ + cp systemd/himawaripy.{service,timer} ~/.config/systemd/user/ ### Enable and start the timer systemctl --user enable --now himawaripy.timer ### For KDE Users #### KDE 5.7+ -To change the wallpaper in KDE 5.7+, desktop widgets must be unlocked. If you dom't want to leave them unlocked, the pre-KDE 5.7 method can still be used. +To change the wallpaper in KDE 5.7+, desktop widgets must be unlocked. If you dom't want to leave them unlocked, +the pre-KDE 5.7 method can still be used. To unlock desktop widgets ([from the KDE userbase](https://userbase.kde.org/Plasma#Widgets)): -> Open the Desktop Toolbox or the Panel Toolbox or right click on the Desktop - if you see an item labeled Unlock Widgets then select that, and then proceed to add widgets to your Desktop or your Panel. +> Open the Desktop Toolbox or the Panel Toolbox or right click on the Desktop - if you see an item labeled Unlock +> Widgets then select that, and then proceed to add widgets to your Desktop or your Panel. #### Before KDE 5.7 > So the issue here is that KDE does not support changing the desktop wallpaper @@ -112,18 +134,21 @@ Many thanks to [xenithorb](https://github.com/xenithorb) [for the solution](http ### For Mac OSX Users -OSX has deprecated crontab, and replaced it with `launchd`. To set up a launch agent, copy the provided sample `plist` file in `osx/com.user.himawaripy.plist` to `~/Library/LaunchAgents`, and edit the following entries if required +OSX has deprecated crontab, and replaced it with `launchd`. To set up a launch agent, copy the provided sample `plist` +file in `osx/org.boramalper.himawaripy.plist` to `~/Library/LaunchAgents`, and edit the following entries if required mkdir -p ~/Library/LaunchAgents/ - cp osx/com.user.himawaripy.plist ~/Library/LaunchAgents/ + cp osx/org.boramalper.himawaripy.plist ~/Library/LaunchAgents/ -* `ProgrammingArguments` needs to be the `/path/to/himawaripy/installation`. This *should* be `/usr/local/bin/himawaripy` by default, but himawaripy may be installed elsewhere. +* `ProgrammingArguments` needs to be the path to himawaripy installation. This *should* be `/usr/local/bin/himawaripy` +by default, but himawaripy may be installed elsewhere. -* `StartInterval` controls the interval between successive runs, set to 10 minutes (600 seconds) by default, edit as desired. +* `StartInterval` controls the interval between successive runs, set to 10 minutes (600 seconds) by default, +edit as desired. Finally, to launch it, enter this into the console: - launchctl load ~/Library/LaunchAgents/com.user.himawaripy.plist + launchctl load ~/Library/LaunchAgents/org.boramalper.himawaripy.plist ## Uninstallation @@ -136,20 +161,12 @@ Finally, to launch it, enter this into the console: systemctl --user disable --now himawaripy.timer rm $HOME/.config/systemd/user/himawaripy.{timer,service} - # Remove the data directory - # By default, `~/.himawari`. Check `output_file` variable in config.py - # in case you've changed it. - rm -rf ~/.himawari - # Uninstall the package sudo pip3 uninstall himawaripy If you would like to share why, you can contact me on github or [send an e-mail](mailto:bora@boramalper.org). -## Example -![Earth, as 2016/02/04/13:30:00 GMT](http://i.imgur.com/4XA6WaM.jpg) - ## Attributions Thanks to *[MichaelPote](https://github.com/MichaelPote)* for the [initial implementation](https://gist.github.com/MichaelPote/92fa6e65eacf26219022) using diff --git a/himawaripy/__main__.py b/himawaripy/__main__.py new file mode 100755 index 0000000..7a3b401 --- /dev/null +++ b/himawaripy/__main__.py @@ -0,0 +1,194 @@ +#!/usr/bin/env python3 + +import argparse +from datetime import timedelta, datetime +import io +import itertools as it +import json +import multiprocessing as mp +import multiprocessing.dummy as mp_dummy +import os +import os.path as path +import sys +from time import strptime, strftime, mktime +import urllib.request +from glob import iglob, glob +import threading +import time + +import appdirs +from PIL import Image +from dateutil.tz import tzlocal + +from .utils import set_background, get_desktop_environment + + +# Semantic Versioning: Major, Minor, Patch +HIMAWARIPY_VERSION = (2, 0, 0) +counter = None +HEIGHT = 550 +WIDTH = 550 + + +def calculate_time_offset(latest_date, auto, preferred_offset): + if auto: + preferred_offset = int(datetime.now(tzlocal()).strftime("%z")[0:3]) + print("Detected offset: UTC{:+03d}:00".format(preferred_offset)) + if 11 >= preferred_offset > 10: + preferred_offset = 10 + print("Offset is greater than +10, +10 will be used...") + elif 12 >= preferred_offset > 11: + preferred_offset = -12 + print("Offset is greater than +10, -12 will be used...") + + himawari_offset = 10 # UTC+10:00 is the time zone that himawari is over + offset = int(preferred_offset - himawari_offset) + + offset_tmp = datetime.fromtimestamp(mktime(latest_date)) + timedelta(hours=offset) + offset_time = offset_tmp.timetuple() + + return offset_time + + +def download_chunk(args): + global counter + + x, y, latest, level = args + url_format = "http://himawari8.nict.go.jp/img/D531106/{}d/{}/{}_{}_{}.png" + url = url_format.format(level, WIDTH, strftime("%Y/%m/%d/%H%M%S", latest), x, y) + + tiledata = download(url) + + with counter.get_lock(): + counter.value += 1 + if counter.value == level * level: + print("Downloading tiles: completed.") + else: + print("Downloading tiles: {}/{} completed...".format(counter.value, level * level)) + return x, y, tiledata + + +def parse_args(): + parser = argparse.ArgumentParser(description="set (near-realtime) picture of Earth as your desktop background", + epilog="http://labs.boramalper.org/himawaripy") + + parser.add_argument("--version", action="version", version="%(prog)s {}.{}.{}".format(*HIMAWARIPY_VERSION)) + + group = parser.add_mutually_exclusive_group() + + group.add_argument("--auto-offset", action="store_true", dest="auto_offset", default=False, + help="determine offset automatically") + group.add_argument("-o", "--offset", type=int, dest="offset", default=10, + help="UTC time offset in hours, must be less than or equal to +10") + + parser.add_argument("-l", "--level", type=int, choices=[4, 8, 16, 20], dest="level", default=4, + help="increases the quality (and the size) of each tile. possible values are 4, 8, 16, 20") + parser.add_argument("-d", "--deadline", type=int, dest="deadline", default=6, + help="deadline in minutes to download all the tiles, set 0 to cancel") + parser.add_argument("--save-battery", action="store_true", dest="save_battery", default=False, + help="stop refreshing on battery") + parser.add_argument("--output-dir", type=str, dest="output_dir", + help="directory to save the temporary background image", + default=appdirs.user_cache_dir(appname="himawaripy", appauthor=False)) + + args = parser.parse_args() + + if not -12 <= args.offset <= 10: + sys.exit("OFFSET has to be between -12 and +10!\n") + + if not args.deadline >= 0: + sys.exit("DEADLINE has to be greater than (or equal to if you want to disable) zero!\n") + + return args + + +def is_discharging(): + if not sys.platform.startswith("linux"): # I hope this will not end up like Windows 95/98 checks one day... + sys.exit("Battery saving feature works only on linux!\n") + + if len(glob("/sys/class/power_supply/BAT*")) > 1: + print("Multiple batteries detected, using BAT0.") + + with open("/sys/class/power_supply/BAT0/status") as f: + status = f.readline().strip() + + return status == "Discharging" + + +def download(url): + exception = None + + for i in range(1, 4): # retry max 3 times + try: + with urllib.request.urlopen(url) as response: + return response.read() + except Exception as e: + exception = e + print("[{}/3] Retrying to download '{}'...".format(i, url)) + time.sleep(1) + pass + + if exception: + raise exception + else: + sys.exit("Could not download '{}'!\n".format(url)) + + +def thread_main(args): + global counter + counter = mp.Value("i", 0) + + level = args.level # since we are going to use it a lot of times + + print("Updating...") + latest_json = download("http://himawari8-dl.nict.go.jp/himawari8/img/D531106/latest.json") + latest = strptime(json.loads(latest_json.decode("utf-8"))["date"], "%Y-%m-%d %H:%M:%S") + + print("Latest version: {} GMT.".format(strftime("%Y/%m/%d %H:%M:%S", latest))) + requested_time = calculate_time_offset(latest, args.auto_offset, args.offset) + if args.auto_offset or args.offset != 10: + print("Offset version: {} GMT.".format(strftime("%Y/%m/%d %H:%M:%S", requested_time))) + + png = Image.new("RGB", (WIDTH * level, HEIGHT * level)) + + p = mp_dummy.Pool(level * level) + print("Downloading tiles...") + res = p.map(download_chunk, it.product(range(level), range(level), (requested_time,), (args.level,))) + + for (x, y, tiledata) in res: + tile = Image.open(io.BytesIO(tiledata)) + png.paste(tile, (WIDTH * x, HEIGHT * y, WIDTH * (x + 1), HEIGHT * (y + 1))) + + for file in iglob(path.join(args.output_dir, "himawari-*.png")): + os.remove(file) + + output_file = path.join(args.output_dir, strftime("himawari-%Y%m%dT%H%M%S.png", requested_time)) + print("Saving to '%s'..." % (output_file,)) + os.makedirs(path.dirname(output_file), exist_ok=True) + png.save(output_file, "PNG") + + if not set_background(output_file): + sys.exit("Your desktop environment '{}' is not supported!\n".format(get_desktop_environment())) + + +def main(): + args = parse_args() + + print("himawaripy {}.{}.{}".format(*HIMAWARIPY_VERSION)) + + if args.save_battery and is_discharging(): + sys.exit("Discharging!\n") + + main_thread = threading.Thread(target=thread_main, args=(args,), name="himawaripy-main-thread", daemon=True) + main_thread.start() + main_thread.join(args.deadline * 60 if args.deadline else None) + + if args.deadline and main_thread.is_alive(): + sys.exit("Timeout!\n") + + print() + sys.exit(0) + + +if __name__ == "__main__": + main() diff --git a/himawaripy/config.py b/himawaripy/config.py deleted file mode 100644 index 6792014..0000000 --- a/himawaripy/config.py +++ /dev/null @@ -1,18 +0,0 @@ -import appdirs - -# Increases the quality and the size. Possible values: 4, 8, 16, 20 -level = 4 - -# Define a hourly offset or let the script calculate it depending on your timezone -# If auto_offset is True, then script will calculate your hour offset automatically depending on your location. -# If hour_offset is greater than 0, then script will use it. -# If both of the variables are set different than their default values below, then script will raise an error. Here, -# using the default values, script will put the realtime picture of Earth. -auto_offset = True -hour_offset = 0 - -# Path to the output directory -output_dir = appdirs.user_cache_dir(appname="himawaripy", appauthor=False) - -# Deadline for the whole download process in minutes -dl_deadline = 6 diff --git a/himawaripy/himawaripy.py b/himawaripy/himawaripy.py deleted file mode 100755 index 8ed86c5..0000000 --- a/himawaripy/himawaripy.py +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env python3 - -from datetime import datetime, timedelta -from io import BytesIO -from itertools import product -from json import loads -from multiprocessing import Pool, cpu_count, Value -from os import makedirs, remove -from os.path import dirname, join -from time import strptime, strftime, mktime -from urllib.request import urlopen -from socket import timeout as TimeoutException -from glob import iglob - -from PIL import Image -from pytz import timezone -from dateutil.tz import tzlocal - -from .config import level, output_dir, auto_offset, hour_offset , dl_deadline -from .utils import set_background, get_desktop_environment - -counter = None -height = 550 -width = 550 -dl_timeout = dl_deadline * 60 / (level ** 2) - - -def get_time_offset(latest_date): - if auto_offset: - local_date = datetime.now(tzlocal()) - himawari_date = datetime.now(timezone('Australia/Sydney')) - local_offset = local_date.strftime("%z") - himawari_offset = himawari_date.strftime("%z") - - offset = int(local_offset) - int(himawari_offset) - offset /= 100 - - offset_tmp = datetime.fromtimestamp(mktime(latest_date)) - offset_tmp = offset_tmp + timedelta(hours=offset) - offset_time = offset_tmp.timetuple() - - elif hour_offset > 0: - offset_tmp = datetime.fromtimestamp(mktime(latest_date)) - offset_tmp = offset_tmp - timedelta(hours=hour_offset) - offset_time = offset_tmp.timetuple() - - return offset_time - - -def download_chunk(args): - global counter - - x, y, latest = args - url_format = "http://himawari8.nict.go.jp/img/D531106/{}d/{}/{}_{}_{}.png" - url = url_format.format(level, width, strftime("%Y/%m/%d/%H%M%S", latest), x, y) - - with urlopen(url , timeout=dl_timeout) as tile_w: - tiledata = tile_w.read() - - with counter.get_lock(): - counter.value += 1 - print("\rDownloading tiles: {}/{} completed".format(counter.value, level * level), end="", flush=True) - return x, y, tiledata - - -def main(): - global counter - - if auto_offset and hour_offset: - exit("You can not set `auto_offset` to True and `hour_offset` to a value that is different than zero.") - elif hour_offset < 0: - exit("`hour_offset` must be greater than or equal to zero. I can't get future images of Earth for now.") - - print("Updating...") - with urlopen("http://himawari8-dl.nict.go.jp/himawari8/img/D531106/latest.json") as latest_json: - latest = strptime(loads(latest_json.read().decode("utf-8"))["date"], "%Y-%m-%d %H:%M:%S") - - print("Latest version: {} GMT".format(strftime("%Y/%m/%d %H:%M:%S", latest))) - if auto_offset or hour_offset > 0: - requested_time = get_time_offset(latest) - print("Offset version: {} GMT".format(strftime("%Y/%m/%d %H:%M:%S", requested_time))) - else: - requested_time = latest - - print() - - png = Image.new('RGB', (width * level, height * level)) - - try: - counter = Value("i", 0) - p = Pool(cpu_count() * level) - print("Downloading tiles: 0/{} completed".format(level * level), end="", flush=True) - try: - res = p.map(download_chunk, product(range(level), range(level), (requested_time,))) - except TimeoutException: - exit("\nTimeout while downloading tiles.") - finally: # Make sure that we terminate proccess pool, whatever happens... - p.terminate() - p.join() - - for (x, y, tiledata) in res: - tile = Image.open(BytesIO(tiledata)) - png.paste(tile, (width * x, height * y, width * (x + 1), height * (y + 1))) - - for file in iglob(join(output_dir, "himawari-*.png")): - remove(file) - - output_file = join(output_dir, strftime("himawari-%Y%m%dT%H%M%S.png", requested_time)) - print("\nSaving to '%s'..." % (output_file)) - makedirs(dirname(output_file), exist_ok=True) - png.save(output_file, "PNG") - - if not set_background(output_file): - exit("Your desktop environment '{}' is not supported.".format(get_desktop_environment())) - - print("Done!") - -if __name__ == "__main__": - main() diff --git a/himawaripy/utils.py b/himawaripy/utils.py index 044c1d5..9d0a3b9 100644 --- a/himawaripy/utils.py +++ b/himawaripy/utils.py @@ -28,7 +28,8 @@ def set_background(file_path): elif de == "lxde": subprocess.call(["pcmanfm", "--set-wallpaper", file_path, "--wallpaper-mode=fit", ]) elif de == "mac": - subprocess.call(["osascript", "-e", 'tell application "System Events"\n' + subprocess.call(["osascript", "-e", + 'tell application "System Events"\n' 'set theDesktops to a reference to every desktop\n' 'repeat with aDesktop in theDesktops\n' 'set the picture of aDesktop to \"' + file_path + '"\nend repeat\nend tell']) @@ -52,20 +53,19 @@ def set_background(file_path): "org.kde.PlasmaShell.evaluateScript", script.format(file_path)]) except subprocess.CalledProcessError as e: if "Widgets are locked" in e.output.decode("utf-8"): - print("!! Cannot change the wallpaper while widgets are locked.") - print("!! Please unlock widgets to allow wallpaper changing.\n") + print("Cannot change the wallpaper while widgets are locked! (unlock the widgets)") else: - print(e) + raise e else: - print("\nCouldn't detect plasmashell 5.7 or higher.") + print("Couldn't detect plasmashell 5.7 or higher.") elif has_program("feh"): - print("\nCouldn't detect your desktop environment ('{}'), but you have" - "'feh' installed so we will use it.".format(de)) + print("Couldn't detect your desktop environment ('{}'), but you have" + "'feh' installed so we will use it...".format(de)) os.environ['DISPLAY'] = ':0' subprocess.call(["feh", "--bg-max", file_path]) elif has_program("nitrogen"): - print("\nCouldn't detect your desktop environment ('{}'), but you have " - "'nitrogen' installed so we will use it.".format(de)) + print("Couldn't detect your desktop environment ('{}'), but you have " + "'nitrogen' installed so we will use it...".format(de)) os.environ["DISPLAY"] = ':0' subprocess.call(["nitrogen", "--restore"]) else: @@ -145,7 +145,7 @@ def has_program(program): def plasma_version(): try: output = subprocess.Popen(["plasmashell", "-v"], stdout=subprocess.PIPE).communicate()[0].decode("utf-8") - print("\nRunning", output) + print("Plasma version '{}'.".format(output)) version = re.match(r"plasmashell (.*)", output).group(1) return LooseVersion(version) except (subprocess.CalledProcessError, IndexError): diff --git a/osx/com.user.himawaripy.plist b/osx/org.boramalper.himawaripy.plist similarity index 92% rename from osx/com.user.himawaripy.plist rename to osx/org.boramalper.himawaripy.plist index dd07831..5cd53cf 100644 --- a/osx/com.user.himawaripy.plist +++ b/osx/org.boramalper.himawaripy.plist @@ -3,7 +3,7 @@ Label - com.user.himawaripy + org.boramalper.himawaripy ProgramArguments diff --git a/setup.py b/setup.py index a1f991f..6a2432d 100644 --- a/setup.py +++ b/setup.py @@ -2,16 +2,16 @@ setup( - name='himawaripy', - version='1.1', - url='https://github.com/boramalper/himawaripy', - author='Mert Bora Alper', - author_email='bora@boramalper.org', - license='MIT', - description='Put near-realtime picture of Earth as your desktop background', - long_description='himawaripy is a Python 3 script that fetches near-realtime (10 minutes delayed) picture of Earth ' - 'as its taken by Himawari 8 (ひまわり8号) and sets it as your desktop background.', - install_requires=["appdirs", "pillow", "python-dateutil", "pytz"], + name="himawaripy", + version="2.0.0", + url="http://labs.boramalper.org/himawaripy", + author="Mert Bora Alper", + author_email="bora@boramalper.org", + license="MIT", + description="Set near-realtime picture of Earth as your desktop background", + long_description="himawaripy is a Python 3 script that fetches near-realtime (10 minutes delayed) picture of Earth " + "as its taken by Himawari 8 (ひまわり8号) and sets it as your desktop background.", + install_requires=["appdirs", "pillow", "python-dateutil"], packages=find_packages(), - entry_points={'console_scripts': ['himawaripy=himawaripy.himawaripy:main']}, + entry_points={"console_scripts": ["himawaripy=himawaripy.__main__:main"]}, )