{"id":15032155,"url":"https://github.com/nathan-osman/rust-sunrise","last_synced_at":"2025-07-20T07:36:20.468Z","repository":{"id":43329971,"uuid":"161429565","full_name":"nathan-osman/rust-sunrise","owner":"nathan-osman","description":"Crate for calculating sunrise / sunset times","archived":false,"fork":false,"pushed_at":"2025-05-12T07:48:25.000Z","size":67,"stargazers_count":18,"open_issues_count":3,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-26T18:04:52.507Z","etag":null,"topics":["astronomy","calendar","rust","sunrise","sunset"],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/nathan-osman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null}},"created_at":"2018-12-12T03:50:08.000Z","updated_at":"2025-06-04T14:18:48.000Z","dependencies_parsed_at":"2025-05-12T08:59:50.127Z","dependency_job_id":null,"html_url":"https://github.com/nathan-osman/rust-sunrise","commit_stats":{"total_commits":23,"total_committers":2,"mean_commits":11.5,"dds":0.04347826086956519,"last_synced_commit":"92066fb32867d850b89c8fd273d54197b94768e1"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nathan-osman/rust-sunrise","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-osman%2Frust-sunrise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-osman%2Frust-sunrise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-osman%2Frust-sunrise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-osman%2Frust-sunrise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nathan-osman","download_url":"https://codeload.github.com/nathan-osman/rust-sunrise/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-osman%2Frust-sunrise/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265062561,"owners_count":23705533,"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","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","calendar","rust","sunrise","sunset"],"created_at":"2024-09-24T20:17:32.766Z","updated_at":"2025-07-20T07:36:20.460Z","avatar_url":"https://github.com/nathan-osman.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## sunrise\n\n[![](https://img.shields.io/crates/l/sunrise)][license]\n[![](https://img.shields.io/crates/v/sunrise)][crate]\n[![](https://img.shields.io/docsrs/sunrise)][docs]\n\nThis crate provides a function for calculating sunrise and sunset times using [this method](https://en.wikipedia.org/wiki/Sunrise_equation#Complete_calculation_on_Earth).\n\nTo work in a *no-std* environment disable the default features and enable the `libm` feature.\n\n### Usage\n\nIn order to perform the calculation, you'll need to provide the following:\n\n- the date for which you wish to calculate the times\n- the latitude and longitude of the location\n\nBegin by adding this crate to `Cargo.toml`:\n\n```toml\n[dependencies]\nsunrise = \"1.2\"\n```\n\nYou can use the `SolarDay` struct to perform computation of an event at a\nparticular place and time:\n\n```rust\nuse chrono::NaiveDate;\nuse sunrise::{Coordinates, SolarDay, SolarEvent, DawnType};\n\n// January 1, 2016 in Toronto\nlet date = NaiveDate::from_ymd_opt(2016, 1, 1).unwrap();\nlet coord = Coordinates::new(43.6532, -79.3832).unwrap();\n\nlet dawn = SolarDay::new(coord, date)\n    .with_altitude(54.)\n    .event_time(SolarEvent::Dawn(DawnType::Civil));\n```\n\n[crate]: https://crates.io/crates/sunrise \"crates.io\"\n[docs]: https://docs.rs/sunrise \"Documentation\"\n[license]: http://opensource.org/licenses/MIT \"MIT License\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathan-osman%2Frust-sunrise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnathan-osman%2Frust-sunrise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathan-osman%2Frust-sunrise/lists"}