another python specialization completed… now what?

This weekend I completed the University of Michigan’s newest python specialization on Coursera. It was a great followup to Python for Everybody, which was just perfect for new programmers. This newest specialization covered advanced topics like classes and working with large sets of data. My capstone involved learning image processing, facial recognition, and OCR libraries (Pillow, Tesseract, OpenCV, Kraken), and it was definitely hardest course I’ve taken on Coursera so far.

My capstone was the 30th Coursera course I’ve completed. Thinking back on the amount of course work involved in my two bachelor’s degrees (chemistry and forensic science), I think the 30-course-mark for computer science courses via Coursera is comparable to what’s required for a university BS degree.

That said, I’ve decided to suspend my Coursera subscription for now. I will be focusing on personal projects and the job I started at the beginning of the year (not in tech, but I love the work and I especially love my coworkers).

I started on my “learn tech skills to get a tech job” journey almost two years ago, and I’ve learned a hell of a lot. I’ve especially learned about tech’s diversity problem, and experienced those obstacles firsthand.

I’m not sure what’s next for jmf dot codes, but jmf dot person’s arms are tired from constantly trying to swim against the current.

Happy New Year!

I am still looking for a job, and one thing that both amuses and saddens me is that the more time passes without finding the right job, the more experience I’m getting to qualify for the right job. Ironic.

So here’s what’s new:

  • The University of Michigan and Coursera have created another fantastic Python 3 specialization, building on the Python for Everybody specialization. I’ve finished the first three courses and am waiting for the last two to open.
  • Lollipop Cloud Project is going well. We are working through some hardware issues with our board of choice, and deploying more cool stuff like Plume, a federated blogging platform.
  • I don’t do New Years resolutions, but I’ve decided to start talking more openly about being disabled, and specifically about being a disabled job seeker.
  • I’ve also decided to start posting links (perhaps weekly) that I find interesting. I don’t care for Reddit (too much bigotry and abuse), and I’m not so active on social media, but I like to save links I find interesting.

#100DaysofCode – link scraping script (python)

I found this great Pythonic HTML parser today and wrote a quick script for snagging the links off a page.


linkpull.py

# !/usr/bin/python

# takes URL as input, outputs all links to a file
# requires the excellent pythonic HTML parser, requests_hmtl
# parser source: https://github.com/kennethreitz/requests-html

from requests_html import HTMLSession
import os, sys

def maketextfile(linklist, filename):
    with open(filename, 'a+') as file:
        for link in linklist:
            file.write(link + '\n')

def main():
    print("\nThis is a tiny link scraper!\n")
    
    # destination file for your links:
    filename = 'linklist.txt'
    
    # get URL source:
    url = input("Enter a complete URL: ")
    
    session = HTMLSession()
    r = session.get(url)
    linklist = [link for link in r.html.absolute_links]
    maketextfile(linklist, filename)
    print("\nFinished! Your file {} is located at \n {}\n".format(filename, os.getcwd()))

main()

(part of my tiny scripts repository on github.)

#100DaysofCode – a file renaming script (python)

I can’t stand doing the same task more than 10 times in a row if there’s a way to automate it. My recent website projects have involved a lot of compressing and renaming image files, and the process is tedious. I fixed it:


renameme.py

# !/usr/bin/python

''' takes source and destination strings as input, and changes names of files in the local directory. '''

import os, sys

def fileRename(src, dest):
    for filename in os.listdir("."):
        if src in filename:
            newname = filename.replace(src, dest)
            os.rename(filename, newname)
    return

def main():
    src = input("What is the substring you need to change? ")
    dest = input("What would you like to replace it with? ")
    fileRename(src, dest)

main()

# ls
print("Process complete! New directory contents:\n{}".format(os.listdir(os.getcwd())))

(part of my tiny scripts repository on github.)