Birthdata Needed
input_birthdata
input_birthdata to be used to provide input birthdata with below parameters.
Input parameters all must be strings (Even numbers must be provided as strings)
Parameters as below:
- name : its the name of the person whose astrological data you want to compute
- gender : This is gender of the person. "male" , "female" and "others" are the options
- year : this is the birth year of the person. it must be given in 4 digit format as a string ex: "1992"
- month : This is birth month of the person. you can either provide month number in string like "3" for March. Or else you can use the constants like jyotishyamitra.September Constants for All 12 months are provided.
- day :This is the day part of date when the person was born. it also needs to be number provided as string like "31" if the person is born on 31st of some month and year.
- hour : This is hour part of birth time of the person. It is 24 hour format to be provided as string. ex: for 3 PM the value for hour will be "15" and for 3 AM it will be "3"
- min : This is minute part of birth time of the person. It is to be provided as string. ex: for 3.25 the value for min will be "25".
- sec : This is seconds part of birth time of the person. This is not mandatory. if not provided it will take value of 0seconds. It is to be provided as string and only if you know exact second of birth time. ex: for 3.25.16 the value for min will be "16".
- place : This is the place name where the person was born. this also is a string. ex: "Honavar"
- longitude : This is the longitude of the birthplace. This is in Decimal degree format. For East the value will be positive number and for West it will be negative number. For example Honavar longitude is 74.4439° E and so longitude value will be "74.4439". Also if the Longitude of a place is 70° W 30' then first convert 30 minutes to degrees which is 0.5 degrees. and since its west it will be negative. So longitude value will be "-70.5" in string format as you can see here.
- lattitude : This is the lattitude of the birthplace. This is in Decimal degree format. The format is similar to longitude but here for North the value will be positive number and for South it will be negative number. For example Honavar lattitude is 14.2798° N and so lattitude value will be "14.2798" in string format as you can see here.
- timezone : This is the GMT tiezone value in decimal hour format. For example the timezone of Honavar is GMT + 5 hr 30 min and so the value of timezone will be "+5.5". And for newyork the timezone is GMT - 4 hr and so the timezone value would be "-4.0" in string format as you can see here.
This API returns the dictionary with all the provided input data till that point.
You can call this API to provide the input data in a single shot as shown below:
#Providing birthdata of the person
inputdata = jyotishyamitra.input_birthdata(name="Shyam Bhat", gender="male", year="1991", month=jyotishyamitra.October, day="8", hour="14", min="47", sec="9", place="Honavar", longitude="+74.4439", lattitude="+14.2798", timezone="+5.5")
print(inputdata)
Alternatively you can provide the birthdata in multiple calls as shown below:
#providing Name and Gender
inputdata = jyotishyamitra.input_birthdata(name="Shyam Bhat", gender="male")
#providing Date of birth details
inputdata = jyotishyamitra.input_birthdata(year="1991", month="10", day="8")
#Providing Place of birth details
inputdata = jyotishyamitra.input_birthdata(place="Honavar", longitude="+74.4439", lattitude="+14.2798", timezone="+5.5")
#Providing Time of birth details
inputdata = jyotishyamitra.input_birthdata(hour="14", min="47", sec="9")
print(inputdata)
clear_birthdata
This API is used to clear the birth data given previously. It returns the structure of birthdata which will be empty.
It is highly recommended to call this API before providing fresh birth data using API input_birthdata()
.
#Clearing previlous input data to have a fresh start
inputdata = jyotishyamitra.clear_birthdata()
print(inputdata)
#Providing fresh birthdata of the person
inputdata = jyotishyamitra.input_birthdata(name="Shyam Bhat", gender="male", year="1991", month=jyotishyamitra.October, day="8", hour="14", min="47", sec="9", place="Honavar", longitude="+74.4439", lattitude="+14.2798", timezone="+5.5")
print(inputdata)
validate_birthdata
This API is used to validate all the birthdata provided using API input_birthdata
.
If any of birth data is not provided then this API shall provide that in string format. Or if any parameter format is wrong then also it returns that error in strong format.
If all the input birth datas are proper then this API returns "SUCCESS". Only after the data is validated then the input data can be used for further processing.
IsBirthdataValid
This API is used to check if the input data is validated or not and if if its valid. Its return value is boolean
Retrun value meanings
True: Input birthdata is validated and is Valid.
False: Either the input birth data is not validated (API
validate_birthdata
is not called). If validated then birthdata is not valid.
get_birthdata
This API is used to get the input data as a dictionary once it is validated. This API returns the input birthdata if its validated successfully. If birthdata is not validated then this API returns None
set_output
This API allows the user to provide a existing destination path and name of output json file in which the astrological data would be saved. This API takes 2 parameters as input:
If the output path and file name are set successfully then this function returns "SUCCESS". Example usage of this API is shown below:
#To create D:\Project\jyotishyamitra\astroOutput.json.
#Note that Folder location D:\Project\jyotishyamitra must already exist in the system for this API to work.
status = jyotishyamitra.set_output(path="D:\Project\jyotishyamitra", "astroOutput")
print(status)
get_output
This API gives you full location of the generated json file with astrological data.
Always make sure that this APIn is called only after set_output
is called to set the destination first.
Below the example code to demonstrate the usage of the API is given
status = jyotishyamitra.set_output(path="D:\Project\jyotishyamitra", "astroOutput")
if (status == "SUCCESS"):
print(jyotishyamitra.get_output())
#This results in output : 'D:\Project\jyotishyamitra\astroOutput.json'
generate_astrologicalData
This is the most important API of this module. This API takes valid birthdata which is returned by API get_birthdata
after the input data is validated as input and computes the astrological data based on indian vedic astrology and siderial ayanamsha and nirayana method and stores all those computed astrological data either in json format in the file created in the location set by API set_output
or in a dictionary depending on the input parameter returnval.
This API takes 2 input parameters :
get_birthdata
. This is a mandatory input parameter for this API.Note : If input birth data is not provided properly and not validated successfully before calling this API then it returns "INPUT_ERROR" and doesnt compute any astrological data. Similarly if output path is not provided using API
set_output
before calling this API and in the API the return of JSON file expected, then it returns "OUTPUTPATH_ERROR" and doesnt compute any astrological data as well.Below listed astrological data are computed by this module
- User Details like name, rashi, nakshatra, vaara, tithi, karana, maasa etc along with birth details
- Lagna chart components ascendant, planets and their sign, house, nakshatra, nakshatra lord, their friends, enemies etc
- All 16 Varga chart details and vargottama
- functional and natural benefics and malefics in the chart
- Different planetery balas like vimshopaka bala, Shadbala and their sub divisions
- Strengths of houses - BhavaBalas and their sub divisions (Adhipathi bala, Digbala and drishti bala)
- AshtakaVarga - Bhinna Ashtakavarga of all 7 planets from Sun to Saturn and Sarvashtaka varga
- and many many more....
To clearly understand all the various astrological data computed in detail refer to section of Astrological Datas.
Below Steps have to be followed in API invocation to get the Astrological data properly.
clear_birthdata
input_birthdata
in a single shot or multiple steps. Make sure all the input birth data is provided.validate_birthdata
IsBirthdataValid
and if yes then get the birthdata by calling get_birthdata
. This return value of API get_birthdata
is important and store this birthdata dictionary in a variable which will be passed as input variable in next steps to compute astrological data. set_output
. Make sure this API returns 'SUCCESS'
to make sure the location provided is proper.generate_astrologicalData
with input parameter birthdata we had fetched in step 4 as input parameter to this api. The return value is the output json file with its location where the astrological data are generated. get_output
API.
Hence the Astrological data is computed for given birth data in json file format. import jyotishyamitra as jsm
#step 1 :clear past input data
jsm.clear_birthdata()
#Step 2: Providing input birth data - here multiple times the API input_birthdata are invoked but you can do it in single shot too.
#providing Name and Gender
inputdata = jsm.input_birthdata(name="Shyam Bhat", gender="male")
#providing Date of birth details
inputdata = jsm.input_birthdata(year="1991", month=jsm.October, day="8")
#Providing Place of birth details
inputdata = jsm.input_birthdata(place="Honavar", longitude="+74.4439", lattitude="+14.2798", timezone="+5.5")
#Providing Time of birth details
inputdata = jsm.input_birthdata(hour="14", min="47", sec="9")
#Step 3: Validate Birthdata
jsm.validate_birthdata()
#Step 4: If Birthdata is valid then get birthdata
if(jsm.IsBirthdataValid()):
birthdata = jsm.get_birthdata()
#Step 5: Set the output folder and name of file to save generated astrological data
if("SUCCESS" == jsm.set_output(path="D:\OutFolder", filename="astroOutput")):
#Step 6: Computing Astrological data
jsm.generate_astrologicalData(birthdata) #Compute the astrological data based on new set.
print(f'The output is : {jsm.get_output()}') #step 7: to get output file full name
else:
print("Given folder path doesnt exist")
Below Steps have to be followed in API invocation to get the Astrological data properly.
clear_birthdata
input_birthdata
in a single shot or multiple steps. Make sure all the input birth data is provided.validate_birthdata
IsBirthdataValid
and if yes then get the birthdata by calling get_birthdata
. This return value of API get_birthdata
is important and store this birthdata dictionary in a variable which will be passed as input variable in next steps to compute astrological data. generate_astrologicalData
with input parameter birthdata we had fetched in step 4, and returnval value "ASTRODATA_DICTIONARY" as input parameters to this api. The return value is the dictionary where the astrological data are computed and updated. Hence the Astrological data is computed for given birth data in dictionary format using which yopu can process further as you wish.
import jyotishyamitra as jsm
#step 1 :clear past input data
jsm.clear_birthdata()
#Step 2: Providing input birth data - here multiple times the API input_birthdata are invoked but you can do it in single shot too.
#providing Name and Gender
inputdata = jsm.input_birthdata(name="Shyam Bhat", gender="male")
#providing Date of birth details
inputdata = jsm.input_birthdata(year="1991", month=jsm.October, day="8")
#Providing Place of birth details
inputdata = jsm.input_birthdata(place="Honavar", longitude="+74.4439", lattitude="+14.2798", timezone="+5.5")
#Providing Time of birth details
inputdata = jsm.input_birthdata(hour="14", min="47", sec="9")
#Step 3: Validate Birthdata
jsm.validate_birthdata()
#Step 4: If Birthdata is valid then get birthdata
if(jsm.IsBirthdataValid()):
birthdata = jsm.get_birthdata()
#Step 5: Invoke the API generate_astrologicalData with retrunval desired to be dictionary and get astrological data in dictionary format.
astrodata = jsm.generate_astrologicalData(birthdata, returnval = "ASTRODATA_DICTIONARY") print(astrodata)
The below image shows the various Astrological Data generated by this module:
The JSON file has below main sections:
This explains subsections of 16 divisions in ShodashaVarga (16 divisions given by maharshi Parashara). This contains below mentioned details. Here Dx will mean that this field is part of all Divisional charts.
This explains the subsections under sthe section Balas. This includes strengths of houses which is bhavabala and planetery strengths which includes vimshopakabala, Shadbala and ishta-kashta balas
This Section contains various panchanga details when the person was born. The sub sections are
This can be used to develop indian astrology applications and softwares on top of this.
For this module to work you need Python version 3+
Other modules needed for this to work is only pyswisseph:
pip install pyswisseph==2.8.0.post1
Github repository for this module: https://github.com/VicharaVandana/jyotishyamitra.git
For jyotishyamitra package : Click Here