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:
- Commandline: creating csn-file from csv-file that can be then adjusted
- Use package for creating a csn-file in a python script, e.g.
- Create csn from pd.DataFrame with index as primary keys
- Add annotations
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
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pycsn-0.0.2.tar.gz.
File metadata
- Download URL: pycsn-0.0.2.tar.gz
- Upload date:
- Size: 85.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa1b35473a272fd04b98bd2ce5f3bf5c8aefa90df0a74233cabeb205cadda7cc
|
|
| MD5 |
7816186903059df608030c947ddffb3c
|
|
| BLAKE2b-256 |
60a1a5c79b2b19adf69f834dc9e518ba50c9ec10873d505738bcac786dc1003c
|