Skip to main content

Query whereistheplanet.com from Python

Project description

Query the Planet

Query <whereistheplanet.com> from Python.

There is already a Python version of whereistheplanet, but it is requires orbitize! and git-lfs, plus it is not available on PyPI.

This aims to be a lighter version with no dependencies that directly queries the website. This means it does require a network connection.

Installation

Install directly from PyPI:

python -m pip install querytheplanet

Installing for development

To install for development, first clone the repository (or ideally your fork of it), e.g.:

git clone https://github.com/vandalt/querytheplanet.git

Then install with development dependencies in editable mode:

python -m pip install -e ".[dev]"

To run the tests, do:

python -m pytest

Usage

Command line

List available planets:

querytheplanet -l

Query one or more planet positions for today:

querytheplanet 51erib betapicb

Query the position of one or more planets for a given date:

querytheplanet 51erib betapicb --date 2026-05-01

Query the position of one or more planets for a multiple dates:

querytheplanet 51erib betapicb --date 2023-01-01 2026-05-01

Save the results to a CSV:

querytheplanet 51erib betapicb --date 2023-01-01 2026-05-01 --output results.csv

Display help:

querytheplanet -h

From Python

The main functionality is accessible from the querytheplanet module directly. Here is a small script with examples:

import querytheplanet as qtp

# Get a list of available planets that can be used in queries
all_planets = qtp.fetch_available_planets()

# Query a single planet's location for today
pos_df = query_planet_locations("51erib")

# Query for another date
pos_df_date =query_planet_locations("51erib", date="2025-01-01")

# Query multiple planets and multiple dates
pos_df_multi = query_planet_locations(["51erib", "betapicb"], date=["2025-01-01", "2026-05-01"])

The query outputs are always returned as pandas Dataframes. To print the outputs in a more readable format, pass verbose=True to query_planet_locations().

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

querytheplanet-0.1.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

querytheplanet-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file querytheplanet-0.1.0.tar.gz.

File metadata

  • Download URL: querytheplanet-0.1.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for querytheplanet-0.1.0.tar.gz
Algorithm Hash digest
SHA256 192a6206f4cda15f68437acd3978e39cc80337e29a7bc581081eec2dfa2e9ced
MD5 498fa17c5ea9080d1cc39e5b05745d92
BLAKE2b-256 44b0bd8c3f7c283e83748381fd71718f82d1d2e91bcdf44143eb5637c0351adb

See more details on using hashes here.

File details

Details for the file querytheplanet-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: querytheplanet-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for querytheplanet-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe327d6845113e6600e2cad8d06fdc6fdc4f43c3123c5211c4bb49220faa4dad
MD5 340b9bdbffc2c6fc25b0ec8d13ff942b
BLAKE2b-256 c4d809cf36d61ab5d0fa760299fa448a366dc72f69ab2e8af1cd87f640b43c46

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page