Blog (page 2)

Common AWS SSL Errors in Python

Self signed certificate in certificate chain While there are a number of reasons this error can happen, most of them are related to the process in which certificates are verified by Python. When a secure SSL/TLS connection is made, the certificate presented by the server is checked against a known list of certificates provided by a CA …

Homebrew Python Not Found

This is a huge annoyance of mine. When you install Python using Homebrew, the install script doesn’t configure your PATH to accommodate the version-less symlinks and aliases created, resulting in the notorious error: In short, python3 and pip3 work but python and pip will not! How to fix ‘python command not found’ First create and copy the symlink …

JSON Encoder for ALL Numpy Types

The following is a JSON encoder for all NumPy Types. It will take care of booleans, bytes, shorts, ints, longs, floats, doubles, and everything in between. You can use it by replacing data with your JSON data that you are trying to convert. You can implement it on every NumPy data type that I am aware of… …

Combine all parquet files in a directory

This is the code I use to merge a number of individual parquet files into a combined dataframe. It will (optionally) recursively search an entire directory for all parquet files, skipping any that cause problems. It uses Pandas dataframes but it can easily be swapped out to use Dask if desired. Here is an example …

Validating YAML using CLI

Sometimes you just want to check to see if a YAML file is correct and you don’t want to have to open it up on your IDE or install tools just so you can see if it is valid. The following command will quickly parse and validate even the largest YAML configuration files. If you …

Installing Xcode on Apple Silicon

How to install Xcode via the CLI You can install Xcode on a Mac by running the following command in the terminal: How to update your Xcode installation when using Homebrew When running a homebrew brew command, you may see errors related to the version of Xcode you have installed. Simply update Xcode to the latest version using …

Python Requests - 407 Proxy Authentication Required

A 407 Proxy Authentication Required response is often returned either when a request being made through a proxy requires authentication or if the credentials being passed are invalid or have been incorrectly escaped. The following are a number of different approaches on how you can fix this issue, as some proxies require different implementations. Proxy …