# My CSTimer to Excel, Python Converter



## JTWong71 (Aug 4, 2016)

For a while now, I have been wanting to turn my solves into an Excel file from CSTimer,
and so I decided a couple days ago to try and make a Python program that does so.

What the program does is, it takes a session from CSTimer that you give as a .txt file,
and then it extracts the Single Solves, finds the Average of 5, and Average of 12.
If someone wants it to work for Average of 50 or 100, there is a function that they can call to write the Average of 50 Solves.

The requirements are:

Python 3.x (I use 3.3, but I am pretty sure it will work with any Python 3.x)
Text file with Times (CSTimer Format)
xlsxwriter (An external module for Python to create Excel Files)
So, for the CSTimer session format, I am talking about the window that appears from clicking the bottom left portion of the CSTimer Screen, where it shows, "Solve: ......" and "Mean: .....".

After that, you copy everything from that window.
Then you are to paste it into a .txt file and save it (Preferably as Time_List.txt, as that is what the program looks for automatically, but it can be named something different.
Lastly, you run the Python program and then it creates an Excel file and another .txt File.

This is my first thread I am creating, so I am not sure how well I explained everything.

Version 1
Original.

Version 2
Ignores DNF's, makes it easier to create higher count averages such as Ao50, Ao100, and Ao1000, while also taking out the highest and lowest solves depending on the argument given.

Thanks for reading.

Picture of Graph: Here

Edit: +2's will be interpreted as it should, but DNF's will still likely cause errors.


----------



## Qcumber (Aug 4, 2016)

Yes Finally! My boring hours of manually copying and pasting will be gone. I can't wait to try this out.


----------



## wir3sandfir3s (Aug 4, 2016)

Thanks for this  very useful.


----------



## imvelox (Aug 4, 2016)

I think you need to format your code (indentations)


----------



## JTWong71 (Aug 4, 2016)

imvelox said:


> I think you need to format your code (indentations)


Yeah, I am not sure how to fix that in the forums.

I don't have a Github account either.


----------



## JTWong71 (Aug 4, 2016)

A picture of the Graph:
Here


----------



## AlphaSheep (Aug 5, 2016)

JTWong71 said:


> Yeah, I am not sure how to fix that in the forums.
> 
> I don't have a Github account either.



https://gist.github.com
You don't even need an account, but I recommend making one so you can edit or delete it later.


----------



## JTWong71 (Aug 5, 2016)

AlphaSheep said:


> https://gist.github.com
> You don't even need an account, but I recommend making one so you can edit or delete it later.


Thanks, just put up the file:
https://gist.github.com/anonymous/a32c775adc2c0a0c3c5d60df9d12ba35


----------



## 4Chan (Aug 5, 2016)

Whoaaa, I did something similar for TNT with python 2.7 and xlwt last month!


----------



## tristof (Oct 14, 2021)

Hello,
In case it could be useful to somebody else, I started from the python script of JTWong71 and enhanced it a bit to:
- allow the user to specify the input file name and choose the session
- print all session names
- added the personal best (PB) time evolution
- DNF are ignored (not copied and therefore ignored from the averages, which is technically not correct, to be improved)
- create 2 Excel worksheets containing the same graphs but with different abscissae:
- solve number
- solve date
(depending on the case, one looks nicer than the other, see examples attached)
Code can be found here:








Chris / cstimer2excel · GitLab


Python program to read CSTimer exported file (JSON format) and convert it to Excel cstimer2excel.py [filename.txt [sessionname]] Default filename.txt = cstimer.txt Default session =...




gitlab.com




Happy cubing ;-)


----------

