If you're fascinated by space and love working with Python, I've developed a lightweight library called cosmotalker
that brings real-time space data and offline resources into your projects. This post walks through some of its capabilities and how it can be integrated into your Python environment.
🔭 What is CosmoTalker?
CosmoTalker is a Python library designed to help developers, students, and astronomy enthusiasts interact with:
- NASA's Astronomy Picture of the Day (APOD)
- Upcoming launches from SpaceX
- Satellite tracking data from CelesTrak
- Offline celestial body information
- Simple web searches (eco-friendly and educational)
- Wikipedia summaries on space topics
📦 Installation
You can install CosmoTalker on your machine using pip:
pip install cosmotalker
🧪 Example Usages
Here are a few snippets to help you get started:
import cosmotalker
# Chatbot feature
print(cosmotalker.chat())
import cosmotalker
## 💬 New in v1.6.1: Chatbot
print(cosmotalker.chat())
# Retrieve information about a celestial body
earth_info = cosmotalker.get("earth")
print(earth_info) # Offline function
# Provide feedback to improve CosmoTalker
print(cosmotalker.feedback())
# Online Features
print(cosmotalker.apod()) # Fetch Astronomy Picture of the Day
print(cosmotalker.celestrak()) # Get satellite tracking data
print(cosmotalker.search("yt")) # Opens YouTube
print(cosmotalker.search("words")) # Eco-friendly web search
print(cosmotalker.get("yuri")) # Deep search about Yuri
print(cosmotalker.spacex()) # SpaceX upcoming launches
print(cosmotalker.wiki("black hole")) # New wiki summary(v1.6)
# Retrieve info about Earth (offline)
earth_info = cosmotalker.get("earth")
print(earth_info)
# Provide feedback
print(cosmotalker.feedback())
# Online features
print(cosmotalker.apod()) # Astronomy Picture of the Day
print(cosmotalker.spacex()) # Upcoming SpaceX launches
print(cosmotalker.celestrak()) # Satellite tracking
print(cosmotalker.get("yuri")) # Deep search about Yuri Gagarin
print(cosmotalker.wiki("black hole")) # Wikipedia summary
print(cosmotalker.search("yt")) # Opens YouTube
print(cosmotalker.search("words")) # Eco-friendly search
🚧 Final Note
This library was built with simplicity and learning in mind. You're welcome to explore it, contribute, or use it as a base for your own space-related Python projects. It's freely available on PyPI and open for improvements.
If you end up using it in your projects or have suggestions, feel free to leave feedback through the built-in feedback()
function.
Thanks for reading, and keep exploring the stars!
Top comments (0)