Simplifies Timesheet Entry for DataBasics Timesheets. This should make it much easier to submit your timesheets without having to deal with DataBasics' UI.
Tested in Windows only so far. Pull requests welcome!
- A Python 3.6+ environment
- Chrome Web Browser
- Selenium (can be installed using
pip install selenium) - Flask (can be installed using
pip install flask)
- Clone or download the contents of this repository into a dedicated directory.
- Download the Selenium Chrome driver and place the executable file in the same directory alongside
adb.py - On DataBasics, create as many Favorite/Memorized entries as you will need to cover your timesheet entries. For example, create one for your project, one for vacations, one for meetings, and so on.
- Next, set up an alias file: Create a file called
alias.txtwith each line being a descriptive name for each Favorite created in the previous step, in the same order as they appear on the DataBasics Favorites. Example:
project
vacations
meetings
- Optional: Create an
auth.txtfile with 3 lines: The URL for your DataBasics login page, your username and your password. Example:
https://xxx.data-basics.net/xxx/databasics.ext#
sergiome@gmail.com
p455w0rd
Anytime you want to report your time, just open your terminal, navigate to the directory where the files are located and run:
flask run
If all goes well, the AutoDataBasics UI should be available at the displayed address (i.e. http://127.0.0.1:5000/):
This UI is pretty straightforward, but here's some features:
- Save Draft: Saves your current draft on a
timesheet.txtfile. This file will be used to automatically fill your timesheet next time you open AutoDataBasics. - Delete Draft: Deletes all entries on any existing draft and clears the displayed timesheet.
- Submit to DataBasics: This will start the automated timesheet-filling process. Sit back and watch your timesheet be filled :)
If you want to build an alternate UI for this, change the input file format or extend it in any other way, it should be fairly easy to do. You can just import the script and use the runDataBasics function, which receives the login url, username, password and timesheet lines which is a list of dict/json objects with fav, note and times attributes. Aliases are submitted through the optional alias parameter as a dictionary of str keys and int values.
Example:
import adb
db_url = ...
username = ...
password = ...
alias_dict = {"project":0, "meetings":1}
ts = [{"fav":"project", "note":"this is a note", "times":[1,1,2,4,5]},
{"fav":"meetings", "note":"this is another note", "times":[2,2,3,1,1]},
{"fav":"project", "note":"this is a third note", "times":[1,1,0,0,0]}]
adb.runDataBasics(db_url, username, password, ts, alias=alias_dict)Want to say thanks? Donate to Immigrant Families Together, RAICES or a similar charity :)
