Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jferard/csvtransformer
CSV Transformer - A CSV Transformer library in Python
https://github.com/jferard/csvtransformer
Last synced: 1 day ago
JSON representation
CSV Transformer - A CSV Transformer library in Python
- Host: GitHub
- URL: https://github.com/jferard/csvtransformer
- Owner: jferard
- License: gpl-3.0
- Created: 2022-07-15T21:01:46.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-09T08:38:52.000Z (over 2 years ago)
- Last Synced: 2023-05-29T11:23:58.664Z (over 1 year ago)
- Language: Python
- Size: 491 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CSV Transformer - A CSV Transformer library in Python
Copyright (C) 2022 J. Férard
License: GPLv3
This is a POC. See tests to understand the goal of the library.
## Format of the transformation dict
All entries are optional.### The entity filter
Format :
```
"entity_filter" :
```This filter lines before aggregating them.
### The default column transformation
Format :
```
"default_col" : {
"normalize":
"visible":
}
```* `"normalize"` means that the column names are normalized by default. This can be overrided by col `"rename"` attribute.
* `"visible"` means that columns are visible by default. This can be overrided by col `"visible"` attribute.### The columns transformations
Format :
```
"cols" : {
"": ,
...
}
```#### A column transformation
Format :
```
"": {
"visible":
"id"
"type": >
"filter"
"map"
"rename"
"agg"
}
```* `"visible"`: means that the column is visible.
* `"type"`: the name of a type, or an expression### The new columns (TODO)
Format :
```
"new_cols" : [
,
...
]
```### A new column (TODO)
Format :
```
"": {
"visible":
"id"
"filter"
"formula"
"rename"
"agg"
}
```### The aggregate filter (TODO)
Format :
```
"agg_filter" :
```Filters after aggregation.
## Expressions
### Data Types
Simple data types### Operators
### Functions
## Test
```
python3 -m pytest --cov-report term-missing --cov=csv_transformer && python3 -m pytest --cov-report term-missing --ignore=test --cov-append --doctest-modules --cov=csv_transformer
```