diff --git a/README.md b/README.md index b9f73e2..6f0c09c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # PII Application ### About -This application identifies likely PII (personally identifiable information) in a dataset. To use, download the .exe from the latest release and follow the in-app directions. +This application identifies likely PII (personally identifiable information) in a dataset. To use, download the .exe installer from the [latest release](https://github.com/PovertyAction/PII_detection/releases/latest) and follow the in-app directions. This tool is current listed as an alpha release because it is still being tested on IPA PII-containing field datasets. @@ -49,5 +49,11 @@ J-PAL: PII-Scan. 2017. https://github.com/J-PAL/PII-Scan The PII script is [MIT Licensed](https://github.com/PovertyAction/PII_detection/blob/master/LICENSE). -### To create .exe from source file -`pyinstaller --onefile --windowed --icon=app.ico --add-data="app.ico;." --add-data="ipa_logo.jpg;." --additional-hooks-dir=. --hiddenimport srsly.msgpack.util app_frontend.py` \ No newline at end of file +### Distribution + +#### To create executable app +`pyinstaller --windowed --icon=app_icon.ico --add-data="app_icon.ico;." --add-data="ipa_logo.jpg;." --additional-hooks-dir=. --hiddenimport srsly.msgpack.util app_frontend.py` + +#### To create windows application installer +Compile `create_installer.iss` using Inno Setup Compiler + diff --git a/app_frontend.py b/app_frontend.py index 24b40e2..23c8f6d 100644 --- a/app_frontend.py +++ b/app_frontend.py @@ -7,6 +7,7 @@ from PIL import ImageTk, Image import webbrowser import os +import requests import PII_data_processor @@ -14,7 +15,8 @@ intro_text = "This script is meant to assist in the detection of PII (personally identifiable information) and subsequent removal from a dataset. This is an alpha program, not fully tested yet." intro_text_p2 = "You will first load a dataset that might contain PII variables. The system will try to identify the PII candidates. Please indicate if you would like to Drop, Encode or Keep them to then generate a new de-identified dataset."#, built without access to datasets containing PII on which to test or train it. Please help improve the program by filling out the survey on your experience using it (Help -> Provide Feedback)." -app_title = "IPA's PII Detector - v0.2.17" +version_number = "0.2.18" +app_title = "IPA's PII Detector - v"+version_number #Maps pii to action to do with them pii_candidates_to_dropdown_element = {} @@ -333,9 +335,9 @@ def window_setup(master): #Add window icon if hasattr(sys, "_MEIPASS"): - icon_location = os.path.join(sys._MEIPASS, 'app.ico') + icon_location = os.path.join(sys._MEIPASS, 'app_icon.ico') else: - icon_location = 'app.ico' + icon_location = 'app_icon.ico' master.iconbitmap(icon_location) #Set window position and max size @@ -616,6 +618,20 @@ def import_file(): return first_view_frame +def check_for_updates(): + if internet_connection: + #Get version of latest release + response = requests.get("https://api.github.com/repos/PovertyAction/PII_detection/releases/latest") + latest_version = response.json()["tag_name"] + + #Case it has a v before version number, remove it + latest_version = latest_version.replace("v","") + + #Check if this version_number is different to latest + if version_number != latest_version: + + messagebox.showinfo("Message", "Version "+latest_version+ " is available. You can uninstall this version from Control Panel and download latest from https://github.com/PovertyAction/PII_detection/releases/latest") + if __name__ == '__main__': #Check internet connection @@ -657,5 +673,8 @@ def import_file(): #Create first view page first_view_frame = create_first_view_page(internet_connection) + #Check for updates of this program + check_for_updates() + # Constantly looping event listener root.mainloop() diff --git a/app.ico b/app_icon.ico similarity index 100% rename from app.ico rename to app_icon.ico diff --git a/constant_strings.py b/constant_strings.py index 4416960..2519782 100644 --- a/constant_strings.py +++ b/constant_strings.py @@ -49,7 +49,7 @@ UGANDA = 'Uganda' ZAMBIA = 'Zambia' -ALL_COUNTRIES = [PHILIPPINES,BOLIVIA,COLOMBIA,DOMINICAN_REPUBLIC,MEXICO,PARAGUAY,PERU,BURKINA_FASO,COTE_DIVOIRE,GHANA,LIBERIA,MALI,SIERRA_LEONE,KENYA,MALAWI,RWANDA,TANZANIA,UGANDA,ZAMBIA] +ALL_COUNTRIES = [PHILIPPINES,BOLIVIA,COLOMBIA,DOMINICAN_REPUBLIC,MEXICO,PARAGUAY,PERU,BURKINA_FASO,COTE_DIVOIRE,GHANA,LIBERIA,MALI,SIERRA_LEONE,KENYA,MALAWI,RWANDA,TANZANIA,UGANDA,ZAMBIA, MYANMAR, BANGLADESH] COUNTRY_NAME_TO_ISO_CODE = { MEXICO:'mx', @@ -73,4 +73,4 @@ TANZANIA : 'tz', UGANDA : 'ug', ZAMBIA : 'zm' -} \ No newline at end of file +} diff --git a/create_installer.iss b/create_installer.iss new file mode 100644 index 0000000..34862b2 --- /dev/null +++ b/create_installer.iss @@ -0,0 +1,122 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{94D8F08C-01F1-46FF-89DF-EB240476F308} +AppName=PII Detector +AppVersion=0.2.18 +;AppVerName=PII Detector 0.2.18 +AppPublisher=IPA +AppPublisherURL=https://www.poverty-action.org/ +AppSupportURL=https://www.poverty-action.org/ +AppUpdatesURL=https://www.poverty-action.org/ +DefaultDirName={autopf}\PII Detector +DisableProgramGroupPage=yes +; Uncomment the following line to run in non administrative install mode (install for current user only.) +;PrivilegesRequired=lowest +OutputDir=C:\Users\felip\PII_detection\dist +OutputBaseFilename=installer +SetupIconFile=C:\Users\felip\PII_detection\dist\app_frontend\app_icon.ico +Compression=lzma +SolidCompression=yes +WizardStyle=modern +UninstallDisplayIcon=C:\Users\felip\PII_detection\dist\app_frontend\app_icon.ico + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "C:\Users\felip\PII_detection\dist\app_frontend\app_frontend.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\_asyncio.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\_bz2.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\_cffi_backend.cp38-win_amd64.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\_ctypes.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\_decimal.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\_elementtree.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\_hashlib.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\_lzma.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\_multiprocessing.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\_overlapped.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\_queue.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\_socket.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\_sqlite3.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\_ssl.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\_testcapi.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\_tkinter.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\_win32sysloader.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\app_frontend.exe.manifest"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\app_icon.ico"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\base_library.zip"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\ipa_logo.jpg"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\kiwisolver.cp38-win_amd64.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\lib_arpack-.2SFL42HHZ4PZ2ZKTBHULWLJDO6SPOBMX.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\lib_blas_su.SXX6OHFC3HLK4TC7SFHY7EWYWTE5NEP4.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\lib_dop-f2p.MT27WXU45SIAX6ASQY7CWYIOK7BE6F7J.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\lib_test_fo.JF5HTWMUPBXWGAYEBVEJU3OZAHTSVKCT.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libansari.R6EA3HQP5KZ6TAXU4Y4ZVTRPT7UVA53Z.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libbanded5x.UEB2FLNQUK6ENP6F3JWHGFRKAZK4HKSY.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libbispeu.7AH3PCQ2E2NGLC3AQD7FFAH73KGJTZCJ.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libblkdta00.37OSC2UPECTMIA7QHKFZHTBBNLYMZSNK.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libchkder.G7WSOGIYYQO3UWFVEZ3PPXCXR53ADVPA.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libcobyla2.25EVUSEBAW7VKISARB7LO3UGZPN2HXE3.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libcrypto-1_1.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libd_odr.7J2262VJOKVQJ7Z3VSIPRAHJ2HVZT6XS.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libdcsrch.I2AOPDCXAPDRFNPWY55H5UE7XZSU5CVN.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libdet.UUOGCNYYSRH3SKVQWBDSEP6DWIQWRKZZ.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libdfft.77WLEPRRLEPFIH4KZHFRYQ2UQCA5NONS.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libdfitpack.LMAPXDO5462XTHNWXJBZFJU252ZVABKI.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libdgamln.733CLDMODMP7N4V4VYG5MATCENMLG4I7.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libdqag.PQITPNDDR3HSJ44XDB4N3Z7BDX2UD3YH.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libffi-7.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libgetbreak.SA5VDN7OR4E3PWZFT4TPMX4W2XB5FYNN.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\liblbfgsb.NEXG7QLBFLBCFD42PO5V4IWCPCUGPOCB.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\liblsoda-f2.5XWPH7KY2GYX4D6G5T6U6R45H4XHBJNK.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libmvndst.IUWFZM2WSUQ3UTGQHFQ26ATH2A2TIUVI.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libnnls.4HUTGAJQTI623WTX372VAIIWXRLC62YU.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libopenblas.3HBPCJB5BPQGKWVZAVEBXNNJ2Q2G3TUP.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libopenblas.PYQHXLVVQ7VESDPUVUADXEVJOBGHJPAY.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libslsqp_op.RGGN6ZOFD2K47X7YRNDYCM7JFP4AGLER.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libspecfun.LQCTHMCYNULEOOGKIO6AGREE6D6V37RU.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libssl-1_1.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libvode-f2p.RRWIMSVJVJPENFKJSLUK5L6Z2HONNEBQ.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libwrap_dum.FFMEUDAAWA4OWVO76EOZPAZXI2N7FSIX.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\libwrap_dum.TETSETQV7VQPKMY44CVVUBZUQEOXJF73.gfortran-win_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\mfc140u.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\msvcp140.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\pvectorc.cp38-win_amd64.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\pyexpat.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\python38.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\pythoncom38.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\pywintypes38.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\select.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\sqlite3.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\tcl86t.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\tk86t.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\unicodedata.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\VCRUNTIME140.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\win32api.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\win32clipboard.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\win32evtlog.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\win32pdh.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\win32security.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\win32trace.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\win32ui.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\win32wnet.pyd"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\winpty.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\felip\PII_detection\dist\app_frontend\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Permissions: users-modify +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{autoprograms}\PII Detector"; Filename: "{app}\app_frontend.exe" +Name: "{autodesktop}\PII Detector"; Filename: "{app}\app_frontend.exe"; Tasks: desktopicon +Name: "{autoprograms}\PII Detector"; Filename: "{app}\app_frontend.exe"; IconFilename: "{app}\app_icon.ico" +Name: "{autodesktop}\PII Detector"; Filename: "{app}\app_frontend.exe"; IconFilename: "{app}\app_icon.ico" + +[Run] +Filename: "{app}\app_frontend.exe"; Description: "{cm:LaunchProgram,PII Detector}"; Flags: nowait postinstall skipifsilent + diff --git a/dist/README.md b/dist/README.md deleted file mode 100644 index 6383c0a..0000000 --- a/dist/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Caveats to consider when running pii_detector_vXXXX.zip - -* The zip file contains all files needed to run the app, in addition to a .exe to execute the app, named `pii_detector_vXXXX.exe`. This `.exe` depends on all the files inside the zip, so after unzipping, you must not move the `.exe` from its folder. -* The app is still being tested. This is not a final version. Please provide feedback after using it [here](https://docs.google.com/forms/d/e/1FAIpQLSfxB_pnReUd0EvFfQxPu5JI9oRGCpDgULWkTeDHYoqx8x7q-Q/viewform). -* Windows might show warning when opening .exe. Please click on 'More info' and then 'Run anyway'. -* After double clicking on the .exe, the application will take a bit to load -* If app shows ‘Windows not responding’, it is probably not an error, but just program working in the back. diff --git a/dist/pii_detector_v0.2.17.zip b/dist/pii_detector_v0.2.17.zip deleted file mode 100644 index 8608a64..0000000 --- a/dist/pii_detector_v0.2.17.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c7cbcd5cc643eb0d2a4d4d13a54d3be6e47d45ba76ead47d936e64b255ce39ce -size 108197885