{"id":35279126,"url":"https://github.com/temuller/wiserep_api","last_synced_at":"2026-04-07T06:31:06.714Z","repository":{"id":160805515,"uuid":"635179400","full_name":"temuller/wiserep_api","owner":"temuller","description":"API to access WiserRep data from command lines","archived":false,"fork":false,"pushed_at":"2025-11-12T14:29:22.000Z","size":54,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-03T03:13:01.003Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/temuller.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-02T06:17:19.000Z","updated_at":"2025-11-12T14:29:27.000Z","dependencies_parsed_at":"2024-04-22T10:32:10.105Z","dependency_job_id":"8e811e19-e5cb-49c2-a909-72463c54e489","html_url":"https://github.com/temuller/wiserep_api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/temuller/wiserep_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temuller%2Fwiserep_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temuller%2Fwiserep_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temuller%2Fwiserep_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temuller%2Fwiserep_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/temuller","download_url":"https://codeload.github.com/temuller/wiserep_api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temuller%2Fwiserep_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31503380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-30T14:15:50.831Z","updated_at":"2026-04-07T06:31:06.710Z","avatar_url":"https://github.com/temuller.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WiseRep API\nAPI to access WiserRep data\n\n[![repo](https://img.shields.io/badge/GitHub-temuller%2Fwiserep_api-blue.svg?style=flat)](https://github.com/temuller/wiserep_api)\n[![license](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/temuller/wiserep_api/blob/master/LICENSE)\n![Python Version](https://img.shields.io/badge/Python-3.9%2B-blue)\n[![PyPI](https://img.shields.io/pypi/v/wiserep_api?label=PyPI\u0026logo=pypi\u0026logoColor=white)](https://pypi.org/project/wiserep_api/)\n[![DOI](https://zenodo.org/badge/635179400.svg)](https://zenodo.org/badge/latestdoi/635179400)\n\n\n## Installation\n\nIt is recommended to install ``wiserep_api`` from pip:\n\n```python\npip install wiserep_api\n```\nor it can be installed from source in the usual way.\n\n## Usage Example\n\nBelow are some basic examples of what the user can do with this package.\n\n### Download a list of SNe\n\nA list of targets can be downloaded for a given spectral type. The spectral types are as defined in Wiserep, which can be printed with ``print_spectral_types``:\n\n```python\nfrom wiserep_api.search import print_spectral_types, download_sn_list\nprint_spectral_types()\n```\n```python\n{'Other': 0, 'SN': 1, 'SN I': 2, 'SN Ia': 3, 'SN Ib': 4, 'SN Ic': 5, 'SN Ib/c': 6, 'SN Ic-BL': 7, 'SN Ib - Ca-rich': 8, 'SN Ibn': 9, 'SN II': 10, 'SN IIP': 11, 'SN IIL': 12, 'SN IIn': 13, 'SN IIb': 14, 'SN I-faint': 15, 'SN I-rapid': 16, 'SLSN-I': 18, 'SLSN-II': 19, 'SLSN-R': 20, 'Afterglow': 23, 'LBV': 24, 'ILRT': 25, 'Nova': 26, 'CV': 27, 'Varstar': 28, 'AGN': 29, 'Galaxy': 30, 'QSO': 31, 'Std-spec': 50, 'Gap': 60, 'Gap I': 61, 'Gap II': 62, 'SN impostor': 99, 'SN Ia-pec': 100, 'SN Ia-SC': 102, 'SN Ia-91bg-like': 103, 'SN Ia-91T-like': 104, 'SN Ia-02cx-like': 105, 'SN Ia-CSM': 106, 'SN Ib-pec': 107, 'SN Ic-pec': 108, 'SN II-pec': 110, 'SN IIn-pec': 112, 'TDE': 120, 'WR': 200, 'WR-WN': 201, 'WR-WC': 202, 'WR-WO': 203, 'M dwarf': 210}\n```\nIn this example, we can download 1991-T-like supernovae (SNe):\n\n```python\ndownload_sn_list(\"SN Ia-91T-like\")\n```\n```python\n390 \"SN Ia-91T-like\" objects found!\nURL used: https://www.wiserep.org/search?\u0026page=8\u0026public=all\u0026type[]=104\n```\n\n### Download spectra\n\nThe public available spectra can also be easily downloaded for a list of targets. These will be saved under the ``spectra`` directory, in a separate directory for each target:\n\n```python\nimport numpy as np\nfrom wiserep_api import download_target_spectra\n\nsne_list = np.genfromtxt('SNIa-91T-like_wiserep.txt', dtype=str, delimiter='\\n')\n\nfor sn in sne_list:\n    try:\n        download_target_spectra(sn, file_type='ascii', exclude=['SEDM'])\n    except Exception as exc:\n        print(f'{sn}: {exc}')\n```\n\n### Running SNID\n\nAssuming that [SNID](https://people.lam.fr/blondin.stephane/software/snid/) is already istalled, it can be run with just a few lines of code:\n\n```python\nimport os\nfrom wiserep_api import snid\n\nsne_list = np.genfromtxt('SNIa-91T-like_wiserep.txt', dtype=str, delimiter='\\n')\nsnid_commmand = 'snid inter=0 plot=0 aband=0 usetype=Ia-91T'\n\nfor sn in sne_list:\n    directory = os.path.join('spectra', sn)\n    snid.run_snid(directory, command=snid_commmand)\n```\n\n### Getting object's properties  \n\nThe properties of a given object can be easily obtained:\n\n```python\nfrom wiserep_api import get_target_property\n\nfor prop in ['type', 'redshift', 'host', 'coords', 'coords_deg']:\n    value = get_target_property('2004eo', prop)\n    print(f'{prop}: {value}')\n```   \n```python\ntype: SN Ia\nredshift: 0.015718\nhost: NGC6928\ncoords: 20:32:54.190 +09:55:42.71\ncoords_deg: 308.22579 +9.92853\n```\n\nOr you can get multiple properties at once:\n\n```python\nproperties = ['type', 'redshift', 'host', 'coords', 'coords_deg']\nvalues = get_target_property('2004eo', properties)\n```\n\nThe spectral type of a given object can also be retrived with ``get_target_class``, which does a more \"in-depth\" search of the classification in case this is not found in the main properties:\n\n```python\nfrom wiserep_api import get_target_class\n\nsn_type = get_target_class(\"2004eo\")\nprint(sn_type)\n```\n```python\n'SN Ia'\n```\n\n\n## Contributing\n\nTo contribute, either open an issue or send a pull request (prefered option). You can also contact me directly (check my profile: https://github.com/temuller).\n\n## Citing WiseRep API\n\nIf you make use of this code, please cite it:\n\n```code\n@software{tomas_e_muller_bravo_2023_7896352,\n  author       = {{M{\\\"u}ller-Bravo}, Tom{\\'a}s E.},\n  title        = {temuller/wiserep\\_api: First Official Release!},\n  month        = may,\n  year         = 2023,\n  publisher    = {Zenodo},\n  version      = {v0.1.5},\n  doi          = {10.5281/zenodo.7896352},\n  url          = {https://doi.org/10.5281/zenodo.7896352}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemuller%2Fwiserep_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftemuller%2Fwiserep_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemuller%2Fwiserep_api/lists"}