Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Create a wrapper of the node library #1

Open
anroopak opened this issue Feb 6, 2020 · 3 comments
Open

Create a wrapper of the node library #1

anroopak opened this issue Feb 6, 2020 · 3 comments

Comments

@anroopak
Copy link

anroopak commented Feb 6, 2020

Python implementation should be a wrapper of the node library. This would help because any change in the Node library can be easily ported to the Python library. If not any change in the Node lib would need changes in the Python repo, and vice versa.

@floydpink
Copy link
Member

Great suggestion, @anroopak - this is a library that could be helpful in getting this done: https://github.com/aws/jsii

If you have the time (and inclination), please go ahead and start with the implementation. :)

@anroopak
Copy link
Author

anroopak commented Feb 6, 2020

Great, I was looking for this library. Couldn't find, so had started building the library from scratch.
Anyways, I will now build the Python lib with this

@floydpink
Copy link
Member

@anroopak - I converted the JavaScript implementation into TypeScript and added a pipeline to create Python, dotnet and Java wrappers based on that using aws/jsii - when you get a chance, please check out the python package: https://pypi.org/project/kollavarsham/ 🙂

Here is a small snippet that worked for me:

import datetime
import pytz
import kollavarsham

now = pytz.utc.localize(datetime.datetime.utcnow())
kv = kollavarsham.Kollavarsham(latitude=10, longitude=76.2, system="SuryaSiddhanta")

today = kv.from_gregorian_date(date=now)
print(today.year, today.ml_masa_name, today.date, '(' + today.naksatra.ml_malayalam + ')') # => 1195 കുംഭം 3 (വിശാഖം) 7

/cc @namboodiri @arunkutty

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants