kplr
Python bindings for the MAST interface to the Kepler dataset.
Installation
You can install the module by running:
pip install kplr
If you want to access the MAST API, you’ll need the requests module and if you want to load light curve data sets, you’ll need numpy and pyfits.
Usage
You’ll access the API using a kplr.API object:
import kplr
client = kplr.API()
To get information about the planet “Kepler 62b” (for example), you would run the command:
planet = client.planet("62b") # or "Kepler-62 b"
This object has a lot of attributes (with names given by the MAST documentation) such as a period:
print(planet.koi_period)
# 5.715
For some reason, the KOI table tends to have more precise measurements so we can look at that instead:
koi = planet.koi
print("{0.koi_period} ± {0.koi_period_err1}".format(koi))
# 5.71493 ± 0.00019
The attributes of the KOI object are given in the MAST description of the kepler/koi table. You can also directly query the KOI table using:
koi = client.koi("256.01")
To download all the data for this KOI (or equivalently, the above planet), you can try:
datasets = [dataset.fetch() for dataset in koi.data]
This will download the FITS files containing the light curves to the directory given by the KPLR_DATA_DIR environment variable (or ~/.kplr/data by default). To load one of the files, you’ll need to make sure that you have pyfits installed and then you can use the Dataset object:
data = kplr.Dataset(datasets[0].filename)
Metadata
Release files for kplr 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kplr-0.1.1.tar.gz | 13.9 kB | Without provenance | Details for kplr-0.1.1.tar.gz |
Release files / kplr-0.1.1.tar.gz
| Download URL | kplr-0.1.1.tar.gz |
|---|---|
| Size | 13.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6817f310b50ced63bdf83838fe65334495b90cc394578ec156db94e9b0d9315d
|
|
BLAKE2b-256 checksum How to use checksums |
f6725741258a6926d6f4f3344923b8c407b6129d160f1ca829d5d665aad81250
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for kplr 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.