Skip to main content

pyExoplaneteu

A pure-Python package to download data from the Extrasolar Planets Encyclopaedia

This small package downloads all the data from the exoplanet.eu online catalogue of exoplanets and builds a (custom) dictionary with each column. It is a pure-Python package with no extra dependencies (see below).

License MIT Travis build PyPI version

How to use

Install it from pip (pyExoplaneteu has no extra depencies)

pip install pyExoplaneteu

and it’s ready to use from Python

import pyexoplaneteu

pyExoplaneteu has one simple function, get_data(), which downloads the data from the online archive and returns it in a dictionary.

>>> data = pyexoplaneteu.get_data()
Downloading exoplanet.eu data
Saved exoplanet.eu data to $HOME/.pyexoplaneteu/exoplanetEU.csv
Data in `exoplanetEU.csv` is recent.
There are 98 columns with 3793 entries each in `exoplanetEU.csv`

where $HOME will be your home directory. The second time you call get_data() it will check if the data was downloaded recently, and only conditionally download it again.

>>> data = pyexoplaneteu.get_data()
Data in `exoplanetEU.csv` is recent.
There are 98 columns with 3793 entries each in `exoplanetEU.csv`

Now, data is (basically) a Python dictionary with the each column as keys. But it has a couple extra methods and properties. For example

>>> data.size
3793

returns the number of values in each column. The columns() method

>>> data.columns()
['name', 'planet_status', 'mass', 'mass_error_min', 'mass_error_max',
 'mass_sini', 'mass_sini_error_min', 'mass_sini_error_max', 'radius',
  'radius_error_min', 'radius_error_max', 'orbital_period',
  ...

will print the available columns.

The columns can be accessed as in a normal dictionary, with

data['name']  # the name of the planet
data['mass']  # the mass of the planet
data['star_radius']  # the radius of the host star

Also, to drop the NaN values in a column (for some columns there will be quite a few) we can use

data['mass_nonan']

np.isnan(data['mass']).any()       # True
np.isnan(data['mass_nonan']).any() # False

which allows us to more easily do histograms of the values.

Finnally, the .to_numpy(inplace=True) method converts all the columns to numpy arrays, either in place or not (this is the only function in pyExoplaneteu that requires numpy).

License

Copyright 2018 João Faria.

pyExoplaneteu is free software made available under the MIT License. For details see the LICENSE file.

Metadata

Release files for pyExoplaneteu 1.0.3

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

Source distribution (sdist)

Source distribution for pyExoplaneteu 1.0.3
File Size Uploaded
pyExoplaneteu-1.0.3.tar.gz 8.1 kB Details

Built distribution (wheel)

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

Total release size: 15.9 kB

Release files / pyExoplaneteu-1.0.3.tar.gz

Download URL pyExoplaneteu-1.0.3.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0f5f7d967a162a2b9a445bc355416990fae9995605aebce2705ee8ea815716e8
BLAKE2b-256 checksum
How to use checksums
62b2bb06cfe9acf2d9e3882f8a9dbf5bd616e8e4b330bf3505cbf1ccfacc793c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

Release files / pyExoplaneteu-1.0.3-py3-none-any.whl

Download URL pyExoplaneteu-1.0.3-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
59c606831b6fb5279507efaf141d47ec516f39190d169f67fbb9c7bb7ed51d81
BLAKE2b-256 checksum
How to use checksums
948e1c32a1a064fedf1e4cb42addbbe89028484cc3f1edede190acb244a2f3a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

1 release file

1.0.1

2 release files

1.0

2 release files

0.1

2 release files

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