Last week I built and deployed a PyPi registry using Docker, Google Cloud Run and Github Actions.
It was a pretty straight forward process, I used the official PyPi Docker image and created a packages directory that would contain my custom packages.
FROM pypiserver/pypiserver:latestWORKDIR /srcADD packages /src/packagesADD entrypoint.sh /srcENTRYPOINT [“./entrypoint.sh”]
Using the Github Actions and the Gcloud CLI you can easily build and deploy this image whenever you add or update a package. The indentation below might not be 100% valid, you can view the source code here.
# Build and push image to Google Container…
I recently had to verify Stripe payload signatures in a Python app using AIOHTTP. The Stripe documentation shows examples of how to verify signatures using both Django and Flask but not AIOHTTP.
After spending more time than I’d like to admit trying to overcome ‘Failed to verify signature’ and ‘No matching signature found’ error messages I finally managed to realised where I was going wrong.
I was too used to using
await request.json() when accessing data from a request. When verifying signatures, Stripe requires the original, unaltered signature and since
await request.json() …
This post covers how to fetch data from the Fantasy Premier League (FPL) API using Python and convert them to Pandas dataframes. You can find a gist with all of the code in this article here.
This github repo contains data from the current and previous seasons of FPL as well as scripts to retrieve data from sites such as Understat and links to other resources related to data analysis of FPL data. I highly recommend that you check it out.
import pandas as pd
# Make sure to keep the trailing “/” in…
In part 1, I introduced the Plumber package and explained how it can be used to create a basic REST API in R. You can find a basic example/ boilerplate project here https://github.com/tunnelWithAC/r-boilerplate-api
This article contains information and code examples for various useful features of REST APIs. I cover the following features in this article.
FROM r-base:3.5.2RUN apt-get update -qq && apt-get install -y \gcc-8-base \libgcc-8-dev \libc6-dev \…
I first came across Plumber last year when I worked on a project that involved building a REST API using R to provide data for an analytics dashboard. I had limited experience with R before this project and it was my first time working with the Plumber package
R is most commonly used for statistical analysis and R Shiny is the most common method of building web apps using R. …
I recently had to create a map chart using Highcharts. There several small issues that I encountered while doing so. The solutions for each individual issue were quite easy to find but I wanted to provide a single solution to implement maps in react-highcharts-official.
Step 1: Install packages
npm install highcharts highcharts-react-official @highcharts/map-collection proj4
Step 2: Import packages into your project
import Highcharts from "highcharts";
import HighchartsReact from "highcharts-react-official";
import highchartsMap from "highcharts/modules/map";
import proj4 from "proj4";
import mapDataIE from "@highcharts/map-collection/countries/ie/ie-all.geo.json";