Python

Hand pointing at a drawing on a table

Converting JSON to CSV and back again using Python

When working in with data in any programming language, it is very common to use both JSON and CSV data structures.  Today we will discuss how you can convert your JSON files to CSV files.  And how to convert your CSV files into JSON files. There are a variety of reasons you might want to convert your JSON file into a CSV file and vice-versa.  Generally you would do this for compatibilty with whatever application you are trying to work with.  For example, if you have a powershell Read more […]

Read More

code printed on screen with green text

Creating CLI Utilities with Python

If you do any sort of automation, you have probably done a fair amount of work using the CLI on your computer.   This is applicable regardless of platform. If you use Python you might have asked yourself how you could start making your own command line utilities to help you in your daily tasks.  That very question is the topic of todays article. We will start by discussing how to get your python applications without having to type python at the beginning.  Then we will discuss how Read more […]


Girl using computer and writing on notepad

What is the python requirements.txt?

If you have browsed any python projects on Github or elsewhere, you have probably noticed a file called requirements.txt  This requirements.txt file is used for specifying what python packages are required to run the project you are looking at.  Typically the requirements.txt file is located in the root directory of your project. If you open a requirements.txt file, you will see something that looks simiar to this: pyOpenSSL==0.13.1 pyparsing==2.0.1 python-dateutil==1.5 pytz==2013.7 scipy==0.13.0b1 six==1.4.1 virtualenv==16.3.0 Notice Read more […]


Red apple sitting on wooden picnic table

Troubleshooting Python on MacOS

MacOS ships with Python 2.7 Pre-installed. This is helpful when you are just getting started with Python since you can just start using it with no setup. Unfortunately Python 2.7 is going out of support in 2020, so we all need to get to upgrading to Python 3. When you start upgrading Python, there is a good chance that Python will get messed up on your computer. This article wil help you troubleshoot and solve some of the issues you might encounter as you start moving to Python 3.X on MacOS. Preventing Read more […]


chalk board with the words test

Python Unit Testing using pytest

Unit testing is the act of testing a small unit of your code. Generally this means you are tesitng a function or a class in isolation. If you are doing this unit testing manually, you simply run your function, then check and make sure it gave you the expected output. This is what you have been manually doing ever since you first started writing software.As your software projects grow larger, this manual testing becomes less feasible. And you might start missing things that you would have caught during Read more […]


laptop next to a pineapple and some small pumpkins

Python data types explained

In python, almost everything is an object. This includes variables like String and Integers and containers like lists and dictionaries. Given that everything is an object, what are data types? Data types are simply how you classify your objects. If you have a an object with the type of String, then that object will have all of the string properties and functions. If you have an object with a type of integer, then that object will have all the applicable properties and functions associated with integers. Given Read more […]


man drawing flowchart on whiteboard

What is JSON? (JavaScript Object Notation)

Javascript Object Notation, or JSON for short, is a data structure that uses only human-readable text to transfer or store information. It is very popular, especially in the context of web technologies, for transferring data between applications.JSON allows you to import and export data in a structured manner without doing a lot of work to parse it. Frequently when you interact with a REST API, you will pass JSON structures back and forth. An example of when JSON is used for storing data can be seen Read more […]


puppy in teacup with red dots

Python Objects and Classes

Python is an Objected Oriented programming language. This means that Python has a data type called objects. Today we will discuss what objects are; how are objects relate to classes; and when you should use objects and classes. What are Objects? Objects are containers that hold a collection of attributes and functions. As an example, you might create an application that tracks dogs. For reach dog you are tracking, you might create an object. Then for each dog object, there is a collection of Read more […]


cups full of pens, pencils, paint brushes, and rulers

Working with Python Collections

A collection in Python is an object that contains other objects. You can also think of it as a container or a bucket. There are many different kinds of collections contained within the containers module in Python. Today, we will discuss the different kinds of Python Collections/Containers. How to use the different kinds of Containers. and when you should use which one.Data TypesThe four main container types are: List Tuple Dictionary Set All of these containers are similar to an array. But, Read more […]


two guys arm wrestling at a bar in black and white

Mutable vs Immutable objects in Python

There are two types of objects in Python, Mutable and immutable objects. Mutable objects are more flexible in that these objects can be changed in place. Immutable objects are more static and cannot be changed without allocating a new object of the new type or with the new value. In some languages, almost all variables are immutable. In other languages most objects are mutable, and you can be fairly liberal with changing the objects whenever you want. Today we will discuss mutable vs immutable objects.  Read more […]