A brief demonstration using Python to create timecards in Elite 3E.
Assuming a version of Python 3.6.4 or higher is installed
Create a folder on your local drive. For this example we'll use c:\dev\timecard3e For more instructions see the official documentation for virtual environments
cd c:\dev\timecard3e
python3 -m venv venv
.\venv\Scripts\activate
Use the clone or download button above and save to your project folder (c:\dev\timecard3e).
Ensuring the virtual environment is active (your prompt should look like (venv) C:\dev\timecard3e>
), install the requirements.
pip install -r requirements.txt
The timecards.py file tries to read some environment variables. If on Windows, these can be set in the \venv\Scripts\activate.bat file by appending something like the following to the end of the file. It will be necessary to deactivate and re-activate the virtual environment after making changes to activate.bat.
SET "HTTP_NTLM_AUTH_USER=yourdomain\user.name"
SET "HTTP_NTLM_AUTH_PASS=seCretPassWord"
SET "ELITE_WAPI=elite1"
SET "ELITE_INSTANCE=TE_3E_UAT"
If not set in the environment, the defaults can be placed in line in the code as the second parameter to the os.environ.get calls to end up with something like:
wapi = os.environ.get('ELITE_WAPI', 'elite1')
instance = os.environ.get('ELITE_INSTANCE', 'TE_3E_UAT')
Hoping you've made it this far, now run the timecards.py file. You'll likely want to change the timekeeper and matter in the timecard_attributes method.
python timecard.py
A bunch of output should display to the screen. In reality, I've used a custom process that takes the entry and posts/releases it immediately, but in this sample, we're using the TimeCardUpdate process which will put an entry onto the action list of the user specified in HTTP_NTLM_AUTH_USER.
I've switched to Zeep over Suds-Jurko as it seems to be getting more love and doesn't require use of the Windows temp folder.