Hello,
I am a DIY learner and don‘t have a professional coding education. So I apologize upfront for not having structured my code as a professional would do.
The reason I post my project is to show what you can achieve as a non-professional by just examining the Pythonista examples program folders in Pythonista App, researching omz forum and stackoverflow.
The application I wrote calculates the Sun path coordinates including sunrise, noon and sunset data (direction and height in degrees) for a given day for any place on earth. This works completely offline including timezone deviation.
In addition to that, moon data is fetched from a server in Norway that offers a free moon data API. Based on that data I calculate moon phase, illumination and dates for coming new moon and full moon on my own.
A satellite picture is being taken from the given location and also a world map overview where you can see your selected spot.
The app provides a possibility to generate ODT and PDF report files (examples to be found in the linked zip file). You need a free Cloudmersive API key for PDF generation though. For ODT you need odfpy module (see installation manual which is also included) and there is also a free Open Office Distribution called AO Office in the Apple AppStore.
You can create, edit and delete new locations and please note that you can also change the satellite picture map size in the report settings menu for visualizing bigger geological structures. There is also an options switch in the report settings menu that includes moon data into the ODT/PDF report instead of the satellite picture.
There is also a Google Maps webview integrated for finding new locations to copying in your clipboard and processing from there. You need to zoom in and long press a location first, then press share button and close the app to properly adapt a location from Google maps web app. The Google Maps web app provides more clipboard information than Apple Maps so I used that one. The world map picture is fetched from Apple Maps though.
I know you can not only integrate Google Maps but also draw directly draw paths and spots into the live application that runs as a sub view in your app. I don‘t know yet how to do this however.
I hope you don’t face installation problems and that some of you bite your way through the installation process and give it a try.
Btw. the app is iPad only and refuses to work on iPhones (Maybe I do an iPhone version lateron).
[Edit: Dropbox archive link removed and replaced with GitHub link]
https://github.com/Bambla78/Pythonista_SunCalculator_iPad
Regards,
Vincent


















