A library that computes the ephemerides.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Kosmorrolib - a library to compute your ephemerides!
  2. [![Coverage Status](https://coveralls.io/repos/github/Kosmorro/lib/badge.svg?branch=main)](https://coveralls.io/github/Kosmorro/lib?branch=main) [![Version on PyPI](https://img.shields.io/pypi/v/kosmorrolib)](https://pypi.org/project/kosmorrolib) [![IRC: #kosmorro on Libera.Chat](https://img.shields.io/badge/Libera.Chat-%23kosmorro-blueviolet)](https://web.libera.chat/?nick=Astronaut?#kosmorro)
  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. ```