Skip to main content

Creates cds and csn-files from pandas DataFrame.

Project description

pycsn

Python package supporting cds for table definitions in the first place. The data type is a dict and therefore using csn/json as the primary formatn from which a cds-document can be created.

Use cases:

  • Create csn/cds file from pandas DataFrame
  • Use a csn-file to update the datatypes of a DataFrame (keys, data types and consistency check)

To Do:

  • Support pyspark DataFrame and Delta Lake

Commandline

usage: pycsn [-h] [filename] [csn]

Creates csn-file from pandas DataFrame.

positional arguments:
  filename    Data Filename (csv) or folder (delta)
  csn         csn-file (optional)

options:
  -h, --help  show this help message and exit

PyPI - Version PyPI - Python Version


Table of Contents

Installation

pip install pycsn

For testing

Install cds

Install the cds cli tool "cds-dk"

npm add -g @sap/cds-dk

Local Database

Because the final destination of a table is HANA, you should test if the resulting sql-statement (CREATE TABLE) works. sqlite is recommended by SAP CAP.

For MacOs:

brew install sqlite

Testing

pyscn is using a dict a its primary data format.

Example Data

table : store columns : transaction_id: store_id:

License

pycsn is distributed under the terms of the MIT license.

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

pycsn-0.0.1.tar.gz (85.6 kB view hashes)

Uploaded Source

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