Package: jyotichart
Jyotichart is used to plot the astrological charts in north indian and south indian format.The Sample charts generated for north indian and south indian style is shown belowPython packagePython Package jyotichart can be found here:https://pypi.org/project/jyotichart/Current Version: 2.0.0To install this package please run this command in command prompt using pip:pip install jyotichartGitHub RepositoryRepository :https://github.com/VicharaVandana/jyotichart_packageAuthor: Shyam Bhat
Email ID:bhatshyam.modernastrologer@gmail.comJyotichart as blackboxThis package takes astrological planetery and ascendant positions as input and draws the astrological chart and gives it as output as svg image file saved in given location.You can create eitherNorth Indian ChartorSouth Indian ChartThe default colours and configurations are as shown in above image but you can even customize the colours of signnumbers, lines, background colour , sign colour etc with this package.By default the planets and its aspects are also plotted in the chart. However you can customise to disable the aspects and see only planet positions.Steps to draw North Indian Chart or South Indian Chartimport the packagejyotichartin the module.importjyotichartaschartCreate an instance object of NorthIndian/SouthIndian chart class by passingchart nameandperson namewhose astrological chart you want to create. There is an optional parrameter too calledIsFullChartwhich is by default isTrue. If you keep this parameter true then the positions oif all the planets need to be provided before drawing the chart. Hence the name full chart. If you make this parameter asFalse, that means this is a partial chart which can be drawn with no planets or with subset of planets.#For full NorthIndian chartmychart1=chart.NorthChart("Lagna","Shyam Bhat")#For partial NorthIndian chartmychart2=chart.NorthChart("Special","Deepa Saravi",IsFullChart=False)#For full SouthIndian chartmychart3=chart.SouthChart("Lagna","Shyam Bhat")#For partial SouthIndian chartmychart4=chart.SouthChart("Special","Deepa Saravi",IsFullChart=False)From now on this object will be refered in code snippets asmychart. But in your code you have to take one ofmychart1,mychart2,mychart3ormychart4depending on your needs.The Ascendant Sign has to be provided which will be the first house in the chart. This is done by invoking object methodset_ascendantsign()and the sign is passed as input parameter. There are 12 signs in astrology and pass anyone from below list as a string to this method:"Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Saggitarius","Capricorn","Aquarius","Pisces". Make sure the parameter is same as given above. If case and spelling is wrong then the functionality will not work. For example if you want to set the ascendant sign to Capricorn then you can do as shown below:mychart.set_ascendantsign("Capricorn")Next Provide details of the planets. Each planet detail can be added to the chart by invoking the methodadd_planet(). This method takes 3 mandatory parameters and 3 optional parameters which are explained below:Mandatory Parameters:planet: The planet which is to be added. This is a string value from the list: ["Sun","Moon","Mars","Mercury","Jupiter","Venus","Saturn","Rahu","Ketu"]. Instead of this strings you can use the constants provided by the package as well like for"Sun"You can usechart.SUN. These all values for planets can be copied from below shown code snippet which demonstrates usage of this method in this step.symbol: This is also a string. Whatever you provide here will be updated in the chart to represent that planet. For Moon if you provide the symbol as"Mo"then in the chart diagram wherever moon is placed, you will seeMoas shown in chart diagram above.housenum: This is a integer value between 1 to 12. As the name suggests it must be the house number in which the planet is placed. If planet has to be placed in 5th house then house number must be 5 and so on. Remember there are only 12 houses in jyotishya and so this parameter value cannot be more than 12 or even 0. values 0 and 13 and above are not valid.Optional Parameters:retrograde: This is a boolean value. By default this isFalsewhich means if this parameter is not provided then its assumed that the planet is non-retrograde (except for Rahu and Ketu who are always in retrograde motion) To make the planet retrograde, please provide this parameter value asTrue. In the diagram the retrograde planets will be underlined and will be put inside simple brackets (). You can see that for Rahu and Ketu in above given sample charts.aspectsymbol: Similar to planet symbol, this is also a string. But this string will be to showcase the aspect of the planet in the chart diagram. Please make sure this symbol differs from the planet symbol to ensure the distinction between planet and its aspect in the chart to avoid the confusion. If this parameter is not given then default symbols for that planet will be used to show the aspect in case the aspect is not disabled. The default symbols are as follows:SUN = "☉", MOON = "☾", MARS = "♂", MERCURY = "☿", JUPITER = "♃", VENUS = "♀", SATURN = "♄", RAHU = "☊", KETU = "☋"colour: This is the colour of the planet and its aspect in the chart. By default it is'white'. But if you want to change the colour of the planet in the chart diagram then you can do so using this parameter.Note: This method returns string value"Success"if the planet is added successfully to the chart. But if not then it returns the error message as return value if some fault occured. So please make sure you check the return value to confirm the planet is added successfully.The planets from Sun to Ketu can be added as shown in below code snippet as an example:mychart.add_planet(chart.SUN,"Su",9)mychart.add_planet(chart.MOON,"Mo",9)mychart.add_planet(chart.MARS,"Ma",10,aspectsymbol="m")mychart.add_planet(chart.MERCURY,"Me",9,colour='yellow')mychart.add_planet(chart.JUPITER,"Ju",8,colour="lime",retrograde=True)mychart.add_planet(chart.VENUS,"Ve",8)mychart.add_planet(chart.SATURN,"Sa",1)mychart.add_planet(chart.RAHU,"Ra",12)mychart.add_planet(chart.KETU,"Ke",6)This results in chart generated as shown below:Now since you provided all the details of ascendant and planets you are ready to draw the chart. But before doing that you even have option to update the chart coinfigurations like changing the chart colours like line colour, background colour etc and enabling or disabling the aspect visibilities etc in the chart before plotting. This can be done by using the methodupdatechartcfg(). This method has all optional parameters with each parameter representing a different chart property. If you invoke this method without any parameters then ot resets all configurations with default values. If you want to update some properties then you can provide thoise corresponding parameters only with your chosen values. The parameters of this method are given below:aspect: Default value isTrue. It's a boolean value indicating if the planet aspects should be visible on the chart or not. To disable the aspects only you can do this :mychart.updatechartcfg(aspect=False)clr_background: Default value is'black'. It's a string value indicating the colour of the background of the chart.clr_outbox: Default value is'red'. It's a string value indicating the colour of the outer square box of the chart.clr_line: Default value is'yellow'. It's a string value indicating the colour of the lines of the chart.clr_sign/clr_Asc: Default value is'pink'. It's a string value indicating the colour of the sign numbers on the chart for north indian chart and colour of Asc in south indian chart.clr_houses: Default value is'black'for all 12 houses or signs. It's a list of 12 values with each value being string value indicating the colour of the corresponding house for north indian chart and signs for south indian chart on the chart.Below code snippet demonstrates the usage of methodupdatechartcfg(). Here we will make aspects invisible on the chart. Also the background colour will be made yellow, line colour be made white, sign colour be made lime green. houses 1,5,9 be made green. houses 6,8,12 be made red and remaining houses will be kept black. Remember all config changes has to be made in a single call. if invoked multiple times then oit will be as if only last call was valid and all previopus calls will be nullified.housecolours=['black','black','black','black','black','black','black','black','black','black','black','black']housecolours[0]='green'#FIRST HOUSE OR ARIES (HOUSE FOR NORTH STYLE AND SIGN FOR SOUTH STYLE)housecolours[4]='green'#FIFTH HOUSE OR LEO (HOUSE FOR NORTH STYLE AND SIGN FOR SOUTH STYLE)housecolours[8]='green'#NINTH HOUSE OR SAGGITARIUS (HOUSE FOR NORTH STYLE AND SIGN FOR SOUTH STYLE)housecolours[5]='red'#SIXTH HOUSE OR VIRGO (HOUSE FOR NORTH STYLE AND SIGN FOR SOUTH STYLE)housecolours[7]='red'#EIGHTH HOUSE OR SCORPIO (HOUSE FOR NORTH STYLE AND SIGN FOR SOUTH STYLE)housecolours[11]='red'#TWELFTH HOUSE OR PISCES (HOUSE FOR NORTH STYLE AND SIGN FOR SOUTH STYLE)#For north indian stylemychart.updatechartcfg(aspect=False,clr_background='yellow',clr_line='white',clr_sign='lime',clr_houses=housecolours)#For south iundian stylemychart.updatechartcfg(aspect=False,clr_background='yellow',clr_line='white',clr_Asc='lime',clr_houses=housecolours)As a result the chart image would be generated as shown below:Once all the needed inputs are given, we can draw the chart now by invoking the methoddraw. This method takes just 2 input parameters as shown below:location: Where the drawn chart has to be stored. This has to be a valid location in your current computer and the code needs to have write access to that location.filename: Name of the file as a alphanumeric string which will be given to the svg image to be drawn. Pleasedo not includethe extension in this parameter.The below code sinippet demonstrates usage ofdrawmethod to create the north indian style chart in svg format.mychart.draw("C:/Users/hp/Downloads/astrocharts","LagnaChart")Note: If you want to modify the properties of a planet after adding, Then you have to delete that planet entry and then add it agaion with new properties. To delete a planet entry added you can usedelete_planetmethod. To this only the planet name is input parameter. Example usage is shown in below snippet:mychart.delete_planet(chart.MERCURY)Below Code snippet gives you an example of plotting Full North Indian chart which you can see in above sample chart:importjyotichartaschart#For north chartmychart=chart.NorthChart("Lagna","Shyam Bhat",IsFullChart=True)#For south chartmychart=chart.SouthChart("Lagna","Shyam Bhat",IsFullChart=True)mychart.set_ascendantsign("Capricorn")mychart.add_planet(chart.SUN,"Su",9)mychart.add_planet(chart.MOON,"Mo",9)mychart.add_planet(chart.MARS,"Ma",10)mychart.add_planet(chart.MERCURY,"Me",9,colour='yellow')mychart.add_planet(chart.JUPITER,"Ju",8,colour="lime",retrograde=True)mychart.add_planet(chart.VENUS,"Ve",8)mychart.add_planet(chart.SATURN,"Sa",1)mychart.add_planet(chart.RAHU,"Ra",12)mychart.add_planet(chart.KETU,"Ke",6)mychart.updatechartcfg(aspect=False)mychart.draw("C:/Users/hp/Downloads/astrocharts","LagnaChart")Steps for Numerical ChartsThe Numercal charts are the astrological charts where each house has been assigned a number and no planets placements are there. For example Ashtakavarga chart or bhava-bala chart etc.For this the procedure and steps is almost same as for planetery astrological charts with some differences. These steps are shown below independently.import the packagejyotichartin the module.importjyotichartaschartCreate an instance object of NorthIndian/SouthIndian chart class by passingchart nameandperson namewhose astrological chart you want to create. There is an optional parrameter too calledIsFullChartwhich is by default isTrue. If you keep this parameter true then the positions oif all the planets need to be provided before drawing the chart. Hence the name full chart. If you make this parameter asFalse, that means this is a partial chart which can be drawn with no numbers or with subset of numbers for houses. And the parameter for making this numerical chart istype. This parameter value is by default "planetery". But to make numerical chart you must make this parameter as "numerical"#For full NorthIndian chartmychart1=chart.NorthChart("Lagna","Shyam Bhat",type="numeric")#For partial NorthIndian chartmychart2=chart.NorthChart("Special","Deepa Saravi",IsFullChart=False,type="numeric")#For full SouthIndian chartmychart3=chart.SouthChart("Lagna","Shyam Bhat",type="numeric")#For partial SouthIndian chartmychart4=chart.SouthChart("Special","Deepa Saravi",IsFullChart=False,type="numeric")From now on this object will be refered in code snippets asmychart. But in your code you have to take one ofmychart1,mychart2,mychart3ormychart4depending on your needs.The Ascendant Sign has to be provided which will be the first house in the chart. This is done by invoking object methodset_ascendantsign()and the sign is passed as input parameter. There are 12 signs in astrology and pass anyone from below list as a string to this method:"Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Saggitarius","Capricorn","Aquarius","Pisces". Make sure the parameter is same as given above. If case and spelling is wrong then the functionality will not work. For example if you want to set the ascendant sign to Capricorn then you can do as shown below:mychart.set_ascendantsign("Capricorn")Set the numerical value to each of 12 houses. One numerical value can be set to one house and this can be done using the methodset_numval2house(). This method takes 3 input parameters as shown below:housenum: This is a integer value between 1 to 12. As the name suggests it must be the house number for which the numerical value is to be provided. If numerical value has to be provided for 5th house then house number must be 5 and so on. Remember there are only 12 houses in jyotishya and so this parameter value cannot be more than 12 or even 0. values 0 and 13 and above are not valid. This is a mandatory parameter.value: This is the numerical value which this method is intended to provide to that house. Its an integer value. This is a mandatory parameter.clr: This is an optional parameter. Its default value is"white". This is the colour of the number shown in the chart. If you give this parameter value as"red"then that number will be displayed as Red in chart generated.Below code snippet shows the usage of this method for all 12 housesmychart.set_numval2house(1,24,"lime")# 1st Housemychart.set_numval2house(2,240,"red")# 2nd Housemychart.set_numval2house(3,55)# 3rd Housemychart.set_numval2house(4,7)# 4th Housemychart.set_numval2house(5,735)# 5th Housemychart.set_numval2house(6,142)# 6th Housemychart.set_numval2house(7,3342)# 7th Housemychart.set_numval2house(8,43)# 8th Housemychart.set_numval2house(9,97)# 9th Housemychart.set_numval2house(10,163)# 10th Housemychart.set_numval2house(11,56)# 11th Housemychart.set_numval2house(12,43)# 12th HouseNow since you provided all the details of ascendant and planets you are ready to draw the chart. But before doing that you even have option to update the chart coinfigurations like changing the chart colours like line colour, background colour etc and enabling or disabling the aspect visibilities etc in the chart before plotting. This can be done by using the methodupdatechartcfg(). This method has all optional parameters with each parameter representing a different chart property. If you invoke this method without any parameters then ot resets all configurations with default values. If you want to update some properties then you can provide thoise corresponding parameters only with your chosen values. The parameters of this method are given below:clr_background: Default value is'black'. It's a string value indicating the colour of the background of the chart.clr_outbox: Default value is'red'. It's a string value indicating the colour of the outer square box of the chart.clr_line: Default value is'yellow'. It's a string value indicating the colour of the lines of the chart.clr_sign/clr_Asc: Default value is'pink'. It's a string value indicating the colour of the sign numbers on the chart for north indian chart and colour of Asc in south indian chart.clr_houses: Default value is'black'for all 12 houses or signs. It's a list of 12 values with each value being string value indicating the colour of the corresponding house for north indian chart and signs for south indian chart on the chart.Below code snippet demonstrates the usage of methodupdatechartcfg(). Here we will make aspects invisible on the chart. Also the background colour will be made yellow, line colour be made white, sign colour be made lime green. houses 1,5,9 be made green. houses 6,8,12 be made red and remaining houses will be kept black. Remember all config changes has to be made in a single call. if invoked multiple times then oit will be as if only last call was valid and all previous calls will be nullified.housecolours=['black','black','black','black','black','black','black','black','black','black','black','black']housecolours[0]='green'#FIRST HOUSE OR ARIES (HOUSE FOR NORTH STYLE AND SIGN FOR SOUTH STYLE)housecolours[4]='green'#FIFTH HOUSE OR LEO (HOUSE FOR NORTH STYLE AND SIGN FOR SOUTH STYLE)housecolours[8]='green'#NINTH HOUSE OR SAGGITARIUS (HOUSE FOR NORTH STYLE AND SIGN FOR SOUTH STYLE)housecolours[5]='red'#SIXTH HOUSE OR VIRGO (HOUSE FOR NORTH STYLE AND SIGN FOR SOUTH STYLE)housecolours[7]='red'#EIGHTH HOUSE OR SCORPIO (HOUSE FOR NORTH STYLE AND SIGN FOR SOUTH STYLE)housecolours[11]='red'#TWELFTH HOUSE OR PISCES (HOUSE FOR NORTH STYLE AND SIGN FOR SOUTH STYLE)#For north indian stylemychart.updatechartcfg(clr_background='yellow',clr_line='white',clr_sign='lime',clr_houses=housecolours)#For south iundian stylemychart.updatechartcfg(clr_background='yellow',clr_line='white',clr_Asc='lime',clr_houses=housecolours)Once all the needed inputs are given, we can draw the chart now by invoking the methoddraw. This method takes just 2 input parameters as shown below:location: Where the drawn chart has to be stored. This has to be a valid location in your current computer and the code needs to have write access to that location.filename: Name of the file as a alphanumeric string which will be given to the svg image to be drawn. Pleasedo not includethe extension in this parameter.The below code sinippet demonstrates usage ofdrawmethod to create the north indian style chart in svg format.mychart.draw("C:/Users/hp/Downloads/astrocharts","NumberChart")This results in chart generated as shown below:The Complete code snippet is combined and provided below:importjyotichartaschart#For full NorthIndian chartmychart=chart.NorthChart("Lagna","Shyam Bhat",type="numeric")#For partial NorthIndian chartmychart=chart.NorthChart("Special","Deepa Saravi",IsFullChart=False,type="numeric")#For full SouthIndian chartmychart=chart.SouthChart("Lagna","Shyam Bhat",type="numeric")#For partial SouthIndian chartmychart=chart.SouthChart("Special","Deepa Saravi",IsFullChart=False,type="numeric")mychart.set_numval2house(1,24,"lime")# 1st Housemychart.set_numval2house(2,240,"red")# 2nd Housemychart.set_numval2house(3,55)# 3rd Housemychart.set_numval2house(4,7)# 4th Housemychart.set_numval2house(5,735)# 5th Housemychart.set_numval2house(6,142)# 6th Housemychart.set_numval2house(7,3342)# 7th Housemychart.set_numval2house(8,43)# 8th Housemychart.set_numval2house(9,97)# 9th Housemychart.set_numval2house(10,163)# 10th Housemychart.set_numval2house(11,56)# 11th Housemychart.set_numval2house(12,43)# 12th Housemychart.draw("C:/Users/hp/Downloads/astrocharts","NumberChart")