# Flatlib vs a hosted astrology API

> Flatlib was a tidy Python library for traditional (Hellenistic and medieval) astrology: charts, essential and accidental dignities, almuten, profections and primary directions, built on pyswisseph. Its README now opens with a deprecation notice and points to a successor project, so the question for most teams is what to move to.

Source: https://astronode.dev/compare/self-hosting/flatlib · Facts checked: 2026-12-01

## When self-hosting Flatlib is the better choice

- You maintain existing code that already uses it and the outputs are trusted. A working, frozen dependency with no network calls is cheaper than a rewrite, as long as you pin everything around it.
- You want to read the method. The code is small and organised by technique - dignities, protocols such as almuten and temperament, primary directions - which makes it a good reference implementation for traditional techniques.
- Traditional Western work specifically: Alcabitus houses by default, essential dignity tables, accidental dignities. These are niche, and few APIs expose them.

## Side by side

|  | Flatlib | AstroNode API |
| --- | --- | --- |
| Language / runtime | Python 3, on pyswisseph ([source](https://github.com/flatangle/flatlib/blob/master/docs/source/index.rst)) | Any language: HTTPS + JSON, OpenAPI 3.1 spec ([details](https://astronode.dev/guides/openapi-typed-client)) |
| Install and native build | Builds pyswisseph from source, so needs a C compiler ([source](https://github.com/flatangle/flatlib/blob/master/docs/source/installation.rst)) | Nothing to compile; an API key and an HTTP client ([details](https://astronode.dev/quickstart/curl)) |
| Planet positions | Yes - tropical positions via pyswisseph ([source](https://github.com/flatangle/flatlib/blob/master/docs/source/index.rst)) | Sidereal and tropical, from Swiss Ephemeris data files ([details](https://astronode.dev/capabilities/vedic)) |
| House systems | 14 systems; Alcabitus is the default ([source](https://github.com/flatangle/flatlib/blob/master/flatlib/const.py)) | Whole-sign (Vedic), Placidus (KP), five Western systems ([details](https://astronode.dev/guides/house-systems)) |
| Sidereal / ayanamsa | Not documented | Fixed per tradition: Lahiri, KP-Newcomb, tropical ([details](https://astronode.dev/guides/ayanamsa)) |
| Dashas | Not documented; Western predictives only (directions, profections, returns) ([source](https://github.com/flatangle/flatlib/tree/master/flatlib/predictives)) | Vimshottari, Yogini, Char ([details](https://astronode.dev/guides/vimshottari-dasha-calculation)) |
| Divisional charts (vargas) | Not documented | 16 vargas in one call, plus D150 ([details](https://astronode.dev/guides/divisional-chart-calculation)) |
| KP sub-lords | Not documented | Cuspal sub-lord chain, significators, horary 1-249 ([details](https://astronode.dev/capabilities/kp)) |
| Panchang | Not documented | Tithi, nakshatra, yoga, karana, sunrise, muhurta windows ([details](https://astronode.dev/guides/panchang-sunrise-conventions)) |
| Yogas | Not documented | 55 classical yogas with reasons ([details](https://astronode.dev/capabilities/vedic)) |
| Kundli matching | Not documented | Ashtakoot, Dashakoot, Porutham, batch scoring ([details](https://astronode.dev/capabilities/compatibility)) |
| Ephemeris data you ship | Ships a set of .se1 files inside the package ([source](https://github.com/flatangle/flatlib/tree/master/flatlib/resources/swefiles)) | None on your side |
| Time zones and historical offsets | Fixed UTC offset per Datetime; no zone lookup ([source](https://github.com/flatangle/flatlib/blob/master/flatlib/datetime.py)) | You send the offset in force at birth; no zone-name lookup ([details](https://astronode.dev/guides/birth-time-and-time-zones)) |
| Maintenance signal | Deprecated by its author; repository archived ([source](https://github.com/flatangle/flatlib)) | Hosted; changes published in the changelog ([details](https://astronode.dev/changelog)) |
| Stated accuracy | Not documented | Measured in CI vs NASA JPL Horizons: Moon 3.1″, planets ≤ 0.5″ (1900-2050) ([details](https://astronode.dev/)) |

| More from their docs |  |
| --- | --- |
| Pinned dependency | PyPI 0.2.3 pins an old pyswisseph ([source](https://pypi.org/pypi/flatlib/json)) |

## What you still build yourself

- A migration plan. With the project deprecated and archived, any bug you find is yours to patch in a fork, and new Python versions are yours to test against.
- Sidereal support if you need it - no ayanamsa option is documented - and, after that, the whole Vedic layer: dashas, vargas, KP, panchang, yogas, matching.
- Time-zone resolution: a Datetime takes a fixed UTC offset string such as '+00:00', so the historical offset for a birthplace is your problem.
- Modern Western features it never had: SVG rendering, synastry scoring, transit search.

## Running it in production

- Dependency drift. The last PyPI release (0.2.3) pins pyswisseph 2.08.00-1, while the repository's setup.py has moved to 2.10.3.2. Installing from PyPI on a current Python can mean building that old binding from source.
- C compiler required. Its installation guide walks through installing a compiler on Windows and Xcode command-line tools on macOS because pyswisseph is built during install.
- Bundled data. A handful of .se1 files ship inside the package, so the date range you get is whatever those files cover; adding more means managing a data directory yourself.
- No updates are coming. Security fixes in dependencies, new Python releases and upstream ephemeris changes all land on whoever forks it.
- Offsets are fixed numbers. Use the [UTC offset finder](https://astronode.dev/tools/utc-offset-finder) to get the one in force at a birth, and read the [time-zone guide](https://astronode.dev/guides/birth-time-and-time-zones) for daylight-saving and wartime traps.

## Accuracy

Flatlib's own docs state no accuracy figure. Positions come from whichever pyswisseph build and data files you install, so the practical answer is the Swiss Ephemeris figure for those files. AstroNode's CI measures the Moon within 3.1″ and every planet within 0.5″ of NASA JPL Horizons from 1900 to 2050.

## Where an API saves work

- A maintained dependency: if a result is wrong, it is fixed upstream of you and recorded in the changelog.
- No compiler step in your build and no old pinned binding to rebuild.
- Vedic coverage if your product is heading there - dashas, vargas, KP, panchang, yogas and matching.
- Be clear about the gap: AstroNode does not expose Flatlib's traditional techniques (almuten, primary directions, Alcabitus houses). If those are the point, a maintained traditional-astrology library is the better replacement.

## Questions

**What do I need to install to use Flatlib?**

Flatlib: Builds pyswisseph from source, so needs a C compiler. AstroNode API: Nothing to compile; an API key and an HTTP client. Checked 2026-12-01.

**Does Flatlib calculate dashas?**

Flatlib: Not documented; Western predictives only (directions, profections, returns). AstroNode API: Vimshottari, Yogini, Char. Checked 2026-12-01.

**Does Flatlib support KP sub-lords?**

Flatlib: Not documented. AstroNode API: Cuspal sub-lord chain, significators, horary 1-249. Checked 2026-12-01.

**Does Flatlib do kundli matching?**

Flatlib: Not documented. AstroNode API: Ashtakoot, Dashakoot, Porutham, batch scoring. Checked 2026-12-01.

**Does Flatlib handle time zones and historical offsets?**

Flatlib: Fixed UTC offset per Datetime; no zone lookup. AstroNode API: You send the offset in force at birth; no zone-name lookup. Checked 2026-12-01.
