Skip to main content

Lightweight Python wrapper around the NASA Exoplanet Archive.

Project description

oplanet

Lightweight Python wrapper around the NASA Exoplanet Archive and the SVO database with practical helpers for stellar aliases, photometry, and system/planet properties.

This package is built to make exoplanet metadata easier to use in notebooks and scripts by exposing a simple object API and automatically selecting the most reliable published values.

Installation

From pip (recommended)

pip install oplanet

From GitHub

pip install "git+https://github.com/ProfesseurShadoko/oplanet.git"

Requirements

Dependencies are listed in requirements.txt:

  • oakley
  • numpy
  • pandas
  • astroquery
  • astropy
  • scipy
  • matplotlib
  • requests

Quick examples

For a guided walkthrough with explanations and runnable cells, see examples.ipynb.

1. Resolve star names and aliases

from oplanet import parse_star_name, get_star_aliases

print(parse_star_name("TOI 1478"))
print(get_star_aliases("TOI 1478"))

2. Explore a system, its star, and its planets

from oplanet import NSystem

system = NSystem("LHS 1140")

print(system.star_name)
print(system.n_planets)

# Returns [value, err1, err2] when available,
# or [nan, upper_limit, lower_limit] when only limits exist
print(system.distance_pc)
print(system.star.age_myr)

print(system.b.mass_mjup)
print(system.b.orbital_period_yrs)

3. One-line import for common API

from oplanet import NSystem, parse_star_name, get_star_aliases, get_photometry_jy, SFilter

4. Pretty-print helpers (display and print_column)

from oplanet import NSystem

system = NSystem("LHS 1140")

# Human-readable summary of system properties
system.display()

# Human-readable summary for star and a planet
system.star.display()
system.b.display()

Returned values

Most numeric property getters in the object API return a NumPy array with 3 entries:

  • value: best selected value
  • err_pos: positive uncertainty
  • err_neg: negative uncertainty

When no direct value is available and only limits are present, the returned array is:

  • nan, limit_upper, limit_lower

Examples:

system = NSystem("LHS 1140")

age = system.star.age_myr
distance = system.distance_pc

print(age)       # e.g. [value, err_pos, err_neg] or [nan, upper, lower]
print(distance)  # same convention

Data behavior

On import, the loader keeps a local CSV cache in oplanet/data, removes older archive snapshots, and refreshes stale files automatically. Filters retrieved from the SVO database are also stored locally.

Notes

  • Internet access is needed for Simbad/Vizier queries and first-time archive download.
  • The support for exoplanet.eu will be added once the database becomes more reliable and code friendly.

License

MIT

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

oplanet-1.3.1.tar.gz (30.1 kB view details)

Uploaded Source

Built Distribution

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

oplanet-1.3.1-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

Details for the file oplanet-1.3.1.tar.gz.

File metadata

  • Download URL: oplanet-1.3.1.tar.gz
  • Upload date:
  • Size: 30.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for oplanet-1.3.1.tar.gz
Algorithm Hash digest
SHA256 3958457187a2b96db245eacf54797959916b4e38fbbd52b12060e585a3f2d1f9
MD5 c03acda58f50545698a69260f7073e18
BLAKE2b-256 ff8ec537542d0481fbd1dfbd911337caa744ffd34c319ffc9fc44c03e8085412

See more details on using hashes here.

File details

Details for the file oplanet-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: oplanet-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 30.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for oplanet-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 22f9e9929ed10baf3aefff47d9421e2d09a3cd52563eeebe8578af9a4e8674ae
MD5 947ad399d15a3c2472b09cd064c73581
BLAKE2b-256 afc628fabdb9f2d6da62288422cc00cf355b0a81a5d2fb1078ca7f178f44ac81

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