Giter Club home page Giter Club logo

sunandmoon's Introduction

sunAndMoon

Script to calculate the times you can catch a solar or lunar rise or set for a location and direction.

Requires astral, ics and tzlocal, all in pip. Find the parameters you need on e.g. suncalc.org.

All events will be printed to the screen while an iCalendar file, sun_moon_events.ics, will be output in the current directory containing all events in a format you can import into e.g. Google Calendar.

Usage:

$ python sunAndMoon.py -h
usage: sunAndMoon.py [-h] --loc LOC --lat LAT --lon LON --year YEAR --astart ASTART --aend AEND

Sun and Moon Set and Rise Calculator

options:
  -h, --help       show this help message and exit
  --loc LOC        Location name (default: None)
  --lat LAT        Latitude in degrees (default: None)
  --lon LON        Longitude in degrees (default: None)
  --year YEAR      Year (default: None)
  --astart ASTART  Azimuth start in degrees clockwise from North (default: None)
  --aend AEND      Azimuth end in degrees clockwise from North (default: None)

For example:

python sunAndMoon.py --loc Beach --lat 63.79913 --lon -20.88370 --year 2023 --astart 140 --aend 269
Sun rising at 01/01/23 11:10:52
Sun setting at 01/01/23 15:43:24
Sun rising at 02/01/23 11:09:52
Sun setting at 02/01/23 15:45:21
Sun rising at 03/01/23 11:08:46
...

sunandmoon's People

Contributors

mp3guy avatar

Stargazers

 avatar

Watchers

 avatar

sunandmoon's Issues

Improving output date time format

Reading the long time format in the output is distracting. Perhaps the system locale formats can be used instead using:

# Format the date and time according to the system locale
print(f"{body} {event} at {date.strftime(time, '%x %X')}")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.