Skip to main content

price-database

A simple Python library and a CLI for storage of prices

The purpose of this project is to provide a storage and means of accessing a price database. It can be reused among multiple projects.

The goal is very simple: separate a storage of prices of various elements (commodities) from other applications or components.

The Price object has several properties:

  • unique identifier = uniquely identifies each record for ease of accessing

  • namespace = distinguishes the namespace for the symbol. Often the exchange name.

  • symbol = security/commodity symbol that identifies it within the namespace (exchange).

  • date = The date of the price

  • time = The time of the price

  • value = Value in currency

  • currency identifier = identifier for the currency. Can be anything the remote system is using.

With these, it should be possible to store prices for commodities used in GnuCash, GnuCash Portfolio, Asset Allocation and other similar financial packages.

Development

I'm toggling between using PyCharm and Visual Studio Code, with the following libraries:

  • pylint,

  • pytest,

  • rope, for refactoring

Installation

pip install -e .

Then manually copy the data/prices-template.db into data/prices.db.

Running commands like pricedb list for the first time, will create pricedb.ini file in your home directory. Once created, edit the file and add the required values, like the database path and/or the API keys for online services.

Configuration

PriceDb expects to find a configuration file "pricedb.ini" in the user's profile directory. It will create one if it doesn't find it, but you need to supply the values before the application is functional.

At a minimum, provide the path to the database file.

Running

pricedb

is a command-line interface to all the provided functionality.

Using Python, the PriceDbApplication class is the front-end, providing the same functionality through code.

Example:

pricedb import data\AUD_2017-11-11_142445.csv AUD -v DEBUG

Logging

click-log package is used to provide log output. Simply enable by passing

-v LEVEL

to the command line, where LEVEL is one of the logging levels. Use empty -v option for details.

Publishing

Publishing to PyPi:


python setup.py sdist bdist_wheel

twine check dist/*

twine upload --repository-url https://test.pypi.org/legacy/ dist/*

twine upload dist/*

Metadata

Release files for PriceDb 2.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PriceDb 2.11.0
File Size Uploaded
PriceDb-2.11.0.tar.gz 29.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PriceDb 2.11.0
File Interpreter ABI Platform
PriceDb-2.11.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 60.4 kB

Release files / PriceDb-2.11.0.tar.gz

Download URL PriceDb-2.11.0.tar.gz
Size 29.7 kB
Tags Source
SHA-256 checksum
How to use checksums
24df6dddf77a33ef6b17ca1f6db00bf00912a8df61846329dbbb140739d95647
BLAKE2b-256 checksum
How to use checksums
32194006d65211f0a4eae852c575e897958eb8319b4dfb7febb299fc969cfe89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.1

Release files / PriceDb-2.11.0-py2.py3-none-any.whl

Download URL PriceDb-2.11.0-py2.py3-none-any.whl
Size 30.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8de553b9e003406ef53f03260427233d35ed8e816cb3a54f09ff0f52fb33db27
BLAKE2b-256 checksum
How to use checksums
b059e17e0724d3aa76c444911ae7eef36ead5b6f6d4d8a65b8c9881603426951
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.1

Release history Release notifications | RSS feed

This release

2.11.0 This release

2 release files

2.10.6

1 release file

2.10.5

1 release file

2.10.4

1 release file

2.10.3

1 release file

2.10.2

1 release file

2.10.1

1 release file

2.10.0

1 release file

2.9.4

2 release files

2.9.3

2 release files

2.9.2

1 release file

2.9.1

1 release file

2.9.0

1 release file

2.8.1

2 release files

2.8.0

2 release files

2.7.0

1 release file

2.6.0

2 release files

2.5.0

2 release files

2.4.2

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.5

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.0

1 release file

1.12.0

1 release file

1.11.1

1 release file

1.11.0

1 release file

1.10.0

1 release file

1.9.0

1 release file

1.8.0

1 release file

1.7.1

1 release file

1.7.0

1 release file

1.6.0

1 release file

1.5.7

1 release file

1.5.6

1 release file

1.5.5

1 release file

1.5.4

1 release file

1.5.3

1 release file

1.5.2

1 release file

1.5.1

1 release file

1.5.0

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.7

1 release file

1.3.6

1 release file

1.3.5

1 release file

1.3.4

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.2.17

1 release file

1.2.16

1 release file

1.2.15

1 release file

1.2.14

1 release file

1.2.13

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page