Closed drdhaval2785 closed 6 years ago
@vvasuki
The flask_restplus application is working locally. I tried running it on apache2 server. It seems that I am missing something. Can you help me in deploying it?
https://github.com/drdhaval2785/prakriya/blob/master/yourapplication.wsgi is the wsgi file https://github.com/drdhaval2785/prakriya/blob/master/dhatu_restplus.py is the restplus app.
Regarding point 2, I would leave it to the client side to do the transliteration.
What was the problem? log kim avadat?
https://github.com/kmadathil/sanskrit_parser/tree/master/wsgi ityapi pashyatu.
You need to enable wsgi module, and enable the wsgi configuration
Point 3 done. It was a problem of not restarting apache after changes in app. Resolved now.
http://api.sanskritworld.in/#/default is where the swagger documentation of API is available.
Point 1 and 2, I am not so sure whether they are more intuitive. I will wait for user feedback. After swagger documentation, things looks quite simple. Thanks @vvasuki for drawing my attention to flask-restplus and swagger. This is my first python API.
Looks great!
Now, I don't know and have to guess what the expected encoding is. should I type gacCati or gachChati or gacCawi etc..? Now, that's where http://api.sanskritworld.in/v0.0.1/tinantas/slp1/jagAma/prakriya?encoding=devanaagarii would make it crystal clear. It tells you the following:
Please note that REST API consumers in general are used to some conventions and best practices, which have been generally accepted for a reason. One should be wary of disregarding it without good reason (in other words, you should by default follow the convention, and expect users to demand that you don't rather than the other way round.)
Regarding the output encoding though, atleast for http://api.sanskritworld.in/v0.0.1/jagAma/prakriya, which you claim is meant to be human readable - you should include the encoding=devanaagarii parameter. As it is, I find myself feeling the following:
"upadeSe'janunAsika it (1.3.2) -> gamx!",
in this supposedly human readable output since it looks like gobbledygook to me.Achieving this is quite simple - just use our indic_transliteration module and call sanscript. I can do it for you if you give me write permission here; and if dependencies are clear so that I can test it.
New APIs for version 0.0.2. See documentation at https://api.sanskritworld.in/.
Full data API - https://api.sanskritworld.in/v0.0.2/verbforms/slp1/jagAma?output_transliteration=devanagari (Recommended for UI development by @avinashvarna , as it has all possible info.)
prakriya API - https://api.sanskritworld.in/v0.0.2/verbforms/slp1/jagAma/prakriya?output_transliteration=devanagari
Rest two APIs would not be much of interest, as they are subset / modification of the earlier two.
https://api.sanskritworld.in/v0.0.2/verbforms/slp1/jagAma/{argument}?output_transliteration=devanagari See documentation for argument details. https://api.sanskritworld.in/v0.0.2/verbforms/slp1/jagAma/prakriya/machine?output_transliteration=devanagari - returns prakriya in lists.
@avinashvarna Please adjust the UI.
You can tweak the output_transliteration parameter with other values and see if the data is returned in proper encoding or not.
As per @vvasuki
You'd be following REST API conventions (google it) better and it would be clearer if the URI were http://api.sanskritworld.in/v0.0.1/tinantas/slp1/jagAma/prakriya
And you might have the API automatically produce the output in a desired encoding with query parameters of the type: http://api.sanskritworld.in/v0.0.1/tinantas/slp1/jagAma/prakriya?encoding=devanaagarii
Further, you might want to publish the swagger API documentation (Example https://api.vedavaapi.org/scala/swagger/index.html#/grammarv1analyser/Analyse1 or https://api.vedavaapi.org/py/ullekhanam/docs#!/default/get_book_list ) for your API - just use flask-restplus library.