I am an electronic engineer who develops software by trade. I wrote my first program in GW-Basic, long time ago (during the past century!) During my long experience I have caught some bad habits I need to unlearn. I will try my 100 days of code for learning some good ones instead.
Timezone: GMT-3
One of my bad habits is developing code without tests. So, I want to learn Test Driven Development (TDD). I have noticed the wonderful Youtube channel by ArjanCodes, where these videos appear
How To Write Unit Tests For Existing Python Code // Part 1 of 2
How To Write Unit Tests For Existing Python Code // Part 2 of 2
Test-Driven Development In Python // The power of red-green-refactor
10:00 - Today my work is: watch these videos, and write tests for some code. 22:00 - I watched the videos, learned how to write tests. However, tests don't run properly.
Today I managed to refactor my code. Now, tests run, succeding and failing. However, I need to include assertions and use coverage.
Today, I manage to get unittest and pytest test working. Tomorrow I will include some assertions.
Today, I installed coverage and black in a local environment, and learn how to use them. Also, I read about CI/CD and take some notes. Tomorrow, I will try to make a github template repo, with Github Actions.
Day 004 of #100DaysOfCode Today I prepared a github template repo for my #MachineLearning projects. I will publish it Tuesday 9 August 2022.
Day 005 of #100DaysOfCode. Today I restarted my first python project: scraping data from CIA Factbook (html +csv), years 2001 to 2020, generating spreadsheets as output.
Day 006 of #100DaysOfCode. This is the github repo for scraping data from CIA Factbook
Day 007 of #100DaysOfCode. This is the github repo for scraping data from CIA Factbook
Day 008 of #100DaysOfCode. I continued working in github repo for scraping data from CIA Factbook
I found a nice structure for python code (including tests), in this repo Microblog. Got working python imports!!!
Also, I began to write some docs, and learn some git magic.
Day 009 of #100DaysOfCode.
- I worked in my first HuggingFace space
- Work in progress...
Day 010 of #100DaysOfCode. Forgot to tweet. I worked with tests for my old code, found some bugs.
Day 011 of #100DaysOfCode. I worked in configuration with python-dotenv for my data scraping code.
Day 012 of #100DaysOfCode. Forgot to tweet. Working in github repo for scraping data from CIA Factbook. Watched the video by ArjanCodes, and got an idea for scraping data from the CIA Factbook.
Day 013 of #100DaysOfCode. Working in github repo for scraping data from CIA Factbook. Today I wrote a function to walk the directory tree with os.walk, and detecting mimetypes with mimetypes.guess_type
Day 014 of #100DaysOfCode. Working in github repo for scraping data from CIA Factbook. Today, I wrote quick and dirt code for getting mimetypes from all the files in factbook-{2000:2021} directories.
Day 015 of #100DaysOfCode. Working in github repo for scraping data from CIA Factbook. Forgot to update this repo, forgot to tweet. Too much work, scanning files to detect patterns in the data.
Day 015 of #100DaysOfCode. Working in github repo for scraping data from CIA Factbook. Forgot to update this repo, forgot to tweet. Wrote some code, broke some tests. Refactoring the code. I found an interesting pattern: The factbooks have some html files under the fields/ subdirectory, with highly structured data. However, I will resist the temptation. I am writing some code for matching and collecting data from these files. Original post about the evil attempts of processing html with regex
Day 015 of #100DaysOfCode. Working in github repo for scraping data from CIA Factbook. Updating this repo, tweeting about it.
Day 016 of #100DaysOfCode. Working in github repo for scraping data from CIA Factbook. Forgot to tweet. I am working with two (or three) days long sprints.
Day 017 of #100DaysOfCode. Working in github repo for scraping data from CIA Factbook. Today, I got the data from factbook-2000. I think that with low effort, I can get the data from factbook-2001
However, factbook-2002 to factbook-2017 are hard stuff.
factbook-2018 to factbook-2020 are the easiest ones, due to semantic html.
Day 018 of #100DaysOfCode. Working again after a long time off.
Day 019 of #100DaysOfCode.