A library that computes the ephemerides.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
Jérôme Deuchnord c7a4df9e1a
docs(license): migrate to GNU Affero General Public License v3 (#27)
2 年前
.github docs(license): migrate to GNU Affero General Public License v3 (#27) 2 年前
kosmorrolib docs(license): migrate to GNU Affero General Public License v3 (#27) 2 年前
tests docs(license): migrate to GNU Affero General Public License v3 (#27) 2 年前
.coveragerc test: fix coverage config 3 年前
.editorconfig ci: add support for Windows (#14) 3 年前
.gitignore chore: add EditorConfig to GitPod config 2 年前
.gitpod.yml chore: add EditorConfig to GitPod config 2 年前
CHANGELOG.md build: bump version 0.11.2 3 年前
CONTRIBUTING.md chore: fix GitPod button on contribution doc 2 年前
LICENSE.md docs(license): migrate to GNU Affero General Public License v3 (#27) 2 年前
Makefile chore: fix files to commit on tag 3 年前
Pipfile feat: use Skyfield-Data library instead of downloading needed files at first time (#22) 2 年前
README.md docs: remove Discord badge 2 年前
setup.py docs(license): migrate to GNU Affero General Public License v3 (#27) 2 年前
tests.py docs(license): migrate to GNU Affero General Public License v3 (#27) 2 年前

README.md

Kosmorrolib - a library to compute your ephemerides!

Coverage Status Version on PyPI

Installation

Requirements

Kosmorrolib requires the following software to work:

  • Python ≥ 3.7.0
  • PIP

Production environment

Keep in mind that Kosmorrolib is not considered as stable for now.

PyPI

Kosmorrolib is available on PyPI: pip install kosmorrolib.

Development environment

First, install Pipenv.

Clone this repository and run pipenv sync to install all the dependencies. And that’s all, your development environment is ready for the fight! 👏

Using the Kosmorrolib

The Kosmorrolib provides three functions that you can use in your code:

#!/usr/bin/env python3

import kosmorrolib
from datetime import date

position = kosmorrolib.Position(50.5824, 3.0624)

# Get the moon phase for today
moon_phase = kosmorrolib.get_moon_phase()

# Get the moon phase for June 9th, 2021
moon_phase = kosmorrolib.get_moon_phase(date.fromisoformat('2021-06-09'))

# Get a list of objects representing the ephemerides of today.
ephemerides = kosmorrolib.get_ephemerides(position)

# Get a list of objects representing the ephemerides of June 9th, 2021.
ephemerides = kosmorrolib.get_ephemerides(position, date.fromisoformat('2021-06-09'))

# Get a list of objects representing the events of today.
events = kosmorrolib.get_events()

# Get a list of objects representing the events on June 9th, 2021.
events = kosmorrolib.get_events(date.fromisoformat('2021-06-09'))

# Note that each method provides an optional parameter for the timezone:
moon_phase = kosmorrolib.get_moon_phase(timezone=2)
ephemerides = kosmorrolib.get_ephemerides(position, timezone=2)
events = kosmorrolib.get_events(timezone=2)