Peewee setup

Peewee, the object relational manager library that was described at the beginning of this chapter, is excellent at database management in Python. It uses Python classes to define settings for the database, including table configurations, the location of the database, and how to handle different Python data types. On line 46, we must first create an anonymous database connection using the Peewee Proxy() class, which allows us to redirect the information into the previously specified format. This variable must be declared before any Peewee operations, as per its documentation (

Following the initialization of the proxy, we define our first Python class used in this book, thus creating a BaseModel ...

Get Learning Python for Forensics - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.