# Swiss Ephemeris: the astrological calculation engine and its data files

> Swiss Ephemeris is a C library from Astrodienst that astrological software has been built on for decades, with planetary and asteroid data files that are distributed separately from the code. The interesting decisions for an adopter are the file layout, the size of the asteroid catalogue and the licence split between a public edition and a paid professional one.

**aloistr/swisseph** — Swiss Ephemeris source code, official release by Astrodienst. For reporting issues or problems, please use the public mailing list https://groups.io/g/swisseph

- Repository: https://github.com/aloistr/swisseph
- Website: https://www.astro.com/swisseph/swephinfo_e.htm
- Stars: 733 · Forks: 264
- Language: C
- License: NOASSERTION
- Published: 2026-10-21 · Updated: 2026-10-21 · Language: en
- Canonical page: https://hysenlabs.com/projects/aloistr-swisseph

## A calculation engine, not a finished application

Swiss Ephemeris, usually abbreviated SE, is a software toolbox for programmers who write astrological software. The project notes are blunt about the audience: it is of little use for a non-programmer. What you get is a set of C sources and headers, a command line test program and a data file set, not an application with a user interface.

The library was developed by Dieter Koch and Alois Treindl while both were employed by Astrodienst AG in Zollikon, Zurich. The stated goal is the highest standard of precision available in astronomical data, with raw data from Nasa's JPL, and the project notes claims it reproduces the ephemeris data in astronomical standard books up to the last printed digit. That claim is the project's own, and it is the reason many astrological programmers outside Switzerland build on it.

What makes the project interesting to evaluate is the split between code and data. The engine is a modest C library, but the data files it consumes are large, they change format across releases, and they are distributed through several channels. The recent release history shows the same pattern: v2.10.3final on 2026-04-14 followed by v2.10.3bfinal on 2026-08-02, with an earlier v2.10.03 from 2022-09-09. The last push to the repository was on 2026-10-19 and the repository is not archived.

## The DE441 rebuild keeps old code working

The most consequential change in the current release is a data change rather than a code change. As of 14 April 2026, all .se1 data files for planets and for asteroids have been rebuilt with JPL Ephemeris DE441. The project notes make an explicit compatibility promise about it: the rebuilt files remain compatible with all older SE versions at least back to release 1.67 of March 2005.

That promise is the reason the project can be adopted without a lock-in decision. An application written against a 2005-era build will read the new files, so upgrading the data set is a download rather than a port. The trade-off is that the numbers your program produces will shift, because they are now derived from a different planetary ephemeris, and any output your users compare against previously published charts needs to be treated as a version boundary.

The compressed planet and main asteroid files live in the ephe folder of the public repository, and that folder also carries list.zip with the lists of all asteroid files and their most recent updates. Four text files sit alongside them: list_short.txt and all_short.txt for the short files, list_long.txt and all_long.txt for the long ones. The project notes also point to a public dropbox area with an ephe folder as an alternative source.

## The ephepath search list decides whether your data is found

Getting the data files found is the part that trips people up, and the mechanism is explicit in the project notes. The code keeps an internal swed.ephepath variable holding the directories it searches, and it defaults to a Windows path on Windows and to three directories on Linux, Unix-like systems, Android and Mac OS-X.

The default list on Linux is the current directory, then /users/ephe2, then /users/ephe. The characters semicolon on Windows, and semicolon or colon on Linux, act as path separators, so a single string can hold several locations. A programmer can override the builtin default at runtime by calling swe_set_ephe_path(), and an environment variable can override the builtin default as well, which is what makes it possible to point a deployed binary at a data directory without recompiling it.

The layout rules are strict. Compressed planetary files such as sepl*.se1, sem*.se1 and seas*.se1 must sit directly inside one of the path elements. Asteroid files must live in subdirectories named astN, where N is the asteroid number divided by 1000, so ast0, ast1 and so on up to ast623. The all_ast and long_ast folders exist only to organise the dropbox area; once downloaded, an astN directory has to be placed directly in one of the ephepath elements.

## Short and long asteroid files cover different time spans

The asteroid catalogue is the largest operational fact about this project. More than 895,000 numbered asteroids were available as of June 2026, and the total volume of the files was 48 Gb in June 2026. The files are organised in folders of 1000 asteroids each.

Two file types exist. Short files have names like sXXXs.se1 or seXXXs.se1 with an s.se1 suffix, and each covers 600 years, from 1500 CE to 2100 CE. Long files for named asteroids use the .se1 suffix and cover 6000 years, from 3000 BCE to 3000 CE. The two differ by a single letter in the file name, and they can be merged into the same astN directory, for example ast1, because Astrodienst keeps them separate in /ephe and /ephe2 by tradition rather than out of technical necessity. Since an update in April 2026, long and short files sit in the same directories.

For most applications the short files are the only ones worth downloading, since a 48 Gb transfer is a heavy way to buy coverage of a few centuries. The project notes offer a simpler source at a web space provided by Phillip McCabe, both for the ephemeris files and for the JPL binaries.

## Building the library and the test programs with make

The repository root carries a Makefile whose header describes a multi-platform build for Linux and macOS. It detects the operating system with uname and sets the compiler, flags, link options and shared library creation flags accordingly. On macOS the settings look like this:

```
  CC               = cc
  CFLAGS           = -g -Wall -fPIC
  LIBS             = -lm
  DYLIB_FLAG       = -dynamiclib
```

The documented targets are listed in the same header. The default target builds the executables swetest, swevents and swemini, with swetests added on Linux, and it creates both a static library archive libswe.a and a shared library, libswe.so on Linux or libswe.dylib on macOS. swetests is the fully statically linked variant and exists on Linux only. The swetest program is linked against libswe.a, and swemini likewise.

Two further targets matter for a maintainer. The test target runs the tests from the setest directory, which needs a Makefile in that directory, and the clean target removes the generated files and cleans setest:

```
#    test        - Run tests from the setest directory (requires a Makefile in setest)
#    clean       - Remove all generated files and clean the setest directory
```

The source tree is laid out as a library rather than a package. sweph.c and swephlib.c hold the core, swejpl.c wraps the JPL ephemeris, swemmoon.c covers the moon, sweephe4.c and swephgen4.c handle the newer generation of files, swehouse.c the houses, swedate.c the date handling, and swevents.c, swemini.c and swetest.c are the command line programs. Public headers such as sweph.h, swedll.h and swephexp.h sit at the top level next to the sources.

## The large JPL binaries are a separate download and a rename

Beyond the compressed se1 files, the project notes lists the JPL binary ephemeris files, which come directly from JPL and are large:

```
- de200.eph  size 41 Mb  [download de200.eph](https://ssd.jpl.nasa.gov/ftp/eph/planets/Linux/de200/lnxm1600p2170.200)
- de406.eph  size 190 Mb [download de406.eph](https://ssd.jpl.nasa.gov/ftp/eph/planets/Linux/de406/lnxm3000p3000.406)
- de431.eph  size 2.6 Gb [download de431.eph](https://ssd.jpl.nasa.gov/ftp/eph/planets/Linux/de431/lnxm13000p17000.431)
- de441.eph  size 2.6 Gb [download de441.eph](https://ssd.jpl.nasa.gov/ftp/eph/planets/Linux/de441/linux_m13000p17000.441)
```

There is a step that is easy to miss. A file downloaded as de441/linux_m13000p17000.441 has to be renamed to de441.eph for the Swiss Ephemeris code to recognise it. The project notes also publish md5 keys for the four files so a download can be checked:

```
	md5-keys
	1ef6191b614b2b854adae8675b1b981f  de200.eph
	1ef768440cc1617b6c8ad27a9a788135  de406e.eph
	fad0f432ae18c330f9e14915fbf8960a  de431.eph
	a7b2a5b8b2ebed52ea4da2304958053b  de441.eph
```

A deployment therefore has two moving parts to keep in step: the engine version and the data set, and the data set is the part that is measured in gigabytes.

## The licence split and the public support channel

The legal side is the clearest dividing line in the project. The Swiss Ephemeris can be licensed by programmers to include the calculation engine in their software, and depending on the application the free edition under the Public License may apply, or a professional licence may have to be acquired for a fee. The project notes point to the licence file and to the project page for the details, and the repository carries both a LICENSE file and LICENSE.TXT alongside an agpl-3.0.txt. The GitHub licence field is listed as a custom licence that the platform cannot classify, which is consistent with a dual public and commercial scheme rather than a single standard one. This is a commercial question for a licence holder to settle, not something to read off the project notes.

Support is deliberately public. The maintainers run a mailing list on groups.io, it serves as the main support channel, and all support is public because there is no private support by email. Suggestions and comments go to swisseph@groups.io, and issues and problems are reported through the same list. The repo also has a contrib directory holding open source code and applications that use the library, and a doc directory with the documentation files.

For languages other than C, two ports exist and are named in the project notes. An up to date fork of oPyswisseph by Sailorfe is available as pysweph, and Thomas Mack has ported the library to Java. Those are bindings and ports of the same engine, so choosing one instead of the C sources trades direct control over the data path for a language your team already writes in.

## Conclusion

Adopt Swiss Ephemeris if you are writing astrological software in C and need the precision and the long file history behind it, and if you can accept fetching ephemeris data from the ephe folder or the dropbox area and setting the ephepath before your first call. Do not adopt it for a one-off calculation, for a non-astrological use, or for a product that cannot live with the public licence terms, in which case a professional licence is the route the project itself describes. Before you start, confirm that the se1 files you take are the DE441 rebuild of 14 April 2026, check the md5 keys of any de4xx.eph you download from JPL, and read LICENSE.TXT, because the free edition and the professional edition cover different uses of the same engine.

## FAQ

### What is Swiss Ephemeris used for?

It is a C software toolbox for programmers who write astrological software, developed by Dieter Koch and Alois Treindl at Astrodienst AG. The project notes say it is of little use for a non-programmer, and that it is built to the highest standards of precision available in astronomical data, with raw data from Nasa's JPL.

### How do I install the Swiss Ephemeris data files?

The compressed planet and main asteroid files are in the ephe folder of the public repository, and the same folder carries list.zip with the lists of all asteroid files and their most recent updates. The JPL binary files de200.eph, de406.eph, de431.eph and de441.eph are downloaded directly from JPL or from a public dropbox area, and each one has to be renamed to the .eph name for the code to recognise it.

### Where does Swiss Ephemeris look for its ephemeris files?

The code keeps an internal swed.ephepath variable with the directories it searches, defaulting on Linux to the current directory, /users/ephe2 and /users/ephe. A programmer can change it with swe_set_ephe_path(), and an environment variable can override the builtin default, with semicolon or colon separating multiple paths.

### What changed with the DE441 update in 2026?

As of 14 April 2026 all .se1 data files for planets and for asteroids were rebuilt with JPL Ephemeris DE441, and the readme states that they remain compatible with all older SE versions back to release 1.67 of March 2005. The last push to the repository was on 2026-10-19, and the most recent tagged release is v2.10.3bfinal from 2026-08-02.

### Is Swiss Ephemeris free for commercial use?

It depends on the application. The project notes say the free edition under the Public License may apply, or you may have to acquire a professional licence for a fee, and points to LICENSE.TXT and the project page for the details. The repository also carries a LICENSE file and an agpl-3.0.txt.

## Sources

- [aloistr/swisseph on GitHub](https://github.com/aloistr/swisseph)
- [Issues](https://github.com/aloistr/swisseph/issues)
- [Project website](https://www.astro.com/swisseph/swephinfo_e.htm)
- [README](https://github.com/aloistr/swisseph/blob/master/README.md)
- [Releases](https://github.com/aloistr/swisseph/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/aloistr-swisseph
