Back to directory

Solar

A small Swift library that calculates sunrise and sunset times, including civil, nautical, and astronomical twilight, entirely on-device from a date and a location, with no network access required.

Solar

Solar is a Swift library that calculates sunrise and sunset times for a given date and geographic coordinate, performing the computation locally using an algorithm from the United States Naval Observatory rather than calling a web service. Given just a location, it also defaults to the current date and time.

Besides the official sunrise and sunset moments, it can compute civil, nautical, and astronomical twilight, which differ by how far the sun sits below the horizon, and it provides convenience properties for checking whether a given location and date fall in daytime or nighttime.

It installs through the Swift Package Manager and is distributed under the MIT license.

More in Libraries

See all 292
  • OpenDecision

    deepanwadhwa.github.io

    An open-source Python package that answers typed questions about application state or documents using a local natural-language-inference model, returning structured choice, score, yes/no or evidence-relation values instead of free text.

  • TradeCanvas

    bonguynvan.github.io

    A zero-dependency canvas charting engine for building TradingView-style trading charts in JavaScript, with 66 technical indicators, 24 drawing tools, 17 chart types, and real-time streaming.

  • 3d retro graphics

    3d-retro.com

    A free, CC0-licensed library of copy-paste retro 3D and demoscene graphics effects, such as plasma, raytracing, and voxel terrain, runnable as WebGL 1 or plain 2D canvas.