Package: zwi
zwiHere are some small python programmes to facilitate viewing Zwift data.requirementsa Zwift user account
python3.9 or later
pip3usageThe easiest way to use this is to usepip3 installto install
everything you need. Prior to that, you should probably have done
something like:ZWI_ENV=/tmp/zwi_env
python3 --version
python3 -m venv ${ZWI_ENV}
. ${ZWI_ENV}/bin/activateIf using anaconda:conda create -n zwi python=3.9
conda activate zwiAt this point, you will have a dedicated play area to installzwiand dependencies.pip3 install zwiThis will install everything required, and place two command scripts
in${ZWI_ENV}/binwhich will be in your${PATH}while the
environment is activated.zwi --helpversionzwi versionTheversionfunction returns the version number of the currently
installedzwipackage.authenticationBefore you can do much of interest, you must store your authentication
information in the local key store. For OsX, this is the system
keychain.  For Linux, it is something similar.zwi auth --help
zwi auth --name=guest@example.com --password=SuperSecret123
zwi authYou can have theauthprogramme prompt for bothnameandpassword.  You need to enter the password twice, in that case, and
it will not be stored unless it successfully authenticates with the
Zwift server.verificationzwi check --help
zwi checkThecheckfunction will verify that the stored credentials function.
At times on MacOS, the keychain decides it doesn't like you any more
and requires you to enter your login password, twice, wheneverzwiaccess the stored user name and password.  Make sure you click onalways allowunless you need to practice typing your password.initialise/reset databaseOnce you are authenticated, the next step is to populate the local
database cache with information from Zwift.zwimaintains state in${HOME}/.zwi/.  Ansqlite3database is used to cache the state of
the user'sfollowersandfolloweeslists. In addition, the
profiles of all Zwift users encountered (via thefollowers/followeeslists) are saved in a separate database.zwi reset --help
zwi resetTheresetfunction deletes the${HOME}/.zwi/zwi.dbdatabase file
if it exists, creates thesqlite3database, and populates the
database with thefollowersandfolloweestables.
It will not delete the profiles database, but it will ensure that
there are profile entries for each user in thefollowersandfolloweeslists.update followers/followees databasezwi update --help
zwi -v updateTheupdatefunction refreshes thefollowersandfolloweesinformation.
(Currently, this function is being fleshed out.  It does not yet
report any differences. Also, it fails to process deletions.)update profile databasezwi pro-update --help
zwi [-v] pro-update [--force]Thepro-updatefunction will update the local DB profile cache using
information in the local Zwift userfollowersandfolloweesDB
cache.list profile database entrieszwi pro-list --help
zwi pro-listThe profiles list can be displayed.bokehzwibok serve [--port=#]Theprofiledatabase can be viewed using thezwibokapp.
This will pop up a page on your browser allowing you to explore
various attributes of the users in theprofiledata base.
It should be more or less obvious.  Eventually I might try to write
some usage info, but as it is more or less a proof-of-concept, it
might change again soon.Basically, it presents an X/Y plot of subsets of the data.  You can
select different data columns for X and Y.  You can adjust range
sliders to reduce the set of data points in the plot.
Male-only or female-only or both can be selected.The cross-hairs of the cursor select users and display some more info
pertaining to the user.guizwi gui --help
zwi guiTheguifunction pops up a window displaying data from the local
database copy of the Zwiftfollowersandfolloweestables.
This was my second attempt at writing a gui to view some of the
data. Currently, it only displays information from thefollowersandfolloweeslists.Key Bindings (for OSX):CMD-1  Switch to `followers` table.
CMD-2  Switch to `followees` table.
CMD-a  Toggle `auto` mode.
CMD-n  Move to next entry.
CMD-p  Move to previous entry.
CMD-f  Search (not yet implemented).
CMD-q  QuitIfautomode is enabled:CMD-n  increase interval
CMD-p  decrease intervalThe slider at the bottom can be used to move rapidly thru the list.For Linux, it appears the key bindings map to the CTRL key.  The menu items will indicate whatever it is.followeeszwi wees --help
zwi weesTheweesfunction will check the cached followees list (them who's followed).
Any subject who is being followed but who is not reciprocating is displayed.
You will have to manually search for the user in the Zwift companion and decide what punishment to hand out.followerszwi wers --help
zwi wersThewersfunction will check the cached followers list and display any lacking reciprocity.
Certain users will follow you, but not respond to reciprocal follow requests, remaining forever in limbo.
One can always try unfollowing/refollowing to see if the recalcitrant is interested in reciprocity.
As above, as far as I know, one has to use the Zwift companion app to search by name.inspect other user's public information.Per the Zwift privacy policy, various data are publicly accessible.  Theinspectcommand
facilitates examination of the publicly available data.zwi inspect --help
zwi inspect --zid=ZwiftUser
zwi -v inspect --zid=ZwiftUser --updateremoving authentication informationTheclearfunction will remove any cached user/password information from the key-store.worldsTheworldsfunction will show how many users are signed in currently.zwi worlds --help
zwi -v worlds
zwi worlds --polldevelopmentI have been usinganacondaonOsXfor development.  Supposedly, this will install things
to facilitate development:conda env create -f environment.yml
conda activate zwi
flit install --symlink
pip3 install zwift-client
pip3 install PyQt5hintsWhen manually deleting followees, using the Zwift companion app, and
searching by name, I find it helps to type in the bits of the name
which are more likely to be unique, so as to limit the lists
presented.user feedbackissuesIf you have any problems with or questions about this image, please contact me
through aGitHub issue.