-
How to Store Python Packages in Google Artifact Registry
Learn a secure way to store your private packages on the Google Cloud Platform The Artifact Registry of the Google Cloud Platform (GCP) provides a central location for storing and managing “build artifacts” such as Docker images, Python packages, NPM packages, and many more. It’s especially useful if you need to store these build artifacts in… Continue reading
-
How to Scrape JavaScript Webpages with Splash, Requests, and lxml in Python
Learn a simple way to get data from JavaScript websites Splash is a JavaScript rendering service developed by Scrapinghub, the same company that develops the popular Scraping framework Scrapy. It is particularly useful for scraping web pages that are created by JavaScript frameworks like Angular, React, Vue, etc. This is challenging if not impossible with… Continue reading
-
Explore the Basic Functions of Nginx with Simple Examples
Learn to use Nginx for serving static files, SSL/TLS termination, and reverse proxying Nginx is a popular open-source web server, reverse proxy server, and load balancer. If you are working in the software development industry, you should have heard of it already, even though you may not have had the chance to work with it directly… Continue reading
-
Learn the Basics of Docker and Docker Compose as a Software Developer
Like virtual machines (VMs), Docker is also a technology for deploying and running applications in isolated environments. However, Docker has the advantage of being more lightweight, more portable, easier to set up, and faster to start, which makes it particularly well-suited for microservices and modern, cloud-native applications. Docker is a must-know tool for software developers… Continue reading
-
Learn the Basics of Lua for Web Scraping as a Python Developer
Lua is a lightweight and high-level programming language that is typically employed for scripting purposes. It was designed with the intention to be integrated into other applications and allows developers to extend the functionality of their software by custom scripts. As a Python developer, you may normally not have the chance to work with Lua.… Continue reading
-
Deal with Common Types of SQLAlchemy Exceptions for Running SQL Queries in Python
When working with databases using SQLAlchemy, many developers may simply catch the base exception SQLAlchemyError, or worse, the base Python Exception. This is not a good practice because it makes the code work like a black box and we cannot anticipate what types of exceptions can be raised. In this post, we will introduce some… Continue reading
-
Understand SQL Injection and Learn to Avoid It in Python with SQLAlchemy
SQL Injection is one of the most common and also most dangerous web security vulnerabilities which allows hackers to inject malicious SQL code into unvalidated and unsanitized plain SQL queries. It is also a common issue that new developers overlook. The cause and solution for SQL Injection are actually pretty simple. In this post, we… Continue reading
-
How to Work with SQLAlchemy Query, Table, and ORM Classes in Pandas
In a previous post, we introduced the fundamentals of how to write to and read from a SQL database using pandas. It is sufficient if you just want to read from the whole table and just want to use simple SQL queries. However, if you use SQLAlchemy Core API or Object Relational Mappers (ORM), the… Continue reading
-
How to Work with SQL Databases Efficiently in Pandas
A major benefit of working with SQL data in pandas is that we can manipulate a large amount of data much more efficiently. If you have been writing aggregation queries using GROUP BY in SQL, or worse, looping through database records one by one in Python, you should try to use pandas to perform these… Continue reading
-
How to Use the Cool New Annotated Typing Feature of FastAPI
In the latest release of FastAPI (v0.95 at the time of writing), there is a cool new feature for adding type annotations. It is Annotated that allows you to add some metadata to your query/path parameters, headers, and even dependencies. There are many benefits of using Annotated for type annotations, including better editor support, easier-to-share… Continue reading