A RESTful API for calculating astrological charts using Swiss Ephemeris. This API provides endpoints for calculating natal charts, transits, and aspects.
- Calculate natal charts with planetary positions
- Calculate transits for any date
- Support for major planets, nodes, and Chiron
- Whole Sign house system
- Aspect calculations between planets
- Beautiful Unicode symbols for astrological glyphs
- Clone the repository:
git clone https://github.com/yourusername/astro-api.git
cd astro-api- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Start the server:
gunicorn "app:app" --bind 127.0.0.1:5000POST /natal
Request body:
{
"birth_date": "1983-10-25",
"birth_time": "06:19",
"birth_place": {
"latitude": 42.4584,
"longitude": -71.0662,
"timezone": "America/New_York"
}
}POST /transits
Request body:
{
"birth_data": {
"birth_date": "1983-10-25",
"birth_time": "06:19",
"birth_place": {
"latitude": 42.4584,
"longitude": -71.0662,
"timezone": "America/New_York"
}
},
"transit_date": "2024-04-11"
}- The API uses the Swiss Ephemeris package (
pyswisseph) for calculations - Ephemeris files are included with the package - no additional setup needed
- All calculations use the Whole Sign house system
- Timezone handling is automatic based on the provided location
To run tests:
python -m pytest tests/- Create a new Web Service on Render
- Connect your GitHub repository
- Configure the following settings:
- Environment: Python
- Build Command:
pip install -r requirements.txt - Start Command:
gunicorn "app:app" --bind 0.0.0.0:$PORT
- Add any necessary environment variables
- Deploy!
MIT License - see LICENSE file for details