Some Notes on SQLAlchemy
Recently, I have been collecting and processing a large amount of data, which usually involves converting XML/text format data into relational, structured data for easy export and direct analysis, especially formats that can be directly analyzed by pandas (csv/json). Therefore, I need to use a mysql processing library in Python. Since I was looking for a processing library, I decided to go all out and choose a library that supports ORM. So, I chose SQLAlchemy. After using it for a while, I decided to write a record to remember the commonly used things during this period.
SQLAlchemy is an open-source software under the Python programming language. It provides an SQL toolkit and Object-Relational Mapping (ORM) tools, mainly to meet the following needs:
- Provide common operations on databases: add, delete, modify, and query
- Provide ORM functionality, which can turn the operating unit into an object, so there is no need to write sql statements for hard coding/decoding parsing data