Skip to main content

Price database storage for commodities

Project description

# 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.

## Installation

`pip install -e .`

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

## 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.

## Distribution

Create .pypirc file in your profile directory, containing:

```
[distutils]
index-servers =
pypi
test

[pypi]
repository: https://upload.pypi.org/legacy/
username: ****
password: ****

[test]
repository: https://test.pypi.org/legacy/
username: ****
password: ****
```

### Test Site

```
python setup.py sdist upload -r test
```

### Production Site

```
python setup.py sdist upload -r pypi
```

Project details


Download files

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

Source Distribution

PriceDb-1.5.5.tar.gz (18.6 kB view details)

Uploaded Source

File details

Details for the file PriceDb-1.5.5.tar.gz.

File metadata

  • Download URL: PriceDb-1.5.5.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PriceDb-1.5.5.tar.gz
Algorithm Hash digest
SHA256 63160f0ee89f7245d58301e540b85f1c586bcf72cd6057847915a2825dec42d8
MD5 1924c9bfc560ac7167bc03e5ac61f61b
BLAKE2b-256 3effe2e05b3974c1864772333530ea174da40c694fc96bef82c0500a5b0c40d6

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