Skip to main content

Python extension to the Swiss Ephemeris

Project description

Python extension to AstroDienst Swiss Ephemeris library.

The Swiss Ephemeris is the de-facto standard library for astrological calculations. It is a high-precision ephemeris, based upon the DE431 ephemerides from NASA’s JPL, and covering the time range 13201 BC to AD 17191.

>>> import swisseph as swe
>>> # first set path to ephemeris files
>>> swe.set_ephe_path('/usr/share/sweph/ephe')
>>> # find time of next lunar eclipse
>>> jd = swe.julday(2007, 3, 3) # julian day
>>> res = swe.lun_eclipse_when(jd)
>>> ecltime = swe.revjul(res[1][0])
>>> print(ecltime)
(2007, 3, 3, 23.347926892340183)
>>> # get ecliptic position of asteroid 13681 "Monty Python"
>>> jd = swe.julday(2008, 3, 21)
>>> xx, rflags = swe.calc_ut(jd, swe.AST_OFFSET+13681)
>>> # print longitude
>>> print(xx[0])


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyswisseph- (6.9 MB view hashes)

Uploaded source

Built Distributions

pyswisseph- (874.6 kB view hashes)

Uploaded cp311

pyswisseph- (874.6 kB view hashes)

Uploaded cp310

pyswisseph- (874.6 kB view hashes)

Uploaded cp39

pyswisseph- (874.6 kB view hashes)

Uploaded cp38

pyswisseph- (875.2 kB view hashes)

Uploaded cp37

pyswisseph- (926.6 kB view hashes)

Uploaded cp36

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page