Posts in "Python" category

Featured Image

Extracting Text from a PDF Using Python

 Jan. 6, 2019    0 comments 

Recently I needed to extract text from a PDF file using Python. Quick googling led me to PyPDF2 package, however I wasn't able to extract any text from my test PDF with it. The test PDF was created with Google Docs (a very common scenario) and did not have any fancy formatting, so PyPDF2 was disqualified for my purposes. After further googling I found pdfminer package and its Python 3 compatible version — pdfminer.six. (...)

Read post

 Python

Featured Image

Using Docker with Travis Continuous Integration

 Sept. 16, 2018    0 comments 

Note: This is a re-worked version of my previous article. I it has been updated based on practial experience and to reflect recent changes in Travis CI.

GitHub supports several cloud-based continuous integration services. One of them is Travis CI that allows to run automated testing and deployment tasks on Linux Ubuntu and macOS. Unfortunately, their Ubuntu environment is quite dated — currently they use Ubuntu 14.04 LTS (Trusty Tahr) or Ubuntu 16.04 (Xenial Xerus) while the current LTS release (at the moment of this writing) is Ubuntu 18.04 LTS (Bionic Beaver), so some of the recent language and tooling versions may not be available in Travis CI build environment. (...)

Read post

 Continuous IntegrationDockerGitHubPython

Featured Image

Scrapy Tutorial - Part 2

 Aug. 7, 2018    0 comments 

In the 1st part of my tutorial I demonstrated how to create a simple Scrapy spider that collects data from a website. Now I will show you how to save scraped data in JSON and XLSX formats. (...)

Read post

 PythonScrapy

Featured Image

Bootstrap4-based Pagination Buttons for Django ListView

 May 11, 2018    0 comments 

Often, when displaying multi-page lists in html pages rendered from Django templates, we need to include a pagination control, usually a set of navigation buttons, that is both functional and good looking. In this post I'll describe the solution used in this blog to paginate the list of search results. (...)

Read post

 DjangoHTMLPython

Featured Image

Python 3.7’s new builtin breakpoint and Web-PDB

 April 30, 2018    0 comments 

Recently, I came across an article about Python 3.7’s new builtin breakpoint published on Medium. The article published in March describes the new Python 3.7 feature - built-in breakpoint() function that suspends Python program execution and starts a debugger (the built-in PDB by default). But for me the most interesting part is that the article mentions my Web-PDB remote debugger and describes how to use the new breakpoint() function with it. It's nice to know that people are actually using my work and reference it in their articles.

Read post

 Python