Code Journal R2D5 100 Days of Code 2019-08-30

Posted on Fri 30 August 2019 in Python • Tagged with Python, Code Journal, Flask • 3 min read

The first couple of days of this second round of #100DaysOfCode I went through almost all the Flask tutorials in #100DaysOfWeb in Python) . They are:

  • Flask Intro
  • Calling APIs in Flask
  • Flask Login

As an extension to that I wanted to build my own app from scratch, in a way …


Continue reading

Pieces of Py #3 Clean up data from csv and save to json in a simple way with pandas

Posted on Mon 05 August 2019 in Python • Tagged with Python, Pieces of Py, Pandas, CSV, JSON • 4 min read

At work I once had to take a csv file that was exported from a large list in SharePoint, clean it up a bit and export it to a JSON format for importing in to a data layer. The csv file contained all columns in the SharePoint list, which was …


Continue reading

How I set up and work with this website

Posted on Sat 03 August 2019 in Python • Tagged with Python, Pelican, This website, CircleCI, Netlify • 6 min read

In this article I will go through how I set up this website. What my workflow looks like, updating content and configurations. Also how I set up a staging environment and a production environment with automatic builds and deployment. And how I can do almost anything from any of my …


Continue reading

Pieces of Py #2: Use a dictionary instead of multiple if-statements

Posted on Thu 01 August 2019 in Python • Tagged with Python, Pieces of Py, Dictionary, Lambda, Functools • 4 min read

One thing I learned during my first #100DaysOfCode was to use a dict instead of numerous if-statements. In my opinion it can make the code much more readable among other things. Here I'll try to make an example where this concept could fit in.

In this example we create a …


Continue reading

Pieces of Py #1: Decorator with arguments

Posted on Tue 09 July 2019 in Python • Tagged with Python, Pieces of Py, Decorator • 3 min read

This post is a simple example which explains how to create a decorator function that accepts and uses argument(s). A decorator that would accept an argument could look like this:

@mydecorator(my_argument)
def my_decorated_function(input):
    return input

A simple scenario could be that you would like to print something …


Continue reading