Skip to main content

legos.apod

Travis PyPI PyPI

PyPI PyPI PyPI

Fetch xkcd comics right from chat using this xkcd lego.

Usage

  • !apod returns the latest photo
  • !apod r or !apod random will return a random photo
  • !apod [yyyy-mm-dd] will return the photo of corresponding date

API Key

The NASA api has strict limits. These can be mitigated by getting an api key. To add your api_key, send it in with adding your APOD as a baseplate child. It should look like this:

baseplate_proxy.add_child(APOD, key=your_api_key_goes_here)

Installation

cd into the current directory pip3 install .

This is a Lego designed for use with Legobot, so you'll get Legobot along with this. To deploy it, import the package and add it to the active legos like so:

# This is the legobot stuff
from Legobot import Lego
# This is your lego
from legos.apod import APOD

# Legobot stuff here
lock = threading.Lock()
baseplate = Lego.start(None, lock)
baseplate_proxy = baseplate.proxy()

# Add your lego
baseplate_proxy.add_child(APOD, key=your_api_key_goes_here)

Tweaking

While you can use this one as-is, you could also add a localized version to your Legobot deployment by grabbing apod.py and deploying it as a local module. Example of a Legobot instance with local modules

Contributing

As always, pull requests are welcome.

Release files for legos.apod 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for legos.apod 0.1.2
File Size Uploaded
legos.apod-0.1.2.tar.gz 15.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for legos.apod 0.1.2
File Interpreter ABI Platform
legos.apod-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 31.4 kB

Release files / legos.apod-0.1.2.tar.gz

Download URL legos.apod-0.1.2.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
807a74ba6d55494a44dfea3ac6207c6371dba0a2ca4874efb7381b0979a43426
BLAKE2b-256 checksum
How to use checksums
671ea193cb8c308f9dbc129fb6d4448fea9ced2d162eebb9ae85fcf603ca11ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.11

Release files / legos.apod-0.1.2-py3-none-any.whl

Download URL legos.apod-0.1.2-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0399827574cbb39ce8da59ec802021d606b6978d13c80a8ba9ff1a8bacd30ebf
BLAKE2b-256 checksum
How to use checksums
bbfc168075444d4c46278b2ca48218367e7c1a2c5ef4da8afa9f6646e0558404
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.11

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page