Tag: Python

Using Python and MySQL in the ETL Process: Using Python and SQLAlchemy

In the previous two articles of this series, we discussed how to use Python and SQLAlchemy to perform the ETL process. Today we’ll do the same, but this time using Python and SQL Alchemy without SQL commands in textual format. This will enable us to use SQLAlchemy regardless of the database engine we’re connected to. So, let’s start. Today we’ll discuss how to perform the ETL process using Python and SQLAlchemy.

Using Python and MySQL in the ETL Process: SQLAlchemy

SQLAlchemy helps you work with databases in Python. In this post, we tell you everything you need to know to get started with this module. In the previous article, we talked about how to use Python in the ETL process. We focused on getting the job done by executing stored procedures and SQL queries. In this article and the next, we’ll use a different approach. Instead of writing SQL code, we’ll use the SQLAlchemy toolkit.

Using Python and MySQL in the ETL Process

Python is very popular these days. Since Python is a general-purpose programming language, it can also be used to perform the Extract, Transform, Load (ETL) process. Different ETL modules are available, but today we’ll stick with the combination of Python and MySQL. We’ll use Python to invoke stored procedures and prepare and execute SQL statements. We’ll use two similar-but-different approaches. First, we’ll invoke stored procedures that will do the whole job, and after that we’ll analyze how we could do the same process without stored procedures by using MySQL code in Python.

Merging Multiple User Accounts

Social media surrounds us, so it’s not unusual for applications to require some kind of social media integration. The most common issigning in with Facebook, Twitter, or another service. Users expect to be able to log in with different social accounts. So, applications meet these expectations by offering external login options.Let’s take a look at this functionality and investigate how to merge users’ accounts – specifically, we’ll consider the situation when people use several methods to log in.

How to Store Authentication Data in a Database. Part 4

Handling user registration and authentication isn’t an easy task. Both users and developers understand this. Users have to select and remember another username and password (taking into account different password policies, of course). A developer’s responsibility is to make this process secure and to properly protect the user’s data. So it’s no surprise that logging in with one account – Facebook or Google, for example – is extremely popular. Users gain easy access, and developers can delegate the sensitive process of authenticating users to social media services.

ORMs Under the Hood

It often happens that if something is loved, it is also hated with the same power. The idea of object relational mapping fits into this concept perfectly. You will definitely come across many opposite points and fierce discussions as well as unwavering advocates and haters. So if you have ever asked whether to use ORM or not, the answer “it depends” will not be enough.What Is an Object-Relational Mapping (ORM)?Object-relational mapping refers to synchronization between two different representations of data. From one side, there is a relational database, where the data is represented in terms of tuples, grouped into relations, while in application we manipulate objects.

Playing Around With Python in PostgreSQL

I’m kind of guy who likes to make jokes or take some ideas ad absurdum. It may looks useless, but examination of extremes helps me appreciate the middle way.Some time ago I was heavily infected by an idea: “let’s ditch the server side” (see my article: Do we still need server side programming? ). The “PostgreSQL as an Application Server” idea was born then. My Vertabelo colleagues insisted that I should write an article about it. I didn’t like it at first: it would require some real work :) This week I said why not? I’ll learn something new about PostgreSQL at least. So here we go.

Setting up a Local Development Environment

How This Tutorial Is OrganizedThe tutorial is divided into four articles: Introduction – Dive into web development with Flask. This article explains the basics of web development with Flask Part I – Setting up a local development environment (You are here) Step 1: Create virtual environment for all required dependencies Step 2: required packages: Flask, psycopg2, SQLAlchemy Step 3: Create requirements.txt file with all dependencies listed

Flask Web-App Development. Part III: Deployment to Heroku

How This Tutorial Is OrganizedThe tutorial is divided into four articles: Introduction – Dive into web development with Flask. This article explains the basics of web development with Flask Part I – Setting up a Local Development Environment Step 1: Create virtual environment for all required dependencies Step 2: required packages: Flask, psycopg2, SQLAlchemy Step 3: Create requirements.txt file with all dependencies listed

Flask Web-App Development. Part II: Application Development

How This Tutorial Is OrganizedThe tutorial is divided into four articles: Introduction – Dive into web development with Flask. This article explains the basics of web development with Flask Part I – Setting up a local development environment Step 1: Create virtual environment for all required dependencies Step 2: required packages: Flask, psycopg2, SQLAlchemy Step 3: Create requirements.txt file with all dependencies listed

Flask Web Application Development. Introduction

How This Tutorial Is OrganizedThe tutorial is divided into four articles: Introduction – Dive into web development with Flask. This article explains the basics of web development with Flask (You are here) Part I – Setting up a local development environment Step 1: Create virtual environment for all required dependencies Step 2: required packages: Flask, psycopg2, SQLAlchemy Step 3: Create requirements.txt file with all dependencies listed

How to Generate Flask-SQLAlchemy Models Using Vertabelo

Flask is a web microframework for Python. It uses Flask-SQLAlchemy for object relational mapping. It is a Flask wrapper for SQLAlchemy – a powerful relational database framework that offers a high level ORM and low level access to a database’s native SQL functionality.For each database table, SQLAlchemy uses a regular Python class with attributes that match the columns of a corresponding database table. The database instance from Flask-SQLAlchemy provides a base class for models called

Visual Design of SQLAlchemy Models in 6 Steps

In this article I’m going to show you how to design SQLAlchemy models using Vertabelo , an online tool for visual database design, and our code generator.SQLAlchemy is propably the most advanced and well engineered OR/M for Python, while Vertabelo is a database design tool that works in a web browser. The Vertabelo code generator is an pythonic script called vertabelo-sqlalchemy . As you can see, the script is open source and hosted on

Can Python Help You Win Scrabble?

It is hard to find someone who doesn’t know how to playScrabble. In case someone isn’t familiar with the game, here’s a quick explanation:Scrabble is played by two to four players on a square board with a 15×15 grid of cells, each of which accommodates a single letter tile. The board is marked with “premium” squares, which multiply the number of points awarded; each letter tile has its own assigned numeric score. At the start of a Scrabble game, every player chooses 7 letter tiles.