Skip to main content

Package that includes many tools commonly used in finance. Also includes a local database.

Project description

Financial Tools Andrew Perry (FinToolsAP)

Author: Andrew Maurice Perry Email: Andrewpe@berkeley.edu Start Date: 06/20/2023

Overall Module Description: This module implements several tools that are commonly used in finance and economics. Currently includes LocalDatabase and Fama French functionally.

Version Date: 11/06/2023 Version Updates: Production build of local database


Local Database

Description: Implement a local database that can be used to greatly speed up work flow. The database is meant for financial data but can be used to store any type of data. The class uses a SQLite3 backend to manage the database via sqlalchemy and provides a python3 wrapper making the use of the data database very quick and efficient by returning a pandas dataframe object that is formatted to (i.e. correct datatypes, only specified columns, sorted, etc). Data can be added in two ways: (1) CSV files can be read into the database from a local folder and (2) the database also interfaces with Whartons Research Data Services to automatically download specified tables.

Database File Structure:

save_directory/database_name/ |-- database_name.db |-- DatabaseParameters.py |-- CSVtoSQL/ |-- CreateTables/

database_name.db: This is the main database file storing all of the data. This file should NOT be modified. Modifying this file may compromise the operation of the local database. However, this is a SQL database that can be opened/modified by using SQLite3.

CSVtoSQL/: This folder contains the CSV files that should be read into the database. This is particularly useful for large files that cannot be stored in RAM. The method of reading in the CSV files completely bypasses system memory and moves data around on disk. The name that is given the the CSV file in this folder will be the name of the table inside the SQL database.

CreateTables/: This folder contains python scripts used to make user defined tables. These tables can use data that is already present within the database or additional files stored outside the database. These scripts will create tables in the database with the same name as the script itself and are run in the order specified in the DatabaseParameters.py file and "Tables.CREATED_TABLES" attribute. (See below)

DatabaseParameters.py (DBP): This file defines how the database operates. It is organized as several python classes. Classes are used to define information required by the database. This is the most important file for the operation of the database. This is the file that the user of the database should use to modify the operation of the database. Below is a description of the structure of the DBP file:

"Tables" Class: The tables class defines the tables that are in the database, this includes the tables that are downloaded from Wharton Research Data Services (WRDS), tables that should be read in from CSV files in the CSVtoSQL/ folder, and the tables that are user created and stored in the database. Additionally, if downloading tables from WRDS your WRDS username must be specified in the Tables class with the attribute "WRDS_USERNAME".

Adding Data:

Creating Custom Tables:

Querying the Database:

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fintoolsap-1.11.3.tar.gz (120.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fintoolsap-1.11.3-py3-none-any.whl (59.5 kB view details)

Uploaded Python 3

File details

Details for the file fintoolsap-1.11.3.tar.gz.

File metadata

  • Download URL: fintoolsap-1.11.3.tar.gz
  • Upload date:
  • Size: 120.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.0

File hashes

Hashes for fintoolsap-1.11.3.tar.gz
Algorithm Hash digest
SHA256 fa737f8c0479b30da55d3820ed632709e7b814c14add95e714f431fb4e446799
MD5 729c5a0997ec672a4b71f8692abb2c60
BLAKE2b-256 1b82f7c0bb741bf5e484c4b1a7859e44e1c2c203316ec3c9d84cdd1d94213b5f

See more details on using hashes here.

File details

Details for the file fintoolsap-1.11.3-py3-none-any.whl.

File metadata

  • Download URL: fintoolsap-1.11.3-py3-none-any.whl
  • Upload date:
  • Size: 59.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.0

File hashes

Hashes for fintoolsap-1.11.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fa835fdb75812b48227eb90e750d8f89a19533a6b8488bba44d13b1b1e828dbc
MD5 bb6f625baacf7bc85a9c93031be5c3f3
BLAKE2b-256 f9d445a563556362bedd751fcdb2c24158b96889b0795e6aa3df7e77ec4bbbd9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page