Skip to main content

Utility functions for BAAR developers

Project description

Baarutil

This Custom Library is specifically created for the developers/users who use BAAR. Which is a product of Allied Media Inc.

Authors:

Souvik Roy sroy-2019

Zhaoyu (Thomas) Xu xuzhaoyu

Additional Info:

The string structure that follows is a streamline structure that the developers/users follow throughout an automation workflow designed in BAAR:

"Column_1__=__abc__$$__Column_2__=__def__::__Column_1__=__hello__$$__Column_2__=__world"

Available functions and the examples are listed below:

1. read_convert(string), Output Data Type: list of dictionary

Attributes:

i. string: Input String, Data Type = String

Input:  "Column_1__=__abc__$$__Column_2__=__def__::__Column_1__=__hello__$$__Column_2__=__world"
Output: [{"Column_1":"abc", "Column_2":"def"}, {"Column_1":"hello", "Column_2":"world"}]

2. write_convert(input_list), Output Data Type: string

Attributes:

i. input_list: List that contains the Dictionaries of Data, Data Type = List

Input:  [{"Column_1":"abc", "Column_2":"def"}, {"Column_1":"hello", "Column_2":"world"}]
Output: "Column_1__=__abc__$$__Column_2__=__def__::__Column_1__=__hello__$$__Column_2__=__world"

3. string_to_df(string, rename_cols, drop_dupes), Output Data Type: pandas DataFrame

Attributes:

i. string: Input String, Data Type = String

ii. rename_cols: Dictionary that contains old column names and new column names mapping, Data Type = Dictionary, Default Value = {}

iii. drop_dupes: Drop duplicate rows from the final dataframe, Data Type = Bool, Default Value = False

Input:  "Column_1__=__abc__$$__Column_2__=__def__::__Column_1__=__hello__$$__Column_2__=__world"

Output:

Column_1 Column_2
abc def
hello world

4. df_to_string(input_df, rename_cols, drop_dupes), Output Data Type: string

Attributes:

i. input_df: Input DataFrame, Data Type = pandas DataFrame

ii. rename_cols: Dictionary that contains old column names and new column names mapping, Data Type = Dictionary, Default Value = {}

iii. drop_dupes: Drop duplicate rows from the final dataframe, Data Type = Bool, Default Value = False

Input:

Column_1 Column_2
abc def
hello world
Output: "Column_1__=__abc__$$__Column_2__=__def__::__Column_1__=__hello__$$__Column_2__=__world"

5. df_to_listdict(input_df, rename_cols, drop_dupes), Output Data Type: list

Attributes:

i. input_df: Input DataFrame, Data Type = pandas DataFrame

ii. rename_cols: Dictionary that contains old column names and new column names mapping, Data Type = Dictionary, Default Value = {}

iii. drop_dupes: Drop duplicate rows from the final dataframe, Data Type = Bool, Default Value = False

Input:

Column_1 Column_2
abc def
hello world
Output: [{"Column_1":"abc", "Column_2":"def"}, {"Column_1":"hello", "Column_2":"world"}]

6. decrypt_vault(encrypted_message, config_file), Output Data Type: string

Attributes:

i. encrypted_message: Encrypted Baar Vault Data, Data Type = string

ii. config_file: Keys, that needs to be provided by Allied Media.

This function can also be called from a Robot Framework Script by importing the baarutil library and using Decrypt Vault keyword. Upon initiation of this fuction, this will set the Log Level of the Robot Framework script to NONE for security reasons. The Developers have to use Set Log Level INFO in the robot script in order to restart the Log.

Input:  <<Encrypted Text>>
Output: <<Decrypted Text>>

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

baarutil-1.2.5.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file baarutil-1.2.5.tar.gz.

File metadata

  • Download URL: baarutil-1.2.5.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.6.8

File hashes

Hashes for baarutil-1.2.5.tar.gz
Algorithm Hash digest
SHA256 842b9c80a4934caedd7c328772565814414fc11c2afcd0e4315e03c7a1fa3f59
MD5 f670729f0551fc2733c1bfa56b26d10a
BLAKE2b-256 f6016fdb51175b09ccaff5ea666aa759afcb29a8b5f05fc3132ad6f065f7b6cd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page