A simple command line interface to Bakaláři software using its mobile API
- Written in Python (both 2 and 3 is supported)
- Tested on 2.7 and 3.6
- Mostly written in one day as a reaction to forcing Bakálaři next interface, thus making our JS BakalariMagicActions (fork of FHR's repo) useless
- Uses BakalariPy (fork of FHR's repo) for making API calls. (Thanks FHR)
- Opensource
- See
LICENSE
for details
- See
WIP :(
- Install Python
- It is probably installed
- Python2 should be fine, but Python3 is recommended
apt install python
pacman -Syu python
zypper in python3
...
- Clone this repo
- If you don't have git, install it (see the first step)
git clone --recurse-submodules https://github.com/vojta001/bakalariCmd
git clone --recurse-submodules git@github.com:vojta001/bakalariCmd.git
- Run the main file
cd /path/to/bakalariCmd && python main.py
If you don't want to type all the details for login
command, you may pass the in an environment variable. In turn you store your credentials on your drive, which is not very secure.
Add any of theese into your .bashrc
file:
export bakalariUrl=<url (usually <name>.bakalari.cz/[bakalari])>
export bakalariUsr=<username>
export bakalariPas=<password>
- Choose a directory (depending on your distribution,
~/.bin
,~/.local.bin
or similar may be a good choice) - Create a file there (name it however you want to call this script in the future)
#!/bin/bash
(cd "/path/to/bakalariCmd" && bakalariUrl="<url (usually <name>.bakalari.cz/[bakalari])>" bakalariUsr="<username>" bakalariPas="<password>" python "$PWD/main.py")
- Make it executable
chmod u+x <fileName>
- Make it unreadable by others (because it contains your credentials)
- `chmod go-rwx
- Update your
$PATH
. Insert this into your.bashrc
export PATH="/chosen/dir:$PATH"
6. Relogin
7. The name of the file from step 2 can be used to run this script
* If a named it `bakalari` (e.g. ~/.local/bin/bakalari), I may just type `$ bakalari`
- It is not a proper Python package. You gotta run it from its directory
- Its feature set is poor
- No error handling
- Network timeout causes it to fail completely