Welcome to Kanon documentation

Gitlab Pipeline Status Coverage Docs status Kanon Pypi Python 3.8 Powered by Astropy Badge

Kanon is the History of Astronomy Python package and tools. Still in early development.

Current Features


  • Define standard positional numeral systems

  • Working arithmetics on those numbers

  • Specify custom precision and algorithms on arithmetical operations and keep a history of it


  • Build or import ancient astronomical tables

  • Perform basic operations on those tables


  • Define new calendar types

  • Convert dates between calendars

How to use

Install the package with pip

pip install kanonpy

For now kanon features are only available through its Python library

import kanon.units as u

a = u.Sexagesimal(1,2,3)
b = u.Sexagesimal(2,1,59)

a + b
# 3,4,2 ;


To start developing on this project you need to install the package in editable mode

git clone git@gitlab.obspm.fr:lgauffier/kanon.git
cd kanon
pip install -e .

The changes you make in the code are reflected on your Python environment


Run tests with tox

# source code tests
tox -e test

# example notebooks tests
tox -e test_notebooks

# mypy
tox -e mypy