r/learnpython • Github mokrunka • Nov 02 '20

Project ideas for those interested in doing something cool while learning Python

Hey everyone, we all are always asking about some good projects to get into while we learn to write Python (myself included). So, I figured I would share my latest idea (haven't started yet), as well as some others that I've done in the past. Let's have a discussion about some of the other things you've each done!

My latest idea is as follows. Backblaze, a cloud backup solution company (no affiliation), for about 7 years has been publishing data on hard drive failure rates from their datacenter (here). What's interesting is that in addition to a blog post about the data, they also provide the raw data, in CSV format that their software generates. You can read more at the link, but basically they have a row for each hard drive every day, along with the drvie details, whether the drive has failed or not, and SMART stats for each drive. I'm thinking it would be cool to practice pandas and take this data and do some plotting and such, and maaaybe try some machine learning stuff to see if we can predict if certain SMART attributes are better predictors of failure than others. There have been studies on this kind of thing before, but it could be an opportunity to learn more about some nerdy stuff like hard drive failure rates, pandas, matplotlib, and SMART stats.

Some of the other projects I've done are:

- a very small program to search the graphics card prices on newegg

- another small program to plot data from the federal election commission on donations per candidate per state (need to download your own raw data)

- a fun little tool to extract the temperature data reported by my raspberry pi running pi-hole (network level ad blocker)

- a friend of mine has a problem where he had a directory filled with millions of small files. this will delete them (use at own risk of course, always backup your data, etc.)

- if you're interested in data, here's another github link of a bunch of big datasets

E: wow friends! This got a lot more traction than I thought. Thanks for all the awards and let’s keep the suggestions coming!

486 Upvotes

47 comments sorted by

6

u/kvndakin Nov 03 '20

i just made something to fill out my timesheets, just finished 2 mins ago, it prolly looks like trash but damn it feels good.

1

u/testfire10 Github mokrunka Nov 03 '20

Given that I have no real clue what I’m doing my first goal is always that it works over making it look good haha

2

u/EhRanders Nov 03 '20

Even when you do know what you’re doing, not a terrible strategy. Scale comes after success, so don’t buy into the madness about doing everything perfectly the first time. You won’t see real speed without vectorization anyway, and vectorization is way harder without first understanding how to solve the singleton case.

4

u/Shaantanu96 Nov 03 '20

I have been trying to do that for a while, but the portal where we need to upload our timesheets is pure garbage

8

u/hugthemachines Nov 03 '20

Isn't it weird how all timesheet portals are garbage? I have used maybe 4 or 5 over the years and they have all been pretty crappy.

4

u/ihavesomanycuts Nov 03 '20

How damn simple are your timesheets? I have to fill mine out accurate to 15 minutes with a specific project and task and a detailed description of what I did, and if I fuck it up the long hard dick of management starts cumming around the corner

2

u/kvndakin Nov 03 '20

Lol very simple.. my codes like maybe 100 lines long, but a lot of it is repetitive. Nothing more complicated then Webdriverwait or find_element_by_id n send some keys.

2

u/squidjibo1 Nov 03 '20

I was thinking the same, however my roster comes as a pdf, the timesheet is completed in a Word table. How does yours compare and what's your process?

5

u/kvndakin Nov 03 '20

I had to fill timesheets on a specific website, so I used selenium to automate the process and got the data from an excel sheet I created

3

u/burlyginger Nov 03 '20

In your first script you import bs4 and it appears that you never use it.

3

u/testfire10 Github mokrunka Nov 03 '20

Yes, you’re right. Most of this is a work in progress as I learn. Thanks for pointing it out!

3

u/Kuwertzel Nov 03 '20

I did a similation of Planets being pulled towards eachother with respective forces, calculated with the gravitational formula. It's super satisfying to watch and play around with. Ideal to learn about object oriented programming. Also used it as my A-Levels oral presentation. Feel free to ask if you want to try it yourself and need help :)

2

u/testfire10 Github mokrunka Nov 03 '20

Yeah that sounds really cool dude. Got a link to your code?

2

u/Kuwertzel Nov 03 '20

I haven't uploaded it anywhere public yet but I can give you a Google Drive link once i'm home.

2

u/Kuwertzel Nov 03 '20 edited Nov 03 '20

Well, instead I just created a GitHub account and a repository: https://github.com/Kuwertzel/PyPlanetsLet's hope this works so far...

Just make sure you have pygame installed (pip install pygame), then launch game.py. There is some additional info in the readme file.

EDIT: This should be below my previous post, I replied wrongly

56

u/CatMilkFountain Nov 02 '20

A small script extracting current stock values and display them as icons in the Taskbar.

3

u/North_Shock Nov 03 '20

That'd be cool and really useful. I think I am gonna do this.

3

u/DisregardMyUsername1 Nov 03 '20

How would you put icons in the taskbar?

2

u/shiningmatcha learn python Nov 03 '20

I'd like to know that too

2

u/SniperViperV2 Nov 03 '20

Maybe pin an executable into the taskbar and use a python script to change the icon of the program? I don't actually know, but it's the first thing id try off the top of my head.

0

u/[deleted] Nov 03 '20

[deleted]

8

u/CatMilkFountain Nov 03 '20

Yeah, I'm using that one. 👍 For me, the fun part is to get some display going.

23

u/vectorpropio Nov 02 '20

Good. I whant to add some projects i want to do.

  • a maze creator/ solver (yes, al those videos with A* va Dijkstra va whatnot, but it's cool anyway). Extra point for maze with bridges, tunnels and/or toroidal topology.

  • a find a word generator (sopa de letras in Spanish) , generate a png image (to entertain my children). Lot of difficulties, from square boards to arbitrary borders; word from predefined lists, or make it from most relevant from some blog/ news site / framework documentation.

  • a face mask usage image classifier

7

u/sebas99sebas Nov 03 '20

The maze solver is a fun project. I made one where you would input a png picture of a maze and output a png picture with the maze solved.

5

u/vectorpropio Nov 03 '20

I need to learn how to work with images. What lib did you use? PIL?

6

u/sebas99sebas Nov 03 '20

Actually, I did that project in Java, but I've been using PIL for a python project I am working on right now and it has been ok so far.

11

u/nck93 Nov 03 '20

I've recently been exploring pyautogui. I work in sales and recruiting and usually have to send a lot of in mails and connection requests over LinkedIn.

I started this today, where I use the pyautogui. display mouse position and finding the x, y coordinates for each button and using hot keys for ctrl+c and v. Isn't fully functional yet, but super cool and keeps me motivated to keep learning python.

3

u/shiningmatcha learn python Nov 03 '20

That's great. What tutorials did you follow?

2

u/nck93 Nov 07 '20

Mainly atbs. It started with that and adapted it for my use case.

6

u/javanutsy Nov 03 '20 edited Nov 03 '20

I'm learning Python and wrote a program to display currently playing track/album art from Spotify on a Raspberry Pi. Had fun trying to display the Artist, Track name, Release date over the image without being too obtrusive. Even going as far as analyzing the image color pallette (via a library) to use while overlaying the text so that the colors go well together... album art

4

u/jesse_pinkman_11 Nov 03 '20

Hey how did u do that iam new to coding and I like ur project

2

u/javanutsy Nov 03 '20

Inspired by this page https://www.hackster.io/mark-hank/sonos-album-art-on-raspberry-pi-screen-5b0012. Followed it to setup up the hardware. But as I didn't have sonos or know what that is, didn't bother to look at his code and looked else where and wrote own code to query from spotify via spotipy... My code on github if interested: https://github.com/weylunlee/pyalbumart

1

u/jesse_pinkman_11 Nov 03 '20

Thank you so much

2

u/shiningmatcha learn python Nov 03 '20

By using an API?

2

u/javanutsy Nov 03 '20

Yes (what is programming but using a bunch of APIs?). So far liking Python because there are so many libraries out there. For this one, I used:

  • spotipy for spotify access

  • Pil for image manipulation (including fade transition)

  • colorgram to analyze album art color pallete (on the thumbnail for improved performance)

  • dotmap to convert dict to map notation

  • PyYAML for configuration externalization

5

u/sebas99sebas Nov 03 '20

A project I'm working on right now is a Youtube bot channel.

3

u/SniperViperV2 Nov 03 '20

I really want to start learning how to make a project to identify skin lesions to help people understand changes over their whole body instantly and in hard to see places. (think strip in a door frame and compare spots between before and after). What something could do for skin cancer would be amazing. There are paid apps that do this, as well as industries that will do it also, but open source using phones etc would make a real difference.

2

u/dvboy Nov 03 '20

I just created a word generator for the word find app "Word Trip". In that game you are provided with 7 letters and need to find 3-7 letter words to fill in the blanks provided. I found it presented some interesting challenges regarding programming in general, not restricted to just Python, such as not using letters multiple times unless they are provided multiple times. Example: if the letters are 'abcdefg', you wouldn't suggest 'add', but if they were 'abcdefd', you would. I also arranged the output to print them out in alphabetical order descending in size, so all 7 letter words alphabetically, then 6, 5. etc.

Mine was 103 lines of code and pyenchant to determine if a letter combination is a word.

2

u/HoTDog4Life Nov 03 '20 edited Nov 03 '20

RE: Directory with Tons of Small Files:

Below should get your friend a good head start!I made a file mover in my 100 days of python. Just replace the DIR1,2,3 with the dir of his choice.

edit:
Sharing a pastebin instead of markup

https://pastebin.com/fUef6aFz

2

u/farens98 Nov 03 '20

Cool stuff, thanks for sharing.

2

u/Gagsterrent Nov 04 '20

you can also use jexcel , to create saas based web applications just by integrating spreadsheets.

0

u/[deleted] Nov 02 '20

[deleted]

10

u/EbenenBonobo Nov 02 '20

I did nearly exactly that with a raspi. I used the fritzconnection package.

5

u/[deleted] Nov 02 '20

python source/code suggestions?

12

u/EbenenBonobo Nov 03 '20

i used something like this and called it with crontab every 10 min:

from fritzconnection import FritzConnection

ip = 192.168.178.1
pw = password123

fc = FritzConnection(address=ip, password=pw)

call_num = fc.call_action(
    service_name='WLANConfiguration1',
    action_name='GetTotalAssociations')
num = call_num['NewTotalAssociations']

macs = []
for i in range(num):
    call_i= fc.call_action(
        service_name='WLANConfiguration1',
        action_name='GetGenericAssociatedDeviceInfo',
        arguments={'NewAssociatedDeviceIndex':i})
    mac = call_i['NewAssociatedDeviceMACAddress']
    macs.append(mac)

...

fritzconnection docs

I don't know where exactly i found the service and action names and so on. Might even be directly from the avm website, there are some ressources for developers.

4

u/cryptospartan Crypto-Spartan Nov 03 '20

You could do something like a simple ping and keep a table / database of MAC addresses. Scapy would be good for that

Edit: could also monitor the network for DHCP requests incase a device has a firewall that blocks ping

2

u/snowbunnie678 Nov 03 '20

Ha! Fun idea and a way to catch lying family members

0

u/[deleted] Nov 03 '20

[deleted]