{"id":25299185,"url":"https://github.com/lzkelley/cosmopy","last_synced_at":"2025-07-22T12:34:59.395Z","repository":{"id":50383551,"uuid":"115237472","full_name":"lzkelley/cosmopy","owner":"lzkelley","description":"A simple cosmological calculator in python (API or command-line).","archived":false,"fork":false,"pushed_at":"2024-04-13T19:20:18.000Z","size":1922,"stargazers_count":11,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T15:13:08.983Z","etag":null,"topics":["astronomy","astrophysics","calculator","cosmology","physics","utility"],"latest_commit_sha":null,"homepage":"","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/lzkelley.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","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":"2017-12-24T03:30:24.000Z","updated_at":"2025-06-08T00:55:01.000Z","dependencies_parsed_at":"2024-04-13T19:40:22.153Z","dependency_job_id":"dce129cc-04a9-4f5c-ab6b-eff19259cac8","html_url":"https://github.com/lzkelley/cosmopy","commit_stats":{"total_commits":152,"total_committers":3,"mean_commits":"50.666666666666664","dds":0.3223684210526315,"last_synced_commit":"7cde2b81a5a7e5e4b59bb1a69f24af477764a6b9"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/lzkelley/cosmopy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzkelley%2Fcosmopy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzkelley%2Fcosmopy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzkelley%2Fcosmopy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzkelley%2Fcosmopy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lzkelley","download_url":"https://codeload.github.com/lzkelley/cosmopy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzkelley%2Fcosmopy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266496509,"owners_count":23938713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["astronomy","astrophysics","calculator","cosmology","physics","utility"],"created_at":"2025-02-13T04:53:57.389Z","updated_at":"2025-07-22T12:34:59.330Z","avatar_url":"https://github.com/lzkelley.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"cosmopy\n=======\n\n|version| |build-status| |coverage|\n\n\nQuickly calculate cosmological parameters.\n\n- Provides both command-line and API interfaces.\n\n- Uses the machinery from the `astropy.cosmology` package.\n\nThe user provides an input parameter (e.g. redshift or luminosity-distance) and recieves the entire set of cosmological measures corresponding to the epoch thus specified.\n\n\nThe below gif shows three examples: inputting a redshift, a luminosity distance (`-dl 400Mpc`), and an age of the universe (`-ta 3.2Gyr`).\n\n.. image:: https://raw.githubusercontent.com/lzkelley/cosmopy/dev/docs/cosmopy_demo.gif\n   :height: 600px\n\n\nInstallation\n------------\n\nUsing `pip`:\n\n::\n\n    pip install cosmopy\n\nFrom source:\n\n::\n\n git clone git@github.com:lzkelley/cosmopy.git\n pip install cosmopy\n\n\nUsage\n-----\n`cosmopy` can be used via the command-line `cosmo` command, or via python API by importing the module directly.\n\n- Command Line:\n\n    ::\n\n        $ cosmo --help\n\n         usage: cosmo [-h] [-z Z] [-a A] [-dc DC] [-dl DL] [-tl TL] [-ta TA] [-v]\n\n         cosmopy: cosmological calculator.\n\n         optional arguments:\n           -h, --help      show this help message and exit\n           -z Z            target redshift z\n           -a A            target scale factor a\n           -dc DC, -cd DC  target coming distance D_C\n           -dl DL, -ld DL  target luminosity distance D_L\n           -tl TL, -lt TL  target look-back time T_L\n           -ta TA, -at TA  target universe age T_A\n           -v, --version   print version information.\n\n    For example, entering an input redshift of 0.2:\n\n    ::\n\n        $ cosmo -z 0.2\n\n               z = 0.2000                                : Redshift\n               a = 0.8333                                : Scale-factor\n             D_c = 815.3960 Mpc      ~ 2.5160e+27 cm     : Comoving Distance\n             D_L = 978.4752 Mpc      ~ 3.0193e+27 cm     : Luminosity Distance\n             D_A = 679.4967 Mpc      ~ 2.0967e+27 cm     : Angular Diameter Distance\n          Arcsec = 3294.2928 pc      ~ 1.0165e+22 cm     : Arcsecond Scale\n            T_lb = 2.4277 Gyr        ~ 7.6613e+16 s      : Lookback Time\n             T_a = 11.3235 Gyr       ~ 3.5734e+17 s      : Age of the Universe\n              DM = 39.9527                               : Distance Modulus\n\n    or an input luminosity-distance of 400 Mpc:\n\n    ::\n\n        $ cosmo -dl 400Mpc\n\n               z = 0.0880                                : Redshift\n               a = 0.9192                                : Scale-factor\n             D_c = 367.6631 Mpc      ~ 1.1345e+27 cm     : Comoving Distance\n             D_L = 400.0000 Mpc      ~ 1.2343e+27 cm     : Luminosity Distance\n             D_A = 337.9403 Mpc      ~ 1.0428e+27 cm     : Angular Diameter Distance\n          Arcsec = 1638.3809 pc      ~ 5.0555e+21 cm     : Arcsecond Scale\n            T_lb = 1.1496 Gyr        ~ 3.6280e+16 s      : Lookback Time\n             T_a = 12.6016 Gyr       ~ 3.9768e+17 s      : Age of the Universe\n              DM = 38.0103                               : Distance Modulus\n\n- Python API\n\n    The module can be imported as `cosmopy`, from which the primary access point is the `api` function which accepts two arguments: a `key` (a target cosmological parameter) and a `value` of that parameter (optionally including units).  The function returns a dictionary with the computed values as key: value pairs (both strings).  For example:\n\n    ::\n\n        $ python -c \"import cosmopy; print(cosmopy.api('dl', '1.2 Gpc'))\"\n         {'z': '0.2396', 'dl': '1200.0000 Mpc', 'tl': '2.8359 Gyr', 'dc': '968.0336 Mpc', 'ta': '10.9153 Gyr', 'da': '780.9075 Mpc', 'dm': '40.3959', 'arc': '3785.9464 pc', 'a': '0.8067'}\n\n\n.. |version| image:: https://img.shields.io/pypi/v/cosmopy\n    :alt: PyPI\n    :target: https://pypi.org/project/cosmopy/\n\n.. |build-status| image:: https://github.com/lzkelley/cosmopy/actions/workflows/build-status.yml/badge.svg\n    :alt: build-status\n    :target: https://github.com/lzkelley/cosmopy/actions/workflows/build-status.yml\n\n.. |coverage| image:: https://codecov.io/gh/lzkelley/cosmopy/branch/main/graph/badge.svg?token=ZRPgCWUaVW\n    :alt: coverage\n    :target: https://codecov.io/gh/lzkelley/cosmopy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flzkelley%2Fcosmopy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flzkelley%2Fcosmopy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flzkelley%2Fcosmopy/lists"}