コード例 #1
0
import datavisualisation as dv
import sqlite3

if __name__ == '__main__':
    p2honours = rf.getpath2honours()
    p2donors = rf.getpath2donations()

    honoursfilelist = rf.findhonfiles(p2honours)
    donorfilelist = rf.finddonfiles(p2donors)

    hon_dict = rf.readfiles(honoursfilelist)
    don_dict = rf.readfiles(donorfilelist)
    print "\n\t\t-File reading finished-"
    print "\n\t\t========================\n"

    dbc.createdb()

    if len(hon_dict) != 0:
        print "--- Adding honours to DB"
        dbc.addhon(hon_dict)

    print "\n\t\t-Added honours to DB-"
    print "\n\t\t========================\n"


    if len(don_dict) != 0:
        print "--- Adding donors to DB"
        dbc.adddon(don_dict)

    print "\n\t\t-Added donors to DB-"
    print "\n\t\t========================\n"
コード例 #2
0
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#

import readfiles as rf
import dataclean as dclean
import dbcalls as dbc
import infovisualisation as iv

if __name__ == '__main__':
    path2csv = rf.getcsvpath()
    dtt = ["Supermarket", "ATM", "Kiosk", "Shopping", "Night Out", "Eating Out", "Transport", "Money In",
           "House", "Rent and Bills", "Hobbies", "Misc"]  # List of default transaction types

    dbc.createdb(dtt)

    csvfiles = rf.findcsvfiles(path2csv)  # List of paths to CSV files
    translist = rf.readcsvfiles(csvfiles)  # List of transactions from all CSV files
    cleanlist = dclean.formatlist(translist)  # Cleans up the transaction data

    dbc.add2db(cleanlist)
    iv.generalview()
    iv.dayview()
コード例 #3
0
import datavisualisation as dv
import sqlite3

if __name__ == '__main__':
    p2honours = rf.getpath2honours()
    p2donors = rf.getpath2donations()

    honoursfilelist = rf.findhonfiles(p2honours)
    donorfilelist = rf.finddonfiles(p2donors)

    hon_dict = rf.readfiles(honoursfilelist)
    don_dict = rf.readfiles(donorfilelist)
    print "\n\t\t-File reading finished-"
    print "\n\t\t========================\n"

    dbc.createdb()

    if len(hon_dict) != 0:
        print "--- Adding honours to DB"
        dbc.addhon(hon_dict)

    print "\n\t\t-Added honours to DB-"
    print "\n\t\t========================\n"

    if len(don_dict) != 0:
        print "--- Adding donors to DB"
        dbc.adddon(don_dict)

    print "\n\t\t-Added donors to DB-"
    print "\n\t\t========================\n"