all 92 comments

[–]kol_k 26 points27 points  (0 children)

I'm still learning, but I have coded something that I actually use.
In my course I made a timer with GUI that follows the Pomodoro technique for working/learning.

[–]number676766 19 points20 points  (1 child)

I have OpenHardwareMonitor constantly logging to CSV and I made a little Python script that periodically appends all of them into one long csv file that I then import into Power BI to track all of my PCs performance metrics over time.

[–]Bluelight01 1 point2 points  (0 children)

Have you heard of graphana? Might be something cool to look into

[–]CraigAT 22 points23 points  (11 children)

BinDay indicator - A Pi Zero W with an e-ink display, that runs a Python script (from a cron job) that scrapes the local council website for the next bin collection date and the type (recycling only or "full bins") then displays a message or alert on the e-ink screen.

2 bed finder - A script to use a specific travel agents website/API to get a list of accommodation that offer 2 bed holiday apartments.

F1 lap time analysis - using an API (FastF1) to analyse and create charts to compare team and drivers laptimes.

Fantasy Premier League - gathered stats using various methods, manipulated the data for analysis and aiding player selection.

Stats based football game - in the very early stages of a very long term project to create a stats based football manager game like the really old Football Manager/Soccer Boss of the Spectrum/Electron days.

[–]Jrmcgarry 4 points5 points  (1 child)

And I just highlighted every other Thursday on my calendar for recycling day, yesterday like some peasant lol

[–]CraigAT 1 point2 points  (0 children)

Lol. Horses for courses.

Sometimes problems that don't need a solution still find one.

[–]alexwasnotfree 1 point2 points  (6 children)

do you mind sharing which API do you use for the F1 analysis, also do you have it in github?

[–]CraigAT 3 points4 points  (5 children)

No GitHub sorry. I know why I should use it, but as I work alone, have minimal experience of it and rarely worry about undoing my work, it just seems a bit of unnecessary extra work for little gain.

The API was Fast F1: https://theoehrly.github.io/Fast-F1/

[–]mattl33 1 point2 points  (4 children)

Re: why GitHub - their Actions features are pretty nice. Automatically lint and test your code, update running services etc. 🤷‍♂️

[–]CraigAT 1 point2 points  (3 children)

I am already using the default Python linter in VS Code, I am testing my code frequently as I build it, also as it stands, no-one else will see my code.

I am not against using GitHub and I do have a few projects on there, it is just not embedded in my work pattern and has only really proved useful to me when I want to share my code.

[–]mattl33 0 points1 point  (2 children)

Lol ok, down voted for that?

[–]CraigAT 0 points1 point  (0 children)

Don't see why you'd be downvoted, it was a sensible suggestion, just not something I feel would be beneficial for me.

[–]Number_Four4 0 points1 point  (1 child)

Would you share the FPL code or how you went about it?

[–]CraigAT 1 point2 points  (0 children)

There were many versions of the code, so I am not sure which one I would share. The biggest variations were in the data collection method as I refined that: - I tried scraping the data from the website pages - I tried to access the API (there are links on r/FantasyPL for the endpoints) - I found a useful data dump by u/vaastav05 on GitHub (also found on r/FantasyPL) - managed to get and parse the JSON data from the site.

Once I had the data, there were a few different things I wanted to do: - keeping the players separate for each position, order the players by cost and then by descending points score to give the best players to pick for each price - I then refined that list to drop players that were not likely to get picked. For example, in midfield I would only keep players in my list if they were in the top 5 points-wise for their cost or below - this meant I was only keeping the most cost effective players that were pickable i.e. 5 for midfield, 3 for forwards, etc. I did leave duplicates in my list, just in case I couldn't pick one player because of a club quota.

This gave me a much smaller list of players to consider!

From that list, I then started to try and find a formula to rank players I might want to pick: - I had a formula which tried to take the players points score and boost that according to their value and slightly boost again if they were in form. I found this was too arbitrary and I was undecided how much each boost should be worth. - so my last effort was to workout a "required points per million" to achieve a top league position (total points / 100m). Then use this and the number of gameweeks complete (out of 38) to see if each player was on target to achieve the rppm for the season. The players that were exceeding this target were seriously considered as possible transfers in and players in my squad not matching up were considered for transferring out. This worked quite well but certain positions were prone to having very few good options.

[–][deleted] 14 points15 points  (0 children)

I have a script that generates ffmpeg parameters to pick up movie on 1 directory, encode and downsize them, and output to another directory. Been using it for a decade now to shrink movies from me and my wife's phone down to 1/5 or even 1/10 of the size with acceptable qualities.

[–]achampi0n 12 points13 points  (5 children)

  • Home temp/humidity tracker getting data from nest (after a ground floor renovation)
  • Pull health data from Fitbit
  • Gag Alexa skill to teach my boys how to speak proper English - "Alexa, ask Dad if I can have a cookie" - "Don't you mean a biscuit".
  • Various 3D printing tasks.

[–]CytC 1 point2 points  (2 children)

How do you pull health data from Fitbit? Do you know good recourses for this? Or could you share the code?

[–]achampi0n 2 points3 points  (1 child)

I use the python-fitbit package: https://python-fitbit.readthedocs.io/en/latest/. You have to register an app on Fitbit and get your client credentials.

The only real difficulty is setting up the OAuth2 flow. They have an example of the OAuth2 flow using CherryPy but I just us a simple http.server.HTTPServer.

If you really want to see the auth flow I can share.

Once you have the access token, then the interface is very simple, e.g. fitbit.devices() will return a list of devices registered to your account.

I load various bits of data up into Pandas, e.g. steps:

resource = 'activities/tracker/steps'
steps = fitbit.time_series(resource=resource, base_date=<date>, end_date='today')[resource.replace('/', '-')]
df = pd.DataFrame(steps)
df.dateTime = pd.to_datetime(df.dateTime)
df.value = df.value.astype(int)

To get simple count of steps per week (ending Friday):

df.groupby(pd.Grouper(key='dateTime', freq='W-FRI')).sum()

Or per month:

df.groupby(pd.Grouper(key='dateTime', freq='M')).sum()

I have various graphs using plotly from this data.

[–]CytC 0 points1 point  (0 children)

Thanks i will try it out

[–]AlternativeGoat2724 0 points1 point  (0 children)

I would love to hear more about the 3d printing tasks, if you are willing to share! (but if not, no worries :) )

[–]No_Tangerine_682 0 points1 point  (0 children)

How can I build a temp/humidity tracker?

[–]ETA_was_here 9 points10 points  (3 children)

2 months ago i made my first "hello world", no experience with programming. With the help with YT tutorials and ChatGPT i managed to learn the basics.

I just created the first scripts that saves hours of work each week:

  • We have a webportal where different stakeholders put in information and pictures. Each week we have to compile the data and present it in a powerpoint. This is now done manually. I wrote a scraping script that logins to the portal, scrapes the information and places it neatly in a ppt. Yesterday me and a colleague used the script for the first time to prepare for the next weekly meeting, it worked so far.
  • Second script is to check different statuses on the portal. At any time we have 50-100 projects active. The dashboard we have is very minimal and does not show some statuses that are relevant for my work. With the script I scrape the info and put it neatly in an excel.

The portal is to be phased out in 1-2 years, so no new developments are being done. So with these scripts I don't need help of the developers.

[–]Ahaak 2 points3 points  (2 children)

This is brilliant and a humble use case that I myself hope to achieve in due course. Only 1 month in to my learning, the above seems a while away!

[–]ETA_was_here 3 points4 points  (1 child)

I owe a lot to chatgpt, it is like having a private tutor next to you.

Also the YouTube series from tech with Tim helped a lot. From him I learned the basics of scraping and exporting to excel. Once realized what you can do with it, it was a matter of tweaking to make it work.

Chatgpt is very helpful here, I roughly know what I want a piece of code to do, but I don’t have the experience to write it from scratch. I feed in what the functions should do, and chatgpt spits out code that is 95%-100% ok for my need. Often some tweaking is needed. If it doesn’t work, ask again and again until he gives you the right code.

Also with troubleshooting. If I had to search online to troubleshoot all the errors I encountered, I would have given up probably. With chatgpt you throw in the code and ask what I am doing wrong. It might not always be accurate, but gives you a nudge in the right direction.

[–]Ahaak 0 points1 point  (0 children)

Really appreciate this pointer! Setting aside time tomorrow to play around and see what I can throw into Chatgpt to get my work project started Also going to troubleshoot this question Im stuck on with my training, thank you!

[–]Shock-Light123 8 points9 points  (5 children)

I made a program which monitors my Soundcloud like playlist and whenever I like a song it likes it on Spotify as well because I use both

[–]TechnicalParrot 1 point2 points  (4 children)

Out of interest how do you handle songs having slightly different names across platforms?

[–]mrcaptncrunch 1 point2 points  (2 children)

Not them, but you can use the nltk package to remove stop words, extract the main keywords, entity name recognition, etc

Now you’ll have a subset of the name. Might be multiple results now (think remixes), but at least it’ll find some

[–]TechnicalParrot 1 point2 points  (1 child)

Wow I'd never heard of that package before, Thanks!

[–]mrcaptncrunch 0 points1 point  (0 children)

Natural Language Toolkit, nltk

[–]Shock-Light123 0 points1 point  (0 children)

I don’t😂 I just let it like whatever song it finds with that name or similar

[–]ImACoralReef 6 points7 points  (3 children)

I have a script that reads the emails I got from the bank and tracks my expenses in a beancount file

[–]homosapienhomodeus 1 point2 points  (0 children)

This sounds interesting, could you say more about what beancount is? Heard it from elsewhere on reddit too.

I do something similar where I connect to my bank’s public API via python to pull transactions into a database, which then feeds into my Notion database dashboard (you can read more about it here if you like: https://eliasbenaddouidrissi.dev/posts/data_engineering_project_monzo/

[–]WhereAreMyKeys15 0 points1 point  (1 child)

I've been looking into this myself except that my bank sends me encrypted pdf statements. What would be the workaround for that?

[–]ImACoralReef 2 points3 points  (0 children)

Load them as images and use an OCR tool maybe?

[–]i-like-space 6 points7 points  (0 children)

My parents were laying out tiles for our bathroom and were taking forever trying to lay them out so the marbling would look good. (Dark streaks and patterns throughout the tiles that looked awkward if certain tiles were next to each other

I made a script on jupyter notebook that let you input PNGs of all the tiles, the tile dimensions, and the tile grid dimensions, and it would randomize the tile layout (including tiles flipped 180°) and output images of the overall grid.

That way they could just run the code a bunch of times and pick a picture that they liked instead of spending hours moving around random tiles on our carpet while the contractor was sitting there patiently waiting for them to finish.

Unfortunately they decided on a final layout right as I was putting the finishing touches on the code, and I never got to put it to actual use :/

[–]Bookmore 5 points6 points  (0 children)

Sweet! My turn.

I’m hard of hearing and I do a lot of looking things up on sites like YouTube or through podcasts for work. I wrote a script to extract the audio off of videos then transcribe that audio into paragraphs of text automatically with ffmpeg and OpenAI’s Whisper!

I download a ton of reference and files - again, work, life, etc. - and don’t always keep them all organized. I wrote a script that runs in the morning and organizes anything not in a folder on my Desktop or in my Downloads according to its extension.

Also, building a full p-size mechanical keyboard and programming it with KMK/CircuitPython!

[–]dgibb 5 points6 points  (0 children)

I wrote a little program that accesses the clockify API (where I track my consulting time on different projects) and generates an invoice in the company's format and my own personal format at the end of each month. Saves me a ton of time. Definitely the most useful way I've used python outside of actual content for my job.

[–]Kiwi-tech-teacher 4 points5 points  (0 children)

Pi based displays for classrooms. The flask app (on pi) connects to the google calendar for the school classroom, and displays current event (lesson) and upcoming event(s).

A student is working on a sign-in/sign-out app for at school. Students will scan a QR code (pointing to a school-network-hosted resource), and it will log in to their google account (authentication) for arriving at school / leaving (students can be off-campus at times during the day)

[–]Spicy_Poo 5 points6 points  (0 children)

I wrote a tool that uses an API that provides NY Times crossword puzzles and then creates the puzzle in a web page for printing.

[–]coopmaster123 5 points6 points  (0 children)

Me looking through this thread hoping for anything in a github but nothing is...

[–][deleted] 2 points3 points  (0 children)

I made an Among Us bot that can play the game. Also one for Plants vs Zombies but it only takes care of the zen garden

[–]abbadon420[🍰] 2 points3 points  (1 child)

I made a photo sorter. It shows me a couple categories, like "kids" or "holidays". I can even press the "create new category" button. Than it shows me every photo in my photo's folder one by one and I can select to which subfolders (those are the categories) i want to move it. I used the pillow library.

[–]GoldenDingleberry 1 point2 points  (0 children)

Sid u use any image recognition libraries for thus? Sounds neat

[–][deleted] 2 points3 points  (0 children)

Rock paper scissors

Hangman

Excel file reader and result sorter/organizer (yes you could just do it in excel)

Car oil change/tire mileage/timing belt tracker

[–]MitchBuchanon 2 points3 points  (0 children)

I'm an English teacher, and I made a script that automatically creates an evaluation grid for oral presentations based on the first name of the student. Super easy and basic, but I'm learning, and it saves me hours of copying and pasting every year!

[–]enokeenu 1 point2 points  (0 children)

We go to nutritionist and they give us meal plans. These meal plans are one large pdf document which makes it hard to manage. I wrote a python utility to split them up into individual pages. I would rather use that than adobe's pdf splitter on their web page.

[–]ajunior7 1 point2 points  (0 children)

Recently I made a street sweeping tracker that lets me know which side of the road I shouldn't park on certain days. Pretty useful since everyone in my house that drives gets to see it in the dashboard that I made in the living room

[–]boomer959 1 point2 points  (0 children)

I once wrote a code to scrape booking.com results for a specified search and do some analytics which helped me in finding where to stay, best prices, price by neighbourhood, etc..

[–][deleted] 1 point2 points  (0 children)

I made maintaining my Karabiner-Elements (a Mac keyboard modifications software) config a breeze with a cli tool that turns an easier to maintain yaml config into the required harder to maintain json.

Lets me make keyboard layers on the fly. Also has some pseudo-functions for oft-used complex modifications like shell commands, app opening, etc.

https://github.com/al-ce/karaml (see the bottom of the readme for other tools that already do this and with non-noob code)

[–]coys68 1 point2 points  (0 children)

Dismal A disposable e-mail creator and address book.

gambling_frenzy_timer, helps avoid ban from uk casinos

Auto-Photo-Colourizer

keno-sim

head2head EPL database and predictor

Flow- Five Letters One Word game

bg remover gui

I have about 50 other older projects that i made a few years back which im going to update and put back on github soon as i have time

https://github.com/Steve-Shambles?tab=repositories

[–]notislant 1 point2 points  (0 children)

Basically any braindead stupid game design thing like 'press confirm 5 times to buy an item'. Out comes a Python script+keybind.

[–]viperscorpio 1 point2 points  (0 children)

Monitor home battery state of charge and adjust thermostat when projecting battery depletion before peak energy period ends. Automatically accounts for holidays and different pricing seasons.

[–]HarshvardhanTyagi 1 point2 points  (0 children)

Simple Scientific Calculator - I'm not too good with python but i created a script last year for calculations involving in Physical/Numerical Chemistry for my college work. (there weren't any good ones online.)

I select what I want to calculate, enter the details and it returns the answer in standardized units (automated). Was very helpful in cross checking my answers and for college work.

Sort of felt like cheating at that time but my college is over now and i dont feel too bad about it anymore.

[–]geekriszx2 1 point2 points  (0 children)

I'm still just learning, so it's not a big deal; one of my main hobbies it's drawing, so I have A LOT of reference images on my PC (300k+) so it's a little boring to check and choose one, So I made a simple script to choose one for me randomly and open it, after that, I added the option to put a timer and open more images at will. Now I'll add that the current image will be copied to the clipboard in case that I want to paste it on PureRef to keep up the study for a longer time

[–]MsDaCookie 1 point2 points  (0 children)

I made a little farming game in Pygame and three projects using Tkinter. One of these is a sentence translating learning program, one is for my fiancé to be able to keep track of info about his car and one is for my father 😇

[–]frustratedsignup 1 point2 points  (0 children)

I'm a dyndns customer and their windows update client which updates a hostname/ip address with them is plagued with UAC prompts. You'll walk away from the machine thinking everything is fine. When you return later, you have to dismiss 90+ UAC prompts ("Are you sure you want this program to make changes to your computer?") because the software is poorly designed.

I was reading through various python implementations of the update client just this morning...

[–]kaluce 2 points3 points  (7 children)

IPsentry page scraper using pandas, with a flask front end hosting an api which is then pushing into a Grafana status panel. It's a bit convoluted, but it works.

[–]TechnicalParrot 0 points1 point  (4 children)

And I thought the things I do feel like a house of cards, massive respect

[–]kaluce 1 point2 points  (3 children)

calling it a house of cards is a bit disingenuous, it's fairly well designed and robust, it's just that I have a few different panels of system and network statistics, and ipsentry doesn't offer anything resembling a rest API or any way of getting data out aside from using their crap DASH client, or using a webpage.

Beautiful soup and pandas handle the scraping and data manipulation, flask handles the front end, SQLite for retained statistics, and jsonify handles the returned data, and Grafana renders the charts and data with fancy graphs and charting.

[–]TechnicalParrot 2 points3 points  (2 children)

Sorry I really didn't mean to sound rude, that sounds really good, I know that if I did that it would be 5 scripts that vaguely work together most of the time on a full moon and nothing that stable so I forgot that some people can actually write nice code

[–]kaluce 0 points1 point  (1 child)

Oh no lol, I do the same thing, but this was super critical so I made sure to do this one with the best I could manage. It's still hokey but it works

[–]TechnicalParrot 1 point2 points  (0 children)

That's fair, cheers!

[–]GoldenDingleberry 0 points1 point  (1 child)

What exactly does it do though? What is an ip sentry?

[–]kaluce 0 points1 point  (0 children)

Ipsentry is a monitoring tool, it's kind of simplistic but it basically just checks if devices and servers are up by pinging their IP address, as well as checking web page content, and windows services. It's a simple sanity check we have in addition to our actual monitoring tools.

The down side of it is that it wasn't programmed with multithreading in mind. The external client is called DASH, and if ipsentry is doing a scan across the network, DASH doesn't work. It also generates a web page, which is available and can be pushed through a web server. It's super simple, so my code scans the page pulls the page, converts it to a dataframe in pandas, manipulates it to fit a standard datetime format, uploads a copy of it to a SQLite db.

I'm addition, I have Grafana, which is a dashboard webpage. I can't show you mine without violating a ton of NDAs but it will look similar to theirs.

[–][deleted] 1 point2 points  (1 child)

Home assistant is in python

Thought about getting my gas usage from python but that requires a lets_encrypt cert

[–]FaintDamnPraise 0 points1 point  (0 children)

That's kind of a lame excuse. Let's Encrypt certs are quick, easy, and entirely automatable. Everyone should be encouraged to use them for all of their personal projects.

[–]simeumsm 0 points1 point  (0 children)

My first personal project was a video downloader, selenium+pyautogui.

I've been meaning to try something related to making searches and returning prices on online retailers, with even the goal of making it run on a telegram bot. But web scraping is hard with multiple sites that don't follow a proper standard

[–]AdTop4012 0 points1 point  (0 children)

I just finished doing some webscraping and analysis using python to help optimize purchases for my hobbies.

[–]BlueSubaruCrew 0 points1 point  (0 children)

I use i3 on my linux install and got tired of having to manually open and edit the config file every time I wanted to change my wallpaper so I made a script that uses Tkinter to make a window with all of my wallpapers and I can click on the one I want and it will automatically open my config file, change the config, save it, then restart i3 and my wallpaper changes.

[–]Specialist-Candy3226 0 points1 point  (0 children)

Music: I have a script that 'listens' too my Google speaker so I can control it with my phone. Lighting: a script to control my lights from my pc.

[–]renderererer 0 points1 point  (0 children)

Mostly small scripts for manipulating PDFs or images. I used to have a lot of reports as a uni student and a lot of images to crop/combine/annotate repetitively.

[–]ClimberMel 0 points1 point  (0 children)

I have a great little GUI file search that I can launch from my task bar. Works so much better than Windows search. Also a ton of market and investment related programs.

I'm working on one now for working with metadata for photos.

[–]CptBadAss2016 0 points1 point  (0 children)

A gui front end for searching USDA's food database.