Categories
python

Using FuzzyFuzzy to Match similar strings and Making Tweaks to Improve it

I have been scraping betting odds from a few websites in my spare time to decrease the time manually checking the odds on the different sites. I’ve been using Fuzzywuzzy Example I scrape an event name from a specific site: name = Feyenoord Rotterdam – Wolfsberger AC Now I want to match it with an […]

Categories
django django OAuth python Security

Using django-oauth-toolkit for Client credentials Oauth Flow

I’ve been wanting to secure my api – so unidentified and unathorized parties cannot view, update, create or delete data. This api is internal to the company and will only be used by other services – in other words no end users. Hence the delegation of authorization need not happen and the services will be […]

Categories
GNU/Linux python

Prerequisite Packages and Compiling Python 3 on CentOS

What are the prerequisite packages for a complete python3 compilation install? You will always get issues like Pip not being able to access pypi because the openssl module was not installed. Other things need the gcc compiler and such. Recently I got this warning: Could not import the lzma module. Your installed Python is incomplete. […]

Categories
API python

HTTPX: An open stream object is being garbage collected; call “stream.close()” explicitly.

When using HTTPX I get the following error printed sometimes: An open stream object is being garbage collected; call "stream.close()" explicitly. According to these two github issues: An open stream object is being garbage collected; call "stream.close()" explicitly An open stream object is being garbage collected; call "stream.close()" explicitly This is a Python 3.8.0 issue. […]

Categories
python

How to speed up http calls in python? With Examples

Blocking HTTP requests The most popular and easy to use blocking http client for python is requests. The requests docs are simple and straight forward…for humans. The biggest performance gain you can acquire (provided you are making requests to a single host) is using an http session. This creates a persistent connection, meaning that additional […]