marcoconsiglio / ephemeris
A Laravel package that query the Swiss Ephemeris executable, in order to get planets position for astronomy/astrology purposes.
Fund package maintenance!
MarcoConsiglio
Installs: 44
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/marcoconsiglio/ephemeris
Requires
- adambrett/shell-wrapper: ~1.0
- marcoconsiglio/goniometry: ^1.0
Requires (Dev)
- orchestra/testbench: ^10.0
- phpunit/phpunit: ^11.0
This package is auto-updated.
Last update: 2025-11-01 17:26:14 UTC
README
Laravel Swiss Ephemeris
This laravel package perform queries to the Swiss Ephemeris executable.
The aim of this project is to query ephemeris data to produce planetar positions in order to be used for purposes such as astronomy/astrology, calendars, biodynamic agriculture, ect.
In this software, only a fraction of the swiss ephemeris are used: you can query planets, Moon, and known asteroids from 1800 CE (AD) to 2399 CE (AD).
Installation
composer require marcoconsiglio/ephemeris
After installation, composer will automatically publish the Swiss Ephemeris library and the executable in the resources/swiss_ephemeris directory. Remember to grant execution privileges to the resources/swiss_ephemeris/swetest file, otherwise this software won't work.
To extend the ephemeris data, download the ephemeris files you wish and put them in the resources/swiss_ephemeris directory. If you don't know which files to download to extend the time range of the ephemeris, please refer to the Description of the ephemerides.
Usage
First of all, to query ephemeris data you need to instantiate the 'LaravelSwissEphemeris' class. You need to pass latitude, longitude and timezone to the constructor.
/** @var \MarcoConsiglio\Ephemeris\LaraverlSwissEphemeris $ephemeris */ $ephemeris = new LaravelSwissEphemeris( $this->config->get("ephemeris.latitude"), $this->config->get("ephemeris.longitude"), $this->config->get("ephemeris.timezone") );
or instead
/** @var \MarcoConsiglio\Ephemeris\LaraverlSwissEphemeris $ephemeris */ $ephemeris = new LaravelSwissEphemeris( 41.902782, // Decimal latitude 12.496366, // Decimal longitude "Europe/London" // Timezone );
If something went wrong (e.g. like uncorrect permission for the files placed in the folder resources/swiss_ephemeris, outbound quering date, ect.) it will throw a MarcoConsiglio\Ephemeris\Exceptions\SwissEphemerisException exception.
Premise
When using the word collection, it is meant that the class extends the Illuminate\Support\Collection, so you can treat it like any other collection.
API Documentation
For more information, see the API documentation at ./docs/html.