KP Astrology REST Server: Part 2

Written by on June 8, 2024 in Astrology, C++ with 0 Comments

In my earlier article, I had briefly described the REST server I wanted to build for Krishnamurti Padhdhati system of astrology. After a long time I have managed to complete the implementation and it is now ready for deployment.

In this article, I will go over some of its features with the hope it will be useful to developers interested in building astrology applications, in particular, using the KP System.

KPRest: A REST Engine

The product is named “KPRest” and as the name suggests, it is a REST server engine. The core engine is written in C++ and is based on my astrology software called “KPAstro”. KPAstro is hugely popular among KP system followers and has users in many countries across the world. The inspiration for developing the REST engine was the many requests I received from application developers who wanted to build interesting astrology applications using the KP System, but who did not have the basic resource or the time to build the core astrology engine. KPRest solves this problem elegantly.

Let us get back to the product. This is a Windows-based product and when you launch it, this is the startup screen:

KPRest Application Window

KPRest Application Window

To start the server, click “Start”. If you want to test the product in your browser, click “Open Browser”. This will launch the default browser, which connects to the server and displays the initial message from the engine.

Welcome Message in Browser

Welcome Message in Browser

Let us say that we want to create a Natal chart. The request is made using the query “/natal” with the following additional parameters (the values are just for example):

Day = 13, Month = 6, Year = 1965

Hour = 10, Min = 30, Sec = 20

Latitude = 28:36:0 North

Longitude = 77:12:0 East

Standard Time, Time zone = GMT +5.5 hrs, Daylight Savings = 0

This could be entered as part of the URL as under:

Creating Natal Chart in Browser

Creating Natal Chart in Browser

 

The system responds with an “OK”message.

Once the chart is created, we can send other requests to the server, for example, to get the Planets’ positional details, Significators, Aspects, Bala, etc. Each request has a unique URL end point.

Instead of interacting with the server via the Browser, it is more convenient to write a client application. Following this idea, I have implemented a Python program to interact with the REST server.

Here is a sample output from the Python program. It creates a Natal chart (as we did in the Browser), prints the chart details for verification and fetches the Day Lord, Thithi, Hora, Karana, and Nithya Yoga:

Creating Chart in Python Client

Creating Chart in Python Client

Here is the code fragment for creating Natal and Horary charts:

Creating Charts in Python

Code for Creating Charts in Python

The detailed information regarding various planets such as Position, Sign, House, Star, and the lords (Sign/Star, Sub, Subsub, S3, and S4) can be retrieved.

Planetary Details

Planetary Details

Western Aspects between planets can also be obtained from the server. Here is a sample:

Western Aspects Between Planets

Western Aspects Between Planets

Although it is not directly used in KP System, many astrologers make use of “Bala” in their analysis. KPRest engine can calculate this too. Here is the Python code to get it from the server:

Python Code for Retrieving Bala

Python Code for Retrieving Bala

Here is the output from the program:

Bala Output from Program

Bala Output from Program

There is a lot more that we can ask the engine to provide. As I mentioned earlier, the engine supports Natal as well as Horary (1 to 2193) charts.  

If you are interested to know more about the engine and how it will be useful to you as a software developer, feel free to contact me at ranga@mmsindia.com or ranga@kpastrosoftware.com

Have a nice weekend!

Tags: , ,

Subscribe

If you enjoyed this article, subscribe now to receive more just like it.

Subscribe via RSS Feed

Leave a Reply

Your email address will not be published. Required fields are marked *

Top