{"id":21419,"library":"gwdatafind","title":"gwdatafind","description":"A Python client for the GWDataFind service, used to discover and retrieve Gravitational-Wave data files (e.g., HDF5, GWF) from archives like LIGO/Virgo. Current version 2.1.1, released 2024-12-02. Active development, new releases every few months.","status":"active","version":"2.1.1","language":"python","source_language":"en","source_url":"https://github.com/gwpy/gwdatafind","tags":["ligo","gravitational-waves","data-discovery","hdf5","gwf"],"install":[{"cmd":"pip install gwdatafind","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Authentication for protected data endpoints","package":"ligo-auth-tokens","optional":true},{"reason":"Alternative authentication using IGWN SciToken","package":"igwn-auth-utils","optional":true}],"imports":[{"note":"Since v2.0, connect is a function in the top-level namespace. Using old import will raise AttributeError.","wrong":"from gwdatafind import connect","symbol":"connect","correct":"import gwdatafind"},{"note":"DataFindAPI was removed in v2.0; use the connect function instead.","wrong":"from gwdatafind import DataFindAPI","symbol":"DataFindAPI","correct":"import gwdatafind"}],"quickstart":{"code":"import os\nimport gwdatafind\n\n# Set token if available (optional for public data)\nos.environ.get('IGWN_AUTH_TOKEN', '')\n\n# Connect to the default LIGO/Virgo archive\nconnection = gwdatafind.connect()\n\n# Find all frames for a specific observatory and GPS time\nframes = connection.find_frames('H1', 1126257414, 1126257416)\nfor frame in frames:\n    print(frame.url)\n\n# Find specific types of data (e.g., trend data)\ntrends = connection.find_types('H1', 'H1_TREND')\nprint(trends)","lang":"python","description":"This example connects to the GWDataFind server, finds frame URLs for LIGO Hanford around the first GW detection, and lists available data types. No authentication required for public data."},"warnings":[{"fix":"Replace `from gwdatafind import DataFindAPI` with `import gwdatafind` and use `gwdatafind.connect()`.","message":"The `connect` function changed from `DataFindAPI` constructor in v1.x to a standalone function in v2.0. Old code using `DataFindAPI` will break.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Check exact observatory codes via `connection.find_observatories()`.","message":"The `find_types` method returns a list of strings, but the query is case-sensitive. Use exact observatory code (e.g., 'H1', 'L1', 'V1').","severity":"gotcha","affected_versions":"all"},{"fix":"Replace `connection.find_frame_types(obs, type)` with `connection.find_types(obs, type)`.","message":"The `find_frame_types` method is deprecated since v2.1 (slated for removal). Use `find_types` instead.","severity":"deprecated","affected_versions":">=2.1.0"},{"fix":"Pass `timeout` parameter to `connect()`: `gwdatafind.connect(timeout=120)`.","message":"Default connection timeout is 30 seconds; large queries may need increased timeout via `connect(timeout=120)`.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use `import gwdatafind` and call `gwdatafind.connect()` instead.","cause":"Code using the older v1.x API with v2.x installed.","error":"AttributeError: module 'gwdatafind' has no attribute 'DataFindAPI'"},{"fix":"Set the IGWN_AUTH_TOKEN environment variable or install ligo-auth-tokens and run `ligo-token`.","cause":"Connecting to a protected endpoint without setting IGWN_AUTH_TOKEN.","error":"gwdatafind.exceptions.AuthenticationError: No authentication token found"},{"fix":"Use `gwdatafind.connect(service='https://datafind.ligo.org:443')` instead of `host=`.","cause":"The `host` parameter was removed in v2.0; use `service` to specify the service endpoint.","error":"TypeError: connect() got an unexpected keyword argument 'host'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}