{"id":23109,"library":"gwosc","title":"GW Open Science Data Archive client","description":"A python interface to the Gravitational Wave Open Science Center (GWOSC) data archive. Version 0.8.2 requires Python >=3.10. Regular releases, roughly quarterly.","status":"active","version":"0.8.2","language":"python","source_language":"en","source_url":"https://github.com/gwpy/gwosc","tags":["gravitational-waves","open-data","science","astronomy","api-client"],"install":[{"cmd":"pip install gwosc","lang":"bash","label":"PyPI install"}],"dependencies":[],"imports":[{"note":"GWOSC is a class in the api module, not a submodule.","wrong":"import gwosc.GWOSC","symbol":"GWOSC","correct":"from gwosc.api import GWOSC"},{"note":"fetch_json is not exposed at package level.","wrong":"from gwosc import fetch_json","symbol":"fetch_json","correct":"from gwosc.api import fetch_json"},{"note":"dataset is a function in the datasets module.","wrong":"from gwosc import dataset","symbol":"dataset","correct":"from gwosc.datasets import dataset"},{"note":"run_query is in the api module, not top-level.","wrong":"from gwosc import run_query","symbol":"run_query","correct":"from gwosc.api import run_query"},{"note":"Event is a class in the datasets module.","wrong":"from gwosc import Event","symbol":"Event","correct":"from gwosc.datasets import Event"}],"quickstart":{"code":"from gwosc.datasets import dataset\nfrom gwosc.api import fetch_json\n\n# List datasets\ndatasets = dataset()\nprint(datasets)\n\n# Query for event details\njson_data = fetch_json('https://www.gw-openscience.org/api/v2/events/GW150914/')\nprint(json_data)\n","lang":"python","description":"Basic usage: list datasets and fetch event metadata from the API."},"warnings":[{"fix":"Use the provided functions like fetch_json with the new base URL, or update URLs to https://www.gw-openscience.org/api/v2/.","message":"The API endpoint changed from /archive/ to /api/v2/. Old code using direct URL construction will break.","severity":"breaking","affected_versions":"<0.7.0"},{"fix":"Replace `from gwosc.datasets import find_datasets` with `from gwosc.datasets import dataset` and call `dataset()`.","message":"The function `datasets.find_datasets` is deprecated in favor of `dataset()`.","severity":"deprecated","affected_versions":">=0.6.0"},{"fix":"Use `datasets = dataset(); [d['dataset'] for d in datasets]` to extract names if needed.","message":"The `dataset()` function returns a list of URLs, not dataset names. Many users expect names and try to use them directly in API calls.","severity":"gotcha","affected_versions":"all"},{"fix":"Set the `User-Agent` header: `fetch_json(url, headers={'User-Agent': 'MyApp/1.0'})`.","message":"Running `fetch_json` without a proper user-agent may result in HTTP 403 errors from the GWOSC servers.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"from gwosc.datasets import dataset","cause":"dataset is not a top-level export; it lives in the datasets submodule.","error":"ImportError: cannot import name 'dataset' from 'gwosc'"},{"fix":"pip install --upgrade gwosc to get latest version that ensures submodules are importable.","cause":"The package name is 'gwosc', but the api module may not be imported on Python 3.10+ due to namespace changes.","error":"AttributeError: module 'gwosc' has no attribute 'api'"},{"fix":"Use the URL returned by `dataset()` or construct it: f'https://www.gw-openscience.org/api/v2/events/{name}/'","cause":"Passing a dataset name instead of a URL to API functions.","error":"ValueError: Unknown dataset ..."},{"fix":"Update URL to use the /api/v2/ prefix.","cause":"Using old API endpoint (e.g., /archive/ instead of /api/v2/).","error":"HTTPError: 404 Client Error: Not Found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}