Skip to main content

Module for working with PDKF files and Pandas dataframes

Project description

PDKF

Python package for converting PBKF file to DataFrame (pandas) list.

Example

It is simple example for using package. This code converts data from file.pdkf to dataframe_dict.

import pdkf

dataframe_dict = pdkf.read_pdkf('file.pdkf')
for key, dataframe in dataframe_dict.items():
    print(key)
    print(dataframe.info())

PDKF structure

The file is a ZIP archive. For each dataframe, you need to add two files to the archive:

  • META file;
  • CSV or JSON file. The META file contains the Pandas data types for the dataframe. For example:

Service.csv

name,purchase_price,description,remainder
sofa_low,10000.00,description,8
armchair_rocking,8000.00,description,14
bed_double,18000.00,description,6
chair_computer, 12000.00,description,2
bed_children,16000.00,description,5

Service.meta

{
    "name":"object",
    "purchase_price":"float",
    "description":"object",
    "remainder":"int64"
}

ServiceCost.json

[
    {
        "sofa_low":[
            {
                "price":"21000.00",
                "date":"2021.01.16"
            },
            {
                "price":"19000.00",
                "date":"2021.02.21"
            }
        ]
    },
    {
        "armchair_rocking":[
            {
                "price":"15000.00",
                "date":"2021.01.16"
            }
        ]
    }
]

ServiceCost.meta

{
    "price":"float",
    "date":"datetime64[ns]"
}

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

pdkf-1.1.0.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

pdkf-1.1.0-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

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