/jwstapipy

Simple library for access to data from jwstapi.com (James Webb Space Telescope)

Primary LanguagePythonMIT LicenseMIT

JWSTapipy

CodeQL PyPI - Downloads PyPI

PyPI - Python Version

Simple python library for access to data from jwstapi.com

Description

JWSTapipy is a simple python library to work with data provided by the site https://jwstapi.com/ The site provides James Webb Space Telescope data. Data is sourced from MAST, processed and exposed through API.

Tested on JWST API version 0.0.15

Get JWSTapipy

pip install jwstapipy

Examples

Get list of programs

import asyncio
import jwstapipy

async def main(api_key):
    jwst = JwstAPI(api_key)
    
    programs = await jwst.get_programs_list()
    print(programs)

if __name__ == "__main__":
    asyncio.run(main('api_key'))

Get part of program data by ID

import asyncio
import jwstapipy

async def main(api_key):
    jwst = JwstAPI(api_key)
    
    program_data = await jwst.get_program_data(program_id=2731, first_page=1, last_page=2)
    print(program_data)

if __name__ == "__main__":
    asyncio.run(main('api_key'))