RSSAmplifier

Blog

Python programming, web, data science

Blog about programming (Python) and occasionally about data analysis

pawelmhm.github.ioRSS feed ↗10 posts

Latest posts

Create event-driven sales alert system with Faust and Aiohttp

In this post I’ll write a simple python app that will post message to Slack when your users purchase a subscription. The web app will be a aiohttp server that will coordinate with Python-Faust to send Slack requests asynchronously in the background. Faust is a framework, that simplifies writing event-driven systems in Python. It allows you to use the power of Apache Kafka via Python. With Faust…

Building HTTP 2 server in Python

Python Twisted will support HTTP 2 in its web server . HTTP2 is not available by default, to get it you need to install hyper-h2 (just run pip install twisted[h2] ). This is really big and exciting news for whole Python ecosystem so it’s worth seeing how it works and how difficult or easy it is to set up. In this post I’m going to build some simple Twisted website serving content over HTTP 2 and…

What bookmakers data tells us about Euro 2016

The final game of Euro 2016 is going to be played today so it’s a good day to look back and see how tournament unfolded. When the tournament began I decided it will be interesting to track how bookmakers viewed the contest. Which team was the top favorite to win the tournament? How did odds of each team evolve over time? To answer these questions I decided to keep track of bookmaker website and…

Making 1 million requests with python-aiohttp

In this post I’d like to test limits of python aiohttp and check its performance in terms of requests per minute. Everyone knows that asynchronous code performs better when applied to network operations, but it’s still interesting to check this assumption and understand how exactly it is better and why it’s is better. I’m going to check it by trying to make 1 million requests with aiohttp client.…

The benefits of static typing without static typing in Python

One of the most popular complaints against Python is that its dynamic type system makes it easy to introduce bugs into your programs. As you probably know in statically typed languages (e.g. Java, C++, Rust) type of variable is checked at compile time. In dynamically typed languages (e.g. Python, Ruby) type of variables is interpreted at runtime. Proponents of statically typed languages argue that…

Creating Websockets Chat with Python

In this post I’m going to write simple chat roulette application using websockets. App will consist of very basic user interface with some HTML + JavaScript. When I say “basic” I really mean it, it’s going to be just input box and vanilla JS creating websocket connection. On the backend side app will have websocket server managing realtime communication between clients. Websockets are one of the…

How to Create Webkit Browser with Python

In this tutorial we’ll create simple web browser using Python PyQt framework. As you may know PyQt is a set of Python bindings for Qt framework, and Qt (pronounced cute ) is C++ framework used to create GUI-s. To be strict you can use Qt to develop programs without GUI too, but developing user interfaces is probably most common thing people do with this framework. Main benefit of Qt is that it…

How to abuse HTTP?

You’d think that HTTP is so common that most people should have no problem with getting basics of protocol right. Even if you know next to nothing about computers you still probably heard about the meaning of basic HTTP codes such as 404 or 200. Despite its popularity, or maybe because of its popularity HTTP is one of the most frequently abused and misunderstood protocols. This is clearly…

Creating simple realtime app with Celery, CherryPy and MongoDb

In this post I’d like to create demo realtime Stack Overflow mirror with Celery , CherryPy and MongoDB. By realtime I mean that app will fetch results from remote resource in short intervals, and it will display results in simple one page js-html app without user clicking browser refresh button. ** All of the code for this tutorial is placed in my blog’s github account. Design for the whole…

Analyzing Python Job Market with Pandas

In this post I’m doing some simple data analytics of job market for python programmes. I will be using Python Pandas My dataset comes from reed.co.uk - UK job board. I created simple Scrapy project that crawls reed.co.uk python job section, and parses all ads it finds. While crawling I set high download delay of 2 seconds, low number of max concurrent requests per domain and added descriptive user…