APOD with python
Image by Wang Jin
Do you love APOD images? This repo give you an easy interface to obtain this images from the source with python. Also, if you run an Ubuntu OS with Gnome 3, a python script can be used to automatically change your wallpaper to your favourite apod.
Instalation
The package is already public in PyPi. You can easily install with pip:
python3 -m pip install apod
APOD package
The apod package is based in two objects: ApodExplorer and ApodImageDownloader. The ApodExplorer make requests for apod server and obtain the image url.
import apod
explorer = apod.ApodExplorer()
http_status = explorer.make_http_request(year=2022, month=6, day=27)
image_url = explorer.check_for_images()
The other object is responsible to download the image and save it:
downloader = apod.ApodImageDownloader(image_url)
# Obtain PIL image
image = downloader.get_image()
# Download and save
downloader.save_image(path=<DIRPATH>, name=<FILENAME>)
Wallpaper script
If you want to use the automatic apod wallpaper script you must install the apod package and clone the repo:
git clone https://github.com/Juanki0396/APOD_wallpaper.git
The script is very easy to use. The ussual operation will be:
python3 apod_wallpaper.py --date <YEAR> <MONTH> <DAY> --dirpath <DOWNLOAD DIR>
Metadata
Release files for apod 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| apod-0.1.0.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| apod-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.1 kB
Release files / apod-0.1.0.tar.gz
| Download URL | apod-0.1.0.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f3d72087cdb74944c9a5ed3114ce781ceb25b5ee73593954be518b85fa6d97c
|
|
BLAKE2b-256 checksum How to use checksums |
d83ee0bfe9ee316d3c907eb52d3436744ebb0b3697c78b59cb0f8e3e5255ba5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.5
|
Release files / apod-0.1.0-py3-none-any.whl
| Download URL | apod-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
180d936a0c1884b0244d328568bef915a5703f9fd3cf81f3e6cbbb073c997f91
|
|
BLAKE2b-256 checksum How to use checksums |
b536005145ff453c694d1bd30c4c8e2633b7fe2af2c2a954a5e97cdc10e3518e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.5
|