Skip to main content

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

Project description

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.

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

pyExoplaneteu-1.0.1.post1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

pyExoplaneteu-1.0.1.post1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file pyExoplaneteu-1.0.1.post1.tar.gz.

File metadata

File hashes

Hashes for pyExoplaneteu-1.0.1.post1.tar.gz
Algorithm Hash digest
SHA256 ed1044d5c02429610ccaf5b5d7f8063eb11fa92b36e6d2d87ab8f1b27af69a3b
MD5 5adf63893571d27b5700d8f2cd1042b1
BLAKE2b-256 8f46bcb0c8893e21f095a16b23ee0aadd6eb85051f535d09580176a376f413e0

See more details on using hashes here.

File details

Details for the file pyExoplaneteu-1.0.1.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for pyExoplaneteu-1.0.1.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 f401642800f85c10a790c1caa7b2f26d8cc0ff701f706f62d98bfa0437e051fb
MD5 dd35c61bbccaa5446bf5d14b5d3a3ca3
BLAKE2b-256 7bd368f4bf33737f7589c1ec2b7f6b94a762c4651ec048e00d23eb940a17ee3e

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