Skip to content

Commit 7f1198f

Browse files
committed
python SDK release 0.1.1
1 parent e395a70 commit 7f1198f

File tree

147 files changed

+1642
-3229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+1642
-3229
lines changed

PKG-INFO

Lines changed: 4 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: tuneinsight
3-
Version: 0.1.0
3+
Version: 0.1.1
44
Summary: Diapason is the official Python SDK for the Tune Insight Agent API
55
License: Apache-2.0
66
Author: Tune Insight SA
@@ -36,7 +36,7 @@ Diapason is the Tune Insight Python SDK
3636
### Installing
3737

3838
```bash
39-
pip install tuneinsight-0.1.0.tar.gz
39+
pip install tuneinsight-0.1.1.tar.gz
4040
```
4141

4242
## Usage
@@ -52,156 +52,8 @@ from tuneinsight.client.diapason import Diapason
5252
client = Diapason.from_config_path('conf.yml')
5353
```
5454

55-
### Features
56-
#### Computations
57-
#### Preprocessing
58-
Preprocessing operations should be defined in relation to a computation. The preprocessing when the computation is ran.
59-
For example:
60-
```
61-
aggregation = project.new_enc_aggregation()
62-
aggregation.preprocessing.one_hot_encoding(target_column='gender', prefix='', specified_types=['Male', 'Female'])
63-
```
64-
65-
Preprocessing operations can be applied to all nodes or specific nodes if the data format is different across nodes. This requires using the `nodes` argument, as follows:
66-
```
67-
aggregation.preprocessing.one_hot_encoding(target_column='gender', prefix='', specified_types=['Male', 'Female'], nodes=['Organization_A'])
68-
aggregation.preprocessing.one_hot_encoding(target_column='genre', prefix='', specified_types=['Male', 'Female'], nodes=['Organization_B'])
69-
aggregation.preprocessing.one_hot_encoding(target_column='genero', prefix='', specified_types=['Male', 'Female'], nodes=['Organization_C'])
70-
```
71-
72-
##### Select
73-
Select specified columns from data.
74-
```
75-
select(columns, create_if_missing, dummy_value, nodes)
76-
```
77-
* `columns` : list of column names to be selected (`List[str]`)
78-
* `create_if_missing` : whether to create the columns if they do not exist, default = False (`bool`)
79-
* `dummy_value` : what to fill the created columns with, default = "" (`str`)
80-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
81-
82-
##### One Hot Encoding
83-
Encodes a target column into one hot encoding and extends the table with these columns
84-
```
85-
one_hot_encoding(target_column, prefix, specified_types, nodes)
86-
```
87-
* `target_column` : name of column to convert to one-hot-encoding (`str`)
88-
* `prefix` : prefix string to prepend to one-hot column names (`str`)
89-
* `specified_types` : specified types to one-hot encode, if specified, then possible missing columns will be added (`List[str]`)
90-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
91-
92-
##### Filter
93-
Filters rows from the data under a given condition
94-
```
95-
filter(target_column, comparator, value, numerical, nodes)
96-
```
97-
* `target_column` : name of column to filter on (`str`)
98-
* `comparator` : type of comparison (`ComparisonType` enum)
99-
100-
* equal
101-
* nEqual
102-
* greater
103-
* greaterEq
104-
* less
105-
* lessEq
106-
* in
107-
108-
* `value` : value with which to compare (`str`)
109-
* `numerical` : whether the comparison is on numerical values, default = False (`bool`)
110-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
111-
112-
##### Counts
113-
Concatenates a new column containing 1 for each row in order to count the number of rows
114-
```
115-
counts(output_column_name, nodes)
116-
```
117-
* `output_column_name` : name of the column to store the counts. If not specified, the name 'count' will be used. (`str`)
118-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
119-
120-
##### Transpose
121-
Transpose index and columns
122-
```
123-
transpose(copy, nodes)
124-
```
125-
* `copy` : Whether to copy the data after transposing. default False (`bool`)
126-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
127-
128-
##### Set Index
129-
Set the DataFrame index using existing columns.
130-
```
131-
set_index(cols, drop, append, nodes)
132-
```
133-
* `columns` : list of column names to set as index (`List[str]`)
134-
* `drop` : Delete columns to be used as the new index. default True (`bool`)
135-
* `append` : Whether to append columns to existing index. default False (`bool`)
136-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
137-
138-
##### Reset Index
139-
Reset the index, or a level of it.
140-
```
141-
reset_index(level, drop, nodes)
142-
```
143-
* `level` : list of column names to remove from index (`List[str]`)
144-
* `drop` : Do not try to insert index into dataframe columns. This resets the index to the default integer index. default False (`bool`)
145-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
146-
147-
##### Rename
148-
Alter axes labels.
149-
```
150-
rename(mapper, axis, copy, errors, nodes)
151-
```
152-
* `mapper` : Dict of transformations to apply to that axis’ values. (`dict`)
153-
* `axis` : Axis to target with `mapper`. Should be the axis name (‘index’, ‘columns’). The default is ‘index’. (`RenameAxis`)
154-
* `copy` : Also copy underlying data. default True (`bool`)
155-
* `errors` : If True raise a KeyError when a dict-like mapper, index, or columns contains labels that are not present in the Index being transformed. If False existing keys will be renamed and extra keys will be ignored.(`bool`)
156-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
157-
158-
##### As Type
159-
Cast column types
160-
```
161-
astype(type_map, copy, errors, nodes)
162-
```
163-
* `mapper` : Dict which maps column names to dtypes. (`dict`)
164-
* `copy` : Return a copy. default True (`bool`)
165-
* `errors` : If True raise a KeyError when a dict-like mapper, index, or columns contains labels that are not present in the Index being transformed. If False existing keys will be renamed and extra keys will be ignored.(`bool`)
166-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
167-
168-
##### Extract Dict Field
169-
Extract field value from dict-like columns
170-
```
171-
extract(field, columns, names, nodes)
172-
```
173-
* `field` : dict field to extract (`str`)
174-
* `columns` : list of column names from which to extract field (`List[str]`)
175-
* `names`: names of resulting columns, if None, no new columns are created (`List[str]`)
176-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
177-
178-
For example given:
179-
| id | dict_col |
180-
| -- | -- |
181-
| 0 | { 'foo' : 3, 'bar' : 0.56} |
182-
| 1 | { 'foo' : 8, 'bar' : 0.22} |
183-
| 2 | { 'foo' : 5, 'bar' : 0.13} |
184-
185-
`extract(field='foo', columns=['dict_col'])` yields:
186-
| id | dict_col |
187-
| -- | -- |
188-
| 0 | 3 |
189-
| 1 | 8 |
190-
| 2 | 5 |
191-
192-
##### Apply RegEx
193-
Apply a RegEx mapping to columns
194-
```
195-
apply_regex(regex, columns, regex_type, names, nodes)
196-
```
197-
* `regex` : regular expression to apply (`str`)
198-
* `columns` : list of column names from which to extract field (`List[str]`)
199-
* `regex_type` : defines what we want to retrieve from the regex (`ApplyRegExType`)
200-
* `ApplyRegExType.MATCH` : return the first match
201-
* `ApplyRegExType.FINDALL`: return list of matching values
202-
* `ApplyRegExType.POSITION`: return position of first match
203-
* `names`: names of resulting columns, if None, no new columns are created (`List[str]`)
204-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
55+
## Documentation
56+
The complete documentation for Diapason is available [here](https://docs.tuneinsight.com/docs/python-sdk).
20557

20658

20759
## License

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "tuneinsight"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
description = "Diapason is the official Python SDK for the Tune Insight Agent API"
55
authors = ["Tune Insight SA"]
66
license = "Apache-2.0"

src/tuneinsight/README.md

Lines changed: 3 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Diapason is the Tune Insight Python SDK
77
### Installing
88

99
```bash
10-
pip install tuneinsight-0.1.0.tar.gz
10+
pip install tuneinsight-0.1.1.tar.gz
1111
```
1212

1313
## Usage
@@ -23,156 +23,8 @@ from tuneinsight.client.diapason import Diapason
2323
client = Diapason.from_config_path('conf.yml')
2424
```
2525

26-
### Features
27-
#### Computations
28-
#### Preprocessing
29-
Preprocessing operations should be defined in relation to a computation. The preprocessing when the computation is ran.
30-
For example:
31-
```
32-
aggregation = project.new_enc_aggregation()
33-
aggregation.preprocessing.one_hot_encoding(target_column='gender', prefix='', specified_types=['Male', 'Female'])
34-
```
35-
36-
Preprocessing operations can be applied to all nodes or specific nodes if the data format is different across nodes. This requires using the `nodes` argument, as follows:
37-
```
38-
aggregation.preprocessing.one_hot_encoding(target_column='gender', prefix='', specified_types=['Male', 'Female'], nodes=['Organization_A'])
39-
aggregation.preprocessing.one_hot_encoding(target_column='genre', prefix='', specified_types=['Male', 'Female'], nodes=['Organization_B'])
40-
aggregation.preprocessing.one_hot_encoding(target_column='genero', prefix='', specified_types=['Male', 'Female'], nodes=['Organization_C'])
41-
```
42-
43-
##### Select
44-
Select specified columns from data.
45-
```
46-
select(columns, create_if_missing, dummy_value, nodes)
47-
```
48-
* `columns` : list of column names to be selected (`List[str]`)
49-
* `create_if_missing` : whether to create the columns if they do not exist, default = False (`bool`)
50-
* `dummy_value` : what to fill the created columns with, default = "" (`str`)
51-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
52-
53-
##### One Hot Encoding
54-
Encodes a target column into one hot encoding and extends the table with these columns
55-
```
56-
one_hot_encoding(target_column, prefix, specified_types, nodes)
57-
```
58-
* `target_column` : name of column to convert to one-hot-encoding (`str`)
59-
* `prefix` : prefix string to prepend to one-hot column names (`str`)
60-
* `specified_types` : specified types to one-hot encode, if specified, then possible missing columns will be added (`List[str]`)
61-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
62-
63-
##### Filter
64-
Filters rows from the data under a given condition
65-
```
66-
filter(target_column, comparator, value, numerical, nodes)
67-
```
68-
* `target_column` : name of column to filter on (`str`)
69-
* `comparator` : type of comparison (`ComparisonType` enum)
70-
71-
* equal
72-
* nEqual
73-
* greater
74-
* greaterEq
75-
* less
76-
* lessEq
77-
* in
78-
79-
* `value` : value with which to compare (`str`)
80-
* `numerical` : whether the comparison is on numerical values, default = False (`bool`)
81-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
82-
83-
##### Counts
84-
Concatenates a new column containing 1 for each row in order to count the number of rows
85-
```
86-
counts(output_column_name, nodes)
87-
```
88-
* `output_column_name` : name of the column to store the counts. If not specified, the name 'count' will be used. (`str`)
89-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
90-
91-
##### Transpose
92-
Transpose index and columns
93-
```
94-
transpose(copy, nodes)
95-
```
96-
* `copy` : Whether to copy the data after transposing. default False (`bool`)
97-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
98-
99-
##### Set Index
100-
Set the DataFrame index using existing columns.
101-
```
102-
set_index(cols, drop, append, nodes)
103-
```
104-
* `columns` : list of column names to set as index (`List[str]`)
105-
* `drop` : Delete columns to be used as the new index. default True (`bool`)
106-
* `append` : Whether to append columns to existing index. default False (`bool`)
107-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
108-
109-
##### Reset Index
110-
Reset the index, or a level of it.
111-
```
112-
reset_index(level, drop, nodes)
113-
```
114-
* `level` : list of column names to remove from index (`List[str]`)
115-
* `drop` : Do not try to insert index into dataframe columns. This resets the index to the default integer index. default False (`bool`)
116-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
117-
118-
##### Rename
119-
Alter axes labels.
120-
```
121-
rename(mapper, axis, copy, errors, nodes)
122-
```
123-
* `mapper` : Dict of transformations to apply to that axis’ values. (`dict`)
124-
* `axis` : Axis to target with `mapper`. Should be the axis name (‘index’, ‘columns’). The default is ‘index’. (`RenameAxis`)
125-
* `copy` : Also copy underlying data. default True (`bool`)
126-
* `errors` : If True raise a KeyError when a dict-like mapper, index, or columns contains labels that are not present in the Index being transformed. If False existing keys will be renamed and extra keys will be ignored.(`bool`)
127-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
128-
129-
##### As Type
130-
Cast column types
131-
```
132-
astype(type_map, copy, errors, nodes)
133-
```
134-
* `mapper` : Dict which maps column names to dtypes. (`dict`)
135-
* `copy` : Return a copy. default True (`bool`)
136-
* `errors` : If True raise a KeyError when a dict-like mapper, index, or columns contains labels that are not present in the Index being transformed. If False existing keys will be renamed and extra keys will be ignored.(`bool`)
137-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
138-
139-
##### Extract Dict Field
140-
Extract field value from dict-like columns
141-
```
142-
extract(field, columns, names, nodes)
143-
```
144-
* `field` : dict field to extract (`str`)
145-
* `columns` : list of column names from which to extract field (`List[str]`)
146-
* `names`: names of resulting columns, if None, no new columns are created (`List[str]`)
147-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
148-
149-
For example given:
150-
| id | dict_col |
151-
| -- | -- |
152-
| 0 | { 'foo' : 3, 'bar' : 0.56} |
153-
| 1 | { 'foo' : 8, 'bar' : 0.22} |
154-
| 2 | { 'foo' : 5, 'bar' : 0.13} |
155-
156-
`extract(field='foo', columns=['dict_col'])` yields:
157-
| id | dict_col |
158-
| -- | -- |
159-
| 0 | 3 |
160-
| 1 | 8 |
161-
| 2 | 5 |
162-
163-
##### Apply RegEx
164-
Apply a RegEx mapping to columns
165-
```
166-
apply_regex(regex, columns, regex_type, names, nodes)
167-
```
168-
* `regex` : regular expression to apply (`str`)
169-
* `columns` : list of column names from which to extract field (`List[str]`)
170-
* `regex_type` : defines what we want to retrieve from the regex (`ApplyRegExType`)
171-
* `ApplyRegExType.MATCH` : return the first match
172-
* `ApplyRegExType.FINDALL`: return list of matching values
173-
* `ApplyRegExType.POSITION`: return position of first match
174-
* `names`: names of resulting columns, if None, no new columns are created (`List[str]`)
175-
* `nodes` : which nodes to apply the preprocessing operation to, if `None` it will apply to all (`List[str]`)
26+
## Documentation
27+
The complete documentation for Diapason is available [here](https://docs.tuneinsight.com/docs/python-sdk).
17628

17729

17830
## License
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
11
""" A client library for accessing GeCo REST API """
22
from .client import AuthenticatedClient, Client
3-
4-
__all__ = (
5-
"AuthenticatedClient",
6-
"Client",
7-
)

0 commit comments

Comments
 (0)