virtualvinodh / aksharamukha-python

Aksharamukha Python Library
GNU Affero General Public License v3.0
43 stars 15 forks source link

Get script options via Python API #11

Open scossu opened 11 months ago

scossu commented 11 months ago

Hello, I'm evaluating the integration of Aksharamukha with a general-purpose transliteration tool: https://github.com/lcnetdev/scriptshifter/

It's working very well, except that I can't programmatically retrieve the options available for a specific script via the Python module.

I have tried detect_preoptions() but that returns a list for a specific string. I want to retrieve all the options without knowing what the string would be.

Is there a function that I can access to get all the possible options for a script?

virtualvinodh commented 11 months ago

Hello,

Unfortunately. As of now, you can't. I am gonna update the package soon. There are a few bugs that need to be fixed.

You can find the list here:

https://github.com/virtualvinodh/aksharamukha/blob/master/aksharamukha-front/src/mixins/ScriptMixin.js

You'd have to parse the JS and retrieve the JS variables with the prefix: preOptions*

I can expose a method.

I will push it with my next update.

scossu commented 11 months ago

Exposing a method would be ideal. Could it return all the information, including human-readable label and descriptions / examples as in the documentation page?

Thanks a lot.

virtualvinodh commented 11 months ago

Yeah. That's possible. I developed the package originally as just a backend for my tool.

So, lots of things are in the front-end codebase.

Ideally, they should be here anyway.

If you need anything just raise an issue and I can keep track of things.

scossu commented 11 months ago

Wonderful. Thank you. I have been requested to add several more languages to my app and not having to add and maintain the options manually would be a huge bonus.