URL and Link repository

Thursday, June 27, 2019

Python and MySQL on the Kindle Fire HD 6 inch

  • I got a QPython IDE from here: ww.appsapk.com/qpython-python-for-android
  • MySQL and PHPMyAdmin came from here: www.apkfiles.com/apk-541908/android-web-server-kickweb-server-5-0
  • From pip console in the QPython app, I ran "pip install mysql-connector --index-url https://qpypi3.qpython.org/simple/.
  • At the time that you read this, the links may have changed, but the approach will be the same. Find a QPython apk that you can download from outside of Google Play, see if you can use the PIP console to install AI libraries, adjust the QPypi url in the settings if needed, get a web server app with MySQL and PHP, try to install mysql-connector and finally use the IDE to run data analysis on what ever you import into MySQL and scrub. There is a lot of hit and miss, because of the various apks that may be Chinese or Google versions and neither will work. You must find pure Android apks.

    You may also need a fire extinguisher for when the Kindle Fire really does become fire and explodes while running all your clever little machine learning algorithms.

    Friday, June 7, 2019

    Python - Read MySQL Table and Format Output

    # Using phpadmin to load mysql by importing from some of these sources
    # http://www.cboe.com/delayedquote/quote-table
    # https://datashop.cboe.com/option-quotes-end-of-day-with-calcs
    # https://www.stock-data-solutions.com/download.htm
    # https://www.worldtradingdata.com/services
    import mysql.connector
    optionsdb = mysql.connector.connect(
     host="localhost",
     user="root",
     #passwd=""
     database="CSV_DB"
     )
    optionscursor = optionsdb.cursor()
    optionscursor.execute("select convert(`expiration`, CHAR) as expiration, `option_type` as `T`,
    convert(`strike`, CHAR) as `strike`, convert(`delta_1545`, CHAR) as `delta`, convert(`vega_1545`,
    CHAR) as `vega`, convert(`theta_1545`, CHAR) as `theta` FROM `GREEKS` where `open_interest` > 50 and
    ABS(`delta_1545`) > .20 and ABS(`theta_1545`) < 1
    order by `expiration` asc, `option_type` asc, `strike` asc limit 100") optionsresult = optionscursor.fetchall() colheaders = [] colwidths = [] coldivider = '|' colseparator = '+' for names in optionscursor.description: colwidths.append(11) colheaders.append(names[0]) for w in colwidths: coldivider += " %-"+"%ss |" % (w,) colseparator += '-'*w + '--+' print(colseparator) print(coldivider % tuple(colheaders)) print(colseparator) for coldata in optionsresult: print(coldivider % coldata)

    After running, one may get something that looks like this: