معرفی شرکت ها


checkbox-parser-0.0.1


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

this package can parse a list and give a html string
ویژگی مقدار
سیستم عامل -
نام فایل checkbox-parser-0.0.1
نام checkbox-parser
نسخه کتابخانه 0.0.1
نگهدارنده []
ایمیل نگهدارنده []
نویسنده ricardo cantu
ایمیل نویسنده ricardocantum@gmail.com
آدرس صفحه اصلی https://github.com/richyxi/checkbox_parser
آدرس اینترنتی https://pypi.org/project/checkbox-parser/
مجوز -
# checkbox-parser A python module that takes a list object and transforms it to a HTML fieldsets with a question and its answers as checkboxs that can be rendered in flask. The purpose is that the list that is consumed could reside in a noSQL database as a document(MongoDB, Firestore, DynamoDB) # How it works? first, you need a list in this structured way ``` [ { 'id_question': 'first', 'question': 'What is the most important reason for choosing a gym?', 'answers': ['The price', 'That it has personalized attention', 'That it has the best facilities', 'That it has a very long schedule'], 'position': 1 }, { 'id_question': 'third', 'question': 'What pay period is the best for you to go to a gym?', 'answers': ['Annual', 'Bimonthly', 'Monthly'], 'position': 3 }, { 'id_question': 'second', 'question': 'What motivates you the most to join a gym?', 'answers': ['Physical appearance', 'Physical condition', 'Know another social circle'], 'position': 2 } ] ``` Note: * make sure that the id_question value does not repeat itself, this is was intended to map the question with the respectives anwsers Then you just create a html_parser object. This object just needs the list for work In order to get the html you can use the get_html method, this will return the html as string ``` from checkbox_parser import html_parser ... parser = html_parser(data) parser.get_html() ``` # Use with flask This is a little snippet of how you can use it with flask ``` from flask import Flask, render_template from checkbox_parser import html_parser app=Flask(__name__) @app.route("/") def survey(): data = [ { 'id_question': 'first', 'question': 'What is the most important reason for choosing a gym?', 'answers': ['The price', 'That it has personalized attention', 'That it has the best facilities', 'That it has a very long schedule'], 'position': 1 }, { 'id_question': 'third', 'question': 'What pay period is the best for you to go to a gym?', 'answers': ['Annual', 'Bimonthly', 'Monthly'], 'position': 3 }, { 'id_question': 'second', 'question': 'What motivates you the most to join a gym?', 'answers': ['Physical appearance', 'Physical condition', 'Know another social circle'], 'position': 2 } ] parser = html_parser(data) html = parser.get_html() return render_template("your_html_template.html", html=html) if __name__ == "__main__": app.run() ``` Note: * I recommend that in your ninja template use the decode method for the html object, in case this prevents bad characters to be rendered. ``` <form action="/endpoint_get" method="GET" name="myForm"> {{ html.decode('utf-8') | safe }} <div class="container"> <div class="center"> <button id="submit">submit</button> </div> </div> </form> ```


زبان مورد نیاز

مقدار نام
>=3.6 Python


نحوه نصب


نصب پکیج whl checkbox-parser-0.0.1:

    pip install checkbox-parser-0.0.1.whl


نصب پکیج tar.gz checkbox-parser-0.0.1:

    pip install checkbox-parser-0.0.1.tar.gz