A library that computes the ephemerides.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 2.1 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Kosmorrolib - a library to compute your ephemerides!
  2. [![Coverage Status](https://coveralls.io/repos/github/kosmorro/lib/badge.svg)](https://coveralls.io/github/kosmorro/lib) [![Version on PyPI](https://img.shields.io/pypi/v/kosmorrolib)](https://pypi.org/project/kosmorrolib) [![Discord](https://img.shields.io/discord/650237632533757965?logo=discord&label=%23kosmorro)](https://discord.gg/nyemBqE)
  3. ## Installation
  4. ### Requirements
  5. Kosmorrolib requires the following software to work:
  6. - Python ≥ 3.7.0
  7. - PIP
  8. ### Production environment
  9. Keep in mind that Kosmorrolib is not considered as stable for now.
  10. #### PyPI
  11. Kosmorrolib is available [on PyPI](https://pypi.org/project/kosmorrolib/): `pip install kosmorrolib`.
  12. ### Development environment
  13. First, install [Pipenv](https://pypi.org/project/pipenv/).
  14. Clone this repository and run `pipenv sync` to install all the dependencies.
  15. And that's all, your development environment is ready for the fight! 👏
  16. ## Using the Kosmorrolib
  17. The Kosmorrolib provides three functions that you can use in your code:
  18. ```python
  19. #!/usr/bin/env python3
  20. import kosmorrolib
  21. from datetime import date
  22. position = kosmorrolib.Position(50.5824, 3.0624)
  23. # Get the moon phase for today
  24. moon_phase = kosmorrolib.get_moon_phase()
  25. # Get the moon phase for June 9th, 2021
  26. moon_phase = kosmorrolib.get_moon_phase(date.fromisoformat('2021-06-09'))
  27. # Get a list of objects representing the ephemerides of today.
  28. ephemerides = kosmorrolib.get_ephemerides(position)
  29. # Get a list of objects representing the ephemerides of June 9th, 2021.
  30. ephemerides = kosmorrolib.get_ephemerides(position, date.fromisoformat('2021-06-09'))
  31. # Get a list of objects representing the events of today.
  32. events = kosmorrolib.get_events()
  33. # Get a list of objects representing the events on June 9th, 2021.
  34. events = kosmorrolib.get_events(date.fromisoformat('2021-06-09'))
  35. # Note that each method provides an optional parameter for the timezone:
  36. moon_phase = kosmorrolib.get_moon_phase(timezone=2)
  37. ephemerides = kosmorrolib.get_ephemerides(position, timezone=2)
  38. events = kosmorrolib.get_events(timezone=2)
  39. ```