Program hms.py
2023-09-17 : Version 7d of
hms.py can be
obtained here.
This version generates files that allows to create graphs with the evolution of all parameters analysed by the program,
- number of registration moments (absolute seconds with registered notes)
- seconds of the minute, the hour, the day, the week and the month
- minutes of the hour, the day, the week, the month and the year
- hours of the day, the week, the month and the year
- days of the year
A bug was also fixed which, in the presence of some invalid registration times, could abort program execution.
Description
This is a small script I started some years ago to help me playing the games
Horas, minutos e segundos and
Uren, minuten, seconden. I make it available because some statistics used in these games are not calculated by
EBTCheck,
EBTST or
nigmm. I hope you can find it useful.
Version 7d of
hms.py was still developed in Python 2. The migration to Python 3 should happen sometime in the future. This last version of
hms.py allows you to quickly:
- Count the following seconds, minutes, hours and days with notes entered by the user,
- total number of registration moments (absolute seconds with registered notes)
- seconds of the minute, the hour, the day, the week and the month
- minutes of the hour, the day, the week, the month and the year
- hours of the day, the week, the month and the year
- days of the year
- Create listings of the following seconds, minutes, hours, and days with no notes entered,
- seconds of the minute, the hour, the day, the week and the month
- minutes of the hour, the day, the week, the month and the year
- hours of the day, the week, the month and the year
- days of the year
- Determine the evolution of all parameters analysed by the program,
- number of registration moments (absolute seconds with registered notes)
- seconds of the minute, the hour, the day, the week and the month
- minutes of the hour, the day, the week, the month and the year
- hours of the day, the week, the month and the year
- days of the year
- Create an image with a "map" of the seconds of the day with notes entered (hms_sday_frame) or create a set of image frames that can be used to create a GIF animation of the seconds of the day "map".
- Create a summary of the analysis in text and BBCode format ready to be posted on the EuroBillTracker forum. The horizontal tables in BBCode format are now built with the BBCode table, tr and td tags, which ensures that the tables are now always well aligned when viewed on Macintosh or Windows, and it is no longer necessary to create tables for posts with light backgrounds and with dark backgrounds. This version also creates three versions of the tables, since the order of the statistics is not the same in the two referred topics:
- in portuguese for the topic Horas, minutos e segundos
- in english for the topic Horas, minutos e segundos
- in english for the topic Uren, minuten, seconden
- Allows the analysis of normal CSV notes files, censored CSV notes files and CSV files with data only in column E and the signature on the first line.
.
Instructions
- You must have Python 2.x installed. Most systems have it pre-installed, verify before installing. If you need you can found it here. This program was developed and tested on Python 2.7 and does not work in Python 3.
- Double click hms.pyc to open the program (as long as Python 2 has been correctly installed).
- First question is to enter the name of your csv file: just drag the csv file with the mouse to the hms.py running window. If this does not work, put your csv file on the same directory of hms.pyc and, when the program asks for the csv file, do not drag it, just write the name of the csv file, without the path.
- Next question is to enter the directory to save the results. Press the Return key to save on the same directory of the csv file. To enter a particular directory, just drag that directory or a file from that directory to the running window.
- Next question is to enter the colours for the images and the number of image frames to create. If Pillow (a fork of Python Image Library) is not installed, the program will not create images, but calculates everything else.
Please send me any problems or errors encountered during execution of
hms.py.
All suggestions for improvement are welcome.
If you want to create the images and you need to install
Pillow, you can get some help here,
How to create an animated GIF ?
If you create several image frames, you can use them to create an animated GIF image. Using Photoshop, for example:
- File > Scripts > Load Files into Stack (to add all image frames as layers to a new window)
- Window > Animation (select next two commands from the Animation panel menu)
- - Make Frames From Layers (add layers to the Animation window)
- - Reverse Frames (if you need to reverse the order of animation frames)
- - set the frame delay and looping options
- File > Save For Web & Devices (save the GIF animation)
Some images created with the help of hms.py
![Number/Maximum [%] of different parameters for user Castanhola](./download/file.php?id=22841&sid=86a1d7e51557d26e1cfb349d4109b3bb)
- Number/Maximum [%] of different parameters for user Castanhola
- HMS_evolucao_Castanhola_20230917.png (30.89 KiB) Viewed 1135 times

- Number of seconds of the day where at least one note has been entered
- HMS_evolucao_sdia_20230914.png (36.35 KiB) Viewed 1149 times

- Number of minutes of the year where at least one note has been entered
- HMS_evolucao_mano_20230914.png (24.91 KiB) Viewed 1151 times

- Number of registration moments, i.e., absolute seconds where at least one note has been entered
- HMS_evolucao_momentos_data_20230914.png (27.91 KiB) Viewed 1151 times

- Henk Draijer seconds of the day: animation with 200 frames
- 20170106_003_hms_sday_HenkDraijer.gif (179.71 KiB) Viewed 2882 times

- Castanhola seconds of the day: animation with 200 frames
- 20170207_hms_sday_Castanhola.gif (101.33 KiB) Viewed 1151 times
hms.py Version History
- 2023-09 : Version 7d, now generates files that allows to create graphs with the evolution of all parameters analysed by the program. A bug was also fixed which, in the presence of some invalid registration times, could abort program execution.
- 2023-09 : Version 7c, now allows the counting of the total number of recording moments, i.e., the number of absolute seconds with at least one note entered, generates files that allows to create graphs with the evolution of the number of recording moments and the evolution of the number of minutes of the year, and now allows the analysis of censored CSV notes files and CSV files with only the date and time information in column E and the signature in the first line.
- 2020-03 : Version 7b, the horizontal tables in BBCode format are now built with the BBCode table, tr and td tags, which ensures that the tables are now always well aligned when viewed on Macintosh or Windows, and it is no longer necessary to create tables for posts with light backgrounds and with dark backgrounds. This version also creates three versions of the tables in BBCode format, in Portuguese and English for the topic Horas, minutos e segundos, and in English for the topic Uren, minuten, seconden.
- 2020-01 : Version 7a, BBCode horizontal version headers become more descriptive, but have different alignments with the rest of the table on Macintosh and Windows, and are not correctly aligned simultaneously on both systems, a problem that will be fixed in version 7b.
- 2020-01 : Version 7, now creates a more complete set of statistics and creates an analysis summary in BBCode format ready to be posted on the EuroBillTracker forum.
- 2017-01 : Version 5, now creates a list of hours and minutes of the month with no notes entered, a new image format for the seconds of the day "map" has been defined, where each hour is now represented by 60x60 pixels, and a bug has been fixed that interrupted program execution when reading a CSV file with line formatting errors.
- 2017-01 : Version 4, now calculates the number of hours of the day, minutes of the hour, seconds of the minute, minutes of the day, seconds of the hour, days of the year, hours of the week, minutes of the week, seconds of the week, hours of the month, minutes of the month, and seconds of the month.
- 2016-12 : Version 3, creates images with a map of the seconds of the day.
- 2016-10 : Version 2, fixes a problem on the previous version that slowed down the computation of the time evolution of the number of seconds of the day.
- 2014-10 : Version 1, because of a stupid programming error this version takes some time to get the time evolution of the number of seconds of the day.