Skip to main content

A JSON based finance file format

Project description

FinanceJSON

FinanceJSON is a JSON based finance file format. JSON is able to describe complex data structures, has a human readable syntax and is available in all common programming languages. It is therefore an appropriate choice to store financial data in this format. Another advantage is that this format allows easy storage, data extraction and conversion to different file formats.

The package currently provides converters to the following file formats:

  • CSV (multiple files)
  • EXCEL (XLSX)
  • H5

which are available from the command line. It also provides a kind of tree CLI command to quickly review the internal structure of the JSON file.

Specification

This repository contains the Specification of FinanceJSON in form of a JSON Schema.

Example

A FinanceJSON file for a stock:

{
  "yh_symbol": [
    {
      "symbol": "XYZ"
    }
  ],
  "ms_symbol": [
    {
      "symbol": "US_XYZ"
    }
  ],
  "yh_currency": [
    {
      "index_symbol" : "XYZ",
      "currency": "USD"
    }
  ],
  "ms_currency": [
    {
      "index_symbol": "XYZ",
      "currency": "USD"
    }
  ],
  "yh_esgScores": [
    {
      "index_symbol": "XYZ",
      "ratingYear": 2019,
      "ratingMonth": 9,
      "totalEsg": 12.4
    }
  ],
  "yh_earnings_earningsChart_quarterly": [
    {
      "index_symbol": "XYZ",
      "date": "4Q2018"
    }
  ],
  "yh_earnings_financialsChart_yearly": [
    {
      "index_symbol": "XYZ",
      "date": 2019
    }
  ],
  "yh_indexTrend_estimates": [
    {
      "index_symbol": "XYZ",
      "date" : "2019-01-01",
      "growth": 1,
      "period": "+1q"
    },
    {
      "index_symbol": "XYZ",
      "date" : "2019-01-01",
      "growth": 1,
      "period": "-1q"
    },
    {
      "index_symbol": "XYZ",
      "date" : "2019-01-01",
      "growth": 1,
      "period": "1q"
    },
    {
      "index_symbol": "XYZ",
      "date" : "2019-01-01",
      "growth": 1,
      "period": "+1y"
    }
  ],
  "yh_assetProfile": [
    {
      "index_symbol": "XYZ",
      "date": "2019-01-01",
      "address1": "foo",
      "auditRisk": 1,
      "boardRisk": 2,
      "city": "bar",
      "country": "a"
    }
  ],
  "yh_assetProfile_companyOfficers": [
    {
      "index_symbol": "XYZ",
      "name": "boe",
      "title": "CEO"
    }
  ],
  "yh_ohlcv_1d": [
    {
      "index_symbol": "XYZ",
      "date": "2019-01-01",
      "open": 1,
      "high": 2,
      "low": 3,
      "close": 4,
      "volume": 5
    }
  ]
}

FinanceJSON CLI

Python Version PyPI CI

This repository also contains a Python based commandline tool which is able validate and extract data from financeJSON files. It also emulate the linux tree command, printing out a tree structure of the JSON data.

Validate a financeJSON file:

financejson validate /path/to/financejsonfile

Print tree structure of financeJSON file:

financejson treejson /path/to/financejsonfile

Convert a financeJSON file into an HDF5 file:

financejson convert json h5 /path/to/financejsonfile
financejson convert json hdf /path/to/financejsonfile
financejson convert json hdf5 /path/to/financejsonfile

Convert a financeJSON file into an Excel readable file (each key is written to a separate sheet):

financejson convert json xlsx /path/to/financejsonfile

License

GNU General Public License v3.0

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

financeJSON-1.0.1b8.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

financeJSON-1.0.1b8-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file financeJSON-1.0.1b8.tar.gz.

File metadata

  • Download URL: financeJSON-1.0.1b8.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for financeJSON-1.0.1b8.tar.gz
Algorithm Hash digest
SHA256 5168166f9289d3849b49496e20c4ce07ff52bc428b366f97ac4b180d9a710fd4
MD5 2018079ffd2e23e766bab7ffd1dcb715
BLAKE2b-256 81310154e7964cc3dd815699ddc85118fa28d346bf192c986169f8fba51a6353

See more details on using hashes here.

File details

Details for the file financeJSON-1.0.1b8-py3-none-any.whl.

File metadata

  • Download URL: financeJSON-1.0.1b8-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for financeJSON-1.0.1b8-py3-none-any.whl
Algorithm Hash digest
SHA256 bd64369d28c8e38059e1b5d6220d6b8f5c7c944a5841943c29388d55e40989f9
MD5 01d6effe510deb0bba81b937dd9c4b40
BLAKE2b-256 ad3401e64f0e0ba1fbd37634fdeffc8d7bb31d4a8cebd78124ffced07bbf441f

See more details on using hashes here.

Supported by

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