Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

drpt

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drpt - npm Package Compare versions

Comparing version
0.6.3
to
0.7.0
+20
-13
PKG-INFO
Metadata-Version: 2.1
Name: drpt
Version: 0.6.3
Version: 0.7.0
Summary: Tool for preparing a dataset for publishing by dropping, renaming, scaling, and obfuscating columns defined in a recipe.

@@ -109,2 +109,3 @@ Author-email: Constantinos Xanthopoulos <conx@xanthopoulos.info>

"skip-scaling": [],
"sort-by": [],
"rename": []

@@ -122,2 +123,3 @@ }

- `skip-scaling`: By default all columns are Min/Max scaled, except those excluded (`skip-scaling`)
- `sort-by`: Sort rows by the listed columns
- `rename`: Column renaming

@@ -141,2 +143,5 @@

##### _sort-by_
This is a list of column names by which to sort the rows. The order in the list denotes the sorting priority.
##### _rename_

@@ -172,2 +177,3 @@ The `rename` action is defined as a list of objects whose key is the original name (or regular expression), and their value is the target name. When the target uses matched groups from the regular expression those can be provided with their group number prepended with an escaped backslash (`\\1`) [see [example](#example) below].

"skip-scaling": ["test4"],
"sort-by": ["test4", "test3"],
"rename": [

@@ -184,7 +190,7 @@ { "test1": "test1_renamed" },

```csv
test1_renamed,test3_regex_renamed,test4_regex_renamed,test5,test6,test7,foo_1,foo_2
0.0,0,2,0.1488888888888889,0.06,0.0,0.0,0.0
0.5000000000000001,2,2,0.5055555555555556,0.08,0.2857142857142857,0.3333333333333333,0.3333333333333333
1.0,1,4,0.0,1.0,0.5714285714285714,0.6666666666666666,0.6666666666666666
0.5090909090909091,2,4,1.0,0.0,1.0,1.0,1.0
test3_regex_renamed,test4_regex_renamed,test1_renamed,test5,test6,test7,foo_1,foo_2
0,2,0.0,0.1488888888888889,0.06,0.0,0.0,0.0
2,2,0.5000000000000001,0.5055555555555556,0.08,0.2857142857142857,0.3333333333333333,0.3333333333333333
1,4,1.0,0.0,1.0,0.5714285714285714,0.6666666666666666,0.6666666666666666
2,4,0.5090909090909091,1.0,0.0,1.0,1.0,1.0
```

@@ -196,3 +202,3 @@

0,recipe_version,,1.0
1,drpt_version,,0.2.8
1,drpt_version,,0.6.3
2,DROP,test2,

@@ -202,3 +208,3 @@ 3,DROP,test8,

5,DROP_CONSTANT,const,
6,OBFUSCATE,test3,
6,OBFUSCATE,test3,"{""one"": 0, ""three"": 1, ""two"": 2}"
7,SCALE_DEFAULT,test1,"[1.1,3.3]"

@@ -210,7 +216,8 @@ 8,SCALE_DEFAULT,test5,"[0.1,1.0]"

12,SCALE_DEFAULT,foo.bar.test2,"[1,4]"
13,RENAME,test1,test1_renamed
14,RENAME,test3,test3_regex_renamed
15,RENAME,test4,test4_regex_renamed
16,RENAME,foo.bar.test,foo_1
17,RENAME,foo.bar.test2,foo_2
13,SORT,"['test4', 'test3']",
14,RENAME,test1,test1_renamed
15,RENAME,test3,test3_regex_renamed
16,RENAME,test4,test4_regex_renamed
17,RENAME,foo.bar.test,foo_1
18,RENAME,foo.bar.test2,foo_2
```

@@ -217,0 +224,0 @@

@@ -7,3 +7,3 @@ [build-system]

name = "drpt"
version = "0.6.3"
version = "0.7.0"
description = "Tool for preparing a dataset for publishing by dropping, renaming, scaling, and obfuscating columns defined in a recipe."

@@ -40,3 +40,3 @@ readme = "README.md"

[tool.bumpver]
current_version = "0.6.3"
current_version = "0.7.0"
version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]"

@@ -43,0 +43,0 @@ commit_message = "Bump version {old_version} -> {new_version}"

+19
-12

@@ -62,2 +62,3 @@ # Data Release Preparation Tool

"skip-scaling": [],
"sort-by": [],
"rename": []

@@ -75,2 +76,3 @@ }

- `skip-scaling`: By default all columns are Min/Max scaled, except those excluded (`skip-scaling`)
- `sort-by`: Sort rows by the listed columns
- `rename`: Column renaming

@@ -94,2 +96,5 @@

##### _sort-by_
This is a list of column names by which to sort the rows. The order in the list denotes the sorting priority.
##### _rename_

@@ -125,2 +130,3 @@ The `rename` action is defined as a list of objects whose key is the original name (or regular expression), and their value is the target name. When the target uses matched groups from the regular expression those can be provided with their group number prepended with an escaped backslash (`\\1`) [see [example](#example) below].

"skip-scaling": ["test4"],
"sort-by": ["test4", "test3"],
"rename": [

@@ -137,7 +143,7 @@ { "test1": "test1_renamed" },

```csv
test1_renamed,test3_regex_renamed,test4_regex_renamed,test5,test6,test7,foo_1,foo_2
0.0,0,2,0.1488888888888889,0.06,0.0,0.0,0.0
0.5000000000000001,2,2,0.5055555555555556,0.08,0.2857142857142857,0.3333333333333333,0.3333333333333333
1.0,1,4,0.0,1.0,0.5714285714285714,0.6666666666666666,0.6666666666666666
0.5090909090909091,2,4,1.0,0.0,1.0,1.0,1.0
test3_regex_renamed,test4_regex_renamed,test1_renamed,test5,test6,test7,foo_1,foo_2
0,2,0.0,0.1488888888888889,0.06,0.0,0.0,0.0
2,2,0.5000000000000001,0.5055555555555556,0.08,0.2857142857142857,0.3333333333333333,0.3333333333333333
1,4,1.0,0.0,1.0,0.5714285714285714,0.6666666666666666,0.6666666666666666
2,4,0.5090909090909091,1.0,0.0,1.0,1.0,1.0
```

@@ -149,3 +155,3 @@

0,recipe_version,,1.0
1,drpt_version,,0.2.8
1,drpt_version,,0.6.3
2,DROP,test2,

@@ -155,3 +161,3 @@ 3,DROP,test8,

5,DROP_CONSTANT,const,
6,OBFUSCATE,test3,
6,OBFUSCATE,test3,"{""one"": 0, ""three"": 1, ""two"": 2}"
7,SCALE_DEFAULT,test1,"[1.1,3.3]"

@@ -163,7 +169,8 @@ 8,SCALE_DEFAULT,test5,"[0.1,1.0]"

12,SCALE_DEFAULT,foo.bar.test2,"[1,4]"
13,RENAME,test1,test1_renamed
14,RENAME,test3,test3_regex_renamed
15,RENAME,test4,test4_regex_renamed
16,RENAME,foo.bar.test,foo_1
17,RENAME,foo.bar.test2,foo_2
13,SORT,"['test4', 'test3']",
14,RENAME,test1,test1_renamed
15,RENAME,test3,test3_regex_renamed
16,RENAME,test4,test4_regex_renamed
17,RENAME,foo.bar.test,foo_1
18,RENAME,foo.bar.test2,foo_2
```

@@ -170,0 +177,0 @@

Metadata-Version: 2.1
Name: drpt
Version: 0.6.3
Version: 0.7.0
Summary: Tool for preparing a dataset for publishing by dropping, renaming, scaling, and obfuscating columns defined in a recipe.

@@ -109,2 +109,3 @@ Author-email: Constantinos Xanthopoulos <conx@xanthopoulos.info>

"skip-scaling": [],
"sort-by": [],
"rename": []

@@ -122,2 +123,3 @@ }

- `skip-scaling`: By default all columns are Min/Max scaled, except those excluded (`skip-scaling`)
- `sort-by`: Sort rows by the listed columns
- `rename`: Column renaming

@@ -141,2 +143,5 @@

##### _sort-by_
This is a list of column names by which to sort the rows. The order in the list denotes the sorting priority.
##### _rename_

@@ -172,2 +177,3 @@ The `rename` action is defined as a list of objects whose key is the original name (or regular expression), and their value is the target name. When the target uses matched groups from the regular expression those can be provided with their group number prepended with an escaped backslash (`\\1`) [see [example](#example) below].

"skip-scaling": ["test4"],
"sort-by": ["test4", "test3"],
"rename": [

@@ -184,7 +190,7 @@ { "test1": "test1_renamed" },

```csv
test1_renamed,test3_regex_renamed,test4_regex_renamed,test5,test6,test7,foo_1,foo_2
0.0,0,2,0.1488888888888889,0.06,0.0,0.0,0.0
0.5000000000000001,2,2,0.5055555555555556,0.08,0.2857142857142857,0.3333333333333333,0.3333333333333333
1.0,1,4,0.0,1.0,0.5714285714285714,0.6666666666666666,0.6666666666666666
0.5090909090909091,2,4,1.0,0.0,1.0,1.0,1.0
test3_regex_renamed,test4_regex_renamed,test1_renamed,test5,test6,test7,foo_1,foo_2
0,2,0.0,0.1488888888888889,0.06,0.0,0.0,0.0
2,2,0.5000000000000001,0.5055555555555556,0.08,0.2857142857142857,0.3333333333333333,0.3333333333333333
1,4,1.0,0.0,1.0,0.5714285714285714,0.6666666666666666,0.6666666666666666
2,4,0.5090909090909091,1.0,0.0,1.0,1.0,1.0
```

@@ -196,3 +202,3 @@

0,recipe_version,,1.0
1,drpt_version,,0.2.8
1,drpt_version,,0.6.3
2,DROP,test2,

@@ -202,3 +208,3 @@ 3,DROP,test8,

5,DROP_CONSTANT,const,
6,OBFUSCATE,test3,
6,OBFUSCATE,test3,"{""one"": 0, ""three"": 1, ""two"": 2}"
7,SCALE_DEFAULT,test1,"[1.1,3.3]"

@@ -210,7 +216,8 @@ 8,SCALE_DEFAULT,test5,"[0.1,1.0]"

12,SCALE_DEFAULT,foo.bar.test2,"[1,4]"
13,RENAME,test1,test1_renamed
14,RENAME,test3,test3_regex_renamed
15,RENAME,test4,test4_regex_renamed
16,RENAME,foo.bar.test,foo_1
17,RENAME,foo.bar.test2,foo_2
13,SORT,"['test4', 'test3']",
14,RENAME,test1,test1_renamed
15,RENAME,test3,test3_regex_renamed
16,RENAME,test4,test4_regex_renamed
17,RENAME,foo.bar.test,foo_1
18,RENAME,foo.bar.test2,foo_2
```

@@ -217,0 +224,0 @@

@@ -1,1 +0,1 @@

__version__ = "0.6.3"
__version__ = "0.7.0"

@@ -33,2 +33,6 @@ #!/usr/bin/env python3.9

},
"sort-by": {
"type": "array",
"items": {"type": "string"},
},
"rename": {

@@ -364,2 +368,8 @@ "type": "array",

def _sort_rows(self):
if "sort-by" in self.recipe["actions"]:
with ProgressMessage("Sorting rows..."):
self.data.sort_values(self.recipe["actions"]["sort-by"], inplace=True)
self._report_log("SORT", self.recipe["actions"]["sort-by"], "")
def _rename_columns(self):

@@ -405,2 +415,3 @@ if "rename" in self.recipe["actions"]:

self._scale_columns()
self._sort_rows()
self._rename_columns()

@@ -407,0 +418,0 @@ if not self.dry_run: