play_helpers package

Subpackages

Submodules

play_helpers.ph_bits module

class play_helpers.ph_bits.PhBits(int_value=None, bit_indexes=None)

Bases: object

Python integer size is four bytes; 32 Bits

MAX_BIT_INDEX = 32
MIN_BIT_INDEX = 1
__init__(int_value=None, bit_indexes=None)
find_index_kth_set_bit(k)
is_bit_set(bit_index)
reset_all_bits()
set_bits(bit_indexes)

play_helpers.ph_colors module

class play_helpers.ph_colors.PhColors

Bases: object

ALICEBLUE = (240, 248, 255)
ANTIQUEWHITE = (250, 235, 215)
ANTIQUEWHITE1 = (255, 239, 219)
ANTIQUEWHITE2 = (238, 223, 204)
ANTIQUEWHITE3 = (205, 192, 176)
ANTIQUEWHITE4 = (139, 131, 120)
AQUA = (0, 255, 255)
AQUAMARINE1 = (127, 255, 212)
AQUAMARINE2 = (118, 238, 198)
AQUAMARINE3 = (102, 205, 170)
AQUAMARINE4 = (69, 139, 116)
AZURE1 = (240, 255, 255)
AZURE2 = (224, 238, 238)
AZURE3 = (193, 205, 205)
AZURE4 = (131, 139, 139)
BANANA = (227, 207, 87)
BEIGE = (245, 245, 220)
BISQUE1 = (255, 228, 196)
BISQUE2 = (238, 213, 183)
BISQUE3 = (205, 183, 158)
BISQUE4 = (139, 125, 107)
BLACK = (0, 0, 0)
BLANCHEDALMOND = (255, 235, 205)
BLUE = (0, 0, 255)
BLUE2 = (0, 0, 238)
BLUE3 = (0, 0, 205)
BLUE4 = (0, 0, 139)
BLUEVIOLET = (138, 43, 226)
BRICK = (156, 102, 31)
BROWN = (165, 42, 42)
BROWN1 = (255, 64, 64)
BROWN2 = (238, 59, 59)
BROWN3 = (205, 51, 51)
BROWN4 = (139, 35, 35)
BURLYWOOD = (222, 184, 135)
BURLYWOOD1 = (255, 211, 155)
BURLYWOOD2 = (238, 197, 145)
BURLYWOOD3 = (205, 170, 125)
BURLYWOOD4 = (139, 115, 85)
BURNTSIENNA = (138, 54, 15)
BURNTUMBER = (138, 51, 36)
CADETBLUE = (95, 158, 160)
CADETBLUE1 = (152, 245, 255)
CADETBLUE2 = (142, 229, 238)
CADETBLUE3 = (122, 197, 205)
CADETBLUE4 = (83, 134, 139)
CADMIUMORANGE = (255, 97, 3)
CADMIUMYELLOW = (255, 153, 18)
CARROT = (237, 145, 33)
CHARTREUSE1 = (127, 255, 0)
CHARTREUSE2 = (118, 238, 0)
CHARTREUSE3 = (102, 205, 0)
CHARTREUSE4 = (69, 139, 0)
CHOCOLATE = (210, 105, 30)
CHOCOLATE1 = (255, 127, 36)
CHOCOLATE2 = (238, 118, 33)
CHOCOLATE3 = (205, 102, 29)
CHOCOLATE4 = (139, 69, 19)
COBALT = (61, 89, 171)
COBALTGREEN = (61, 145, 64)
COLDGREY = (128, 138, 135)
CORAL = (255, 127, 80)
CORAL1 = (255, 114, 86)
CORAL2 = (238, 106, 80)
CORAL3 = (205, 91, 69)
CORAL4 = (139, 62, 47)
CORNFLOWERBLUE = (100, 149, 237)
CORNSILK1 = (255, 248, 220)
CORNSILK2 = (238, 232, 205)
CORNSILK3 = (205, 200, 177)
CORNSILK4 = (139, 136, 120)
CRIMSON = (220, 20, 60)
CYAN2 = (0, 238, 238)
CYAN3 = (0, 205, 205)
CYAN4 = (0, 139, 139)
DARKGOLDENROD = (184, 134, 11)
DARKGOLDENROD1 = (255, 185, 15)
DARKGOLDENROD2 = (238, 173, 14)
DARKGOLDENROD3 = (205, 149, 12)
DARKGOLDENROD4 = (139, 101, 8)
DARKGRAY = (169, 169, 169)
DARKGREEN = (0, 100, 0)
DARKKHAKI = (189, 183, 107)
DARKOLIVEGREEN = (85, 107, 47)
DARKOLIVEGREEN1 = (202, 255, 112)
DARKOLIVEGREEN2 = (188, 238, 104)
DARKOLIVEGREEN3 = (162, 205, 90)
DARKOLIVEGREEN4 = (110, 139, 61)
DARKORANGE = (255, 140, 0)
DARKORANGE1 = (255, 127, 0)
DARKORANGE2 = (238, 118, 0)
DARKORANGE3 = (205, 102, 0)
DARKORANGE4 = (139, 69, 0)
DARKORCHID = (153, 50, 204)
DARKORCHID1 = (191, 62, 255)
DARKORCHID2 = (178, 58, 238)
DARKORCHID3 = (154, 50, 205)
DARKORCHID4 = (104, 34, 139)
DARKSALMON = (233, 150, 122)
DARKSEAGREEN = (143, 188, 143)
DARKSEAGREEN1 = (193, 255, 193)
DARKSEAGREEN2 = (180, 238, 180)
DARKSEAGREEN3 = (155, 205, 155)
DARKSEAGREEN4 = (105, 139, 105)
DARKSLATEBLUE = (72, 61, 139)
DARKSLATEGRAY = (47, 79, 79)
DARKSLATEGRAY1 = (151, 255, 255)
DARKSLATEGRAY2 = (141, 238, 238)
DARKSLATEGRAY3 = (121, 205, 205)
DARKSLATEGRAY4 = (82, 139, 139)
DARKTURQUOISE = (0, 206, 209)
DARKVIOLET = (148, 0, 211)
DEEPPINK1 = (255, 20, 147)
DEEPPINK2 = (238, 18, 137)
DEEPPINK3 = (205, 16, 118)
DEEPPINK4 = (139, 10, 80)
DEEPSKYBLUE1 = (0, 191, 255)
DEEPSKYBLUE2 = (0, 178, 238)
DEEPSKYBLUE3 = (0, 154, 205)
DEEPSKYBLUE4 = (0, 104, 139)
DIMGRAY = (105, 105, 105)
DODGERBLUE1 = (30, 144, 255)
DODGERBLUE2 = (28, 134, 238)
DODGERBLUE3 = (24, 116, 205)
DODGERBLUE4 = (16, 78, 139)
EGGSHELL = (252, 230, 201)
EMERALDGREEN = (0, 201, 87)
FIREBRICK = (178, 34, 34)
FIREBRICK1 = (255, 48, 48)
FIREBRICK2 = (238, 44, 44)
FIREBRICK3 = (205, 38, 38)
FIREBRICK4 = (139, 26, 26)
FLESH = (255, 125, 64)
FLORALWHITE = (255, 250, 240)
FORESTGREEN = (34, 139, 34)
GAINSBORO = (220, 220, 220)
GHOSTWHITE = (248, 248, 255)
GOLD1 = (255, 215, 0)
GOLD2 = (238, 201, 0)
GOLD3 = (205, 173, 0)
GOLD4 = (139, 117, 0)
GOLDENROD = (218, 165, 32)
GOLDENROD1 = (255, 193, 37)
GOLDENROD2 = (238, 180, 34)
GOLDENROD3 = (205, 155, 29)
GOLDENROD4 = (139, 105, 20)
GRAY = (128, 128, 128)
GRAY1 = (3, 3, 3)
GRAY10 = (26, 26, 26)
GRAY11 = (28, 28, 28)
GRAY12 = (31, 31, 31)
GRAY13 = (33, 33, 33)
GRAY14 = (36, 36, 36)
GRAY15 = (38, 38, 38)
GRAY16 = (41, 41, 41)
GRAY17 = (43, 43, 43)
GRAY18 = (46, 46, 46)
GRAY19 = (48, 48, 48)
GRAY2 = (5, 5, 5)
GRAY20 = (51, 51, 51)
GRAY21 = (54, 54, 54)
GRAY22 = (56, 56, 56)
GRAY23 = (59, 59, 59)
GRAY24 = (61, 61, 61)
GRAY25 = (64, 64, 64)
GRAY26 = (66, 66, 66)
GRAY27 = (69, 69, 69)
GRAY28 = (71, 71, 71)
GRAY29 = (74, 74, 74)
GRAY3 = (8, 8, 8)
GRAY30 = (77, 77, 77)
GRAY31 = (79, 79, 79)
GRAY32 = (82, 82, 82)
GRAY33 = (84, 84, 84)
GRAY34 = (87, 87, 87)
GRAY35 = (89, 89, 89)
GRAY36 = (92, 92, 92)
GRAY37 = (94, 94, 94)
GRAY38 = (97, 97, 97)
GRAY39 = (99, 99, 99)
GRAY4 = (10, 10, 10)
GRAY40 = (102, 102, 102)
GRAY42 = (107, 107, 107)
GRAY43 = (110, 110, 110)
GRAY44 = (112, 112, 112)
GRAY45 = (115, 115, 115)
GRAY46 = (117, 117, 117)
GRAY47 = (120, 120, 120)
GRAY48 = (122, 122, 122)
GRAY49 = (125, 125, 125)
GRAY5 = (13, 13, 13)
GRAY50 = (127, 127, 127)
GRAY51 = (130, 130, 130)
GRAY52 = (133, 133, 133)
GRAY53 = (135, 135, 135)
GRAY54 = (138, 138, 138)
GRAY55 = (140, 140, 140)
GRAY56 = (143, 143, 143)
GRAY57 = (145, 145, 145)
GRAY58 = (148, 148, 148)
GRAY59 = (150, 150, 150)
GRAY6 = (15, 15, 15)
GRAY60 = (153, 153, 153)
GRAY61 = (156, 156, 156)
GRAY62 = (158, 158, 158)
GRAY63 = (161, 161, 161)
GRAY64 = (163, 163, 163)
GRAY65 = (166, 166, 166)
GRAY66 = (168, 168, 168)
GRAY67 = (171, 171, 171)
GRAY68 = (173, 173, 173)
GRAY69 = (176, 176, 176)
GRAY7 = (18, 18, 18)
GRAY70 = (179, 179, 179)
GRAY71 = (181, 181, 181)
GRAY72 = (184, 184, 184)
GRAY73 = (186, 186, 186)
GRAY74 = (189, 189, 189)
GRAY75 = (191, 191, 191)
GRAY76 = (194, 194, 194)
GRAY77 = (196, 196, 196)
GRAY78 = (199, 199, 199)
GRAY79 = (201, 201, 201)
GRAY8 = (20, 20, 20)
GRAY80 = (204, 204, 204)
GRAY81 = (207, 207, 207)
GRAY82 = (209, 209, 209)
GRAY83 = (212, 212, 212)
GRAY84 = (214, 214, 214)
GRAY85 = (217, 217, 217)
GRAY86 = (219, 219, 219)
GRAY87 = (222, 222, 222)
GRAY88 = (224, 224, 224)
GRAY89 = (227, 227, 227)
GRAY9 = (23, 23, 23)
GRAY90 = (229, 229, 229)
GRAY91 = (232, 232, 232)
GRAY92 = (235, 235, 235)
GRAY93 = (237, 237, 237)
GRAY94 = (240, 240, 240)
GRAY95 = (242, 242, 242)
GRAY97 = (247, 247, 247)
GRAY98 = (250, 250, 250)
GRAY99 = (252, 252, 252)
GREEN = (0, 128, 0)
GREEN1 = (0, 255, 0)
GREEN2 = (0, 238, 0)
GREEN3 = (0, 205, 0)
GREEN4 = (0, 139, 0)
GREENYELLOW = (173, 255, 47)
HONEYDEW1 = (240, 255, 240)
HONEYDEW2 = (224, 238, 224)
HONEYDEW3 = (193, 205, 193)
HONEYDEW4 = (131, 139, 131)
HOTPINK = (255, 105, 180)
HOTPINK1 = (255, 110, 180)
HOTPINK2 = (238, 106, 167)
HOTPINK3 = (205, 96, 144)
HOTPINK4 = (139, 58, 98)
INDIANRED = (205, 92, 92)
INDIANRED1 = (255, 106, 106)
INDIANRED2 = (238, 99, 99)
INDIANRED3 = (205, 85, 85)
INDIANRED4 = (139, 58, 58)
INDIGO = (75, 0, 130)
IVORY1 = (255, 255, 240)
IVORY2 = (238, 238, 224)
IVORY3 = (205, 205, 193)
IVORY4 = (139, 139, 131)
IVORYBLACK = (41, 36, 33)
KHAKI = (240, 230, 140)
KHAKI1 = (255, 246, 143)
KHAKI2 = (238, 230, 133)
KHAKI3 = (205, 198, 115)
KHAKI4 = (139, 134, 78)
LAVENDER = (230, 230, 250)
LAVENDERBLUSH1 = (255, 240, 245)
LAVENDERBLUSH2 = (238, 224, 229)
LAVENDERBLUSH3 = (205, 193, 197)
LAVENDERBLUSH4 = (139, 131, 134)
LAWNGREEN = (124, 252, 0)
LEMONCHIFFON1 = (255, 250, 205)
LEMONCHIFFON2 = (238, 233, 191)
LEMONCHIFFON3 = (205, 201, 165)
LEMONCHIFFON4 = (139, 137, 112)
LIGHTBLUE = (173, 216, 230)
LIGHTBLUE1 = (191, 239, 255)
LIGHTBLUE2 = (178, 223, 238)
LIGHTBLUE3 = (154, 192, 205)
LIGHTBLUE4 = (104, 131, 139)
LIGHTCORAL = (240, 128, 128)
LIGHTCYAN1 = (224, 255, 255)
LIGHTCYAN2 = (209, 238, 238)
LIGHTCYAN3 = (180, 205, 205)
LIGHTCYAN4 = (122, 139, 139)
LIGHTGOLDENROD1 = (255, 236, 139)
LIGHTGOLDENROD2 = (238, 220, 130)
LIGHTGOLDENROD3 = (205, 190, 112)
LIGHTGOLDENROD4 = (139, 129, 76)
LIGHTGOLDENRODYELLOW = (250, 250, 210)
LIGHTGREY = (211, 211, 211)
LIGHTPINK = (255, 182, 193)
LIGHTPINK1 = (255, 174, 185)
LIGHTPINK2 = (238, 162, 173)
LIGHTPINK3 = (205, 140, 149)
LIGHTPINK4 = (139, 95, 101)
LIGHTSALMON1 = (255, 160, 122)
LIGHTSALMON2 = (238, 149, 114)
LIGHTSALMON3 = (205, 129, 98)
LIGHTSALMON4 = (139, 87, 66)
LIGHTSEAGREEN = (32, 178, 170)
LIGHTSKYBLUE = (135, 206, 250)
LIGHTSKYBLUE1 = (176, 226, 255)
LIGHTSKYBLUE2 = (164, 211, 238)
LIGHTSKYBLUE3 = (141, 182, 205)
LIGHTSKYBLUE4 = (96, 123, 139)
LIGHTSLATEBLUE = (132, 112, 255)
LIGHTSLATEGRAY = (119, 136, 153)
LIGHTSTEELBLUE = (176, 196, 222)
LIGHTSTEELBLUE1 = (202, 225, 255)
LIGHTSTEELBLUE2 = (188, 210, 238)
LIGHTSTEELBLUE3 = (162, 181, 205)
LIGHTSTEELBLUE4 = (110, 123, 139)
LIGHTYELLOW1 = (255, 255, 224)
LIGHTYELLOW2 = (238, 238, 209)
LIGHTYELLOW3 = (205, 205, 180)
LIGHTYELLOW4 = (139, 139, 122)
LIMEGREEN = (50, 205, 50)
LINEN = (250, 240, 230)
MAGENTA = (255, 0, 255)
MAGENTA2 = (238, 0, 238)
MAGENTA3 = (205, 0, 205)
MAGENTA4 = (139, 0, 139)
MANGANESEBLUE = (3, 168, 158)
MAROON = (128, 0, 0)
MAROON1 = (255, 52, 179)
MAROON2 = (238, 48, 167)
MAROON3 = (205, 41, 144)
MAROON4 = (139, 28, 98)
MEDIUMORCHID = (186, 85, 211)
MEDIUMORCHID1 = (224, 102, 255)
MEDIUMORCHID2 = (209, 95, 238)
MEDIUMORCHID3 = (180, 82, 205)
MEDIUMORCHID4 = (122, 55, 139)
MEDIUMPURPLE = (147, 112, 219)
MEDIUMPURPLE1 = (171, 130, 255)
MEDIUMPURPLE2 = (159, 121, 238)
MEDIUMPURPLE3 = (137, 104, 205)
MEDIUMPURPLE4 = (93, 71, 139)
MEDIUMSEAGREEN = (60, 179, 113)
MEDIUMSLATEBLUE = (123, 104, 238)
MEDIUMSPRINGGREEN = (0, 250, 154)
MEDIUMTURQUOISE = (72, 209, 204)
MEDIUMVIOLETRED = (199, 21, 133)
MELON = (227, 168, 105)
MIDNIGHTBLUE = (25, 25, 112)
MINT = (189, 252, 201)
MINTCREAM = (245, 255, 250)
MISTYROSE1 = (255, 228, 225)
MISTYROSE2 = (238, 213, 210)
MISTYROSE3 = (205, 183, 181)
MISTYROSE4 = (139, 125, 123)
MOCCASIN = (255, 228, 181)
NAVAJOWHITE1 = (255, 222, 173)
NAVAJOWHITE2 = (238, 207, 161)
NAVAJOWHITE3 = (205, 179, 139)
NAVAJOWHITE4 = (139, 121, 94)
NAVY = (0, 0, 128)
OLDLACE = (253, 245, 230)
OLIVE = (128, 128, 0)
OLIVEDRAB = (107, 142, 35)
OLIVEDRAB1 = (192, 255, 62)
OLIVEDRAB2 = (179, 238, 58)
OLIVEDRAB3 = (154, 205, 50)
OLIVEDRAB4 = (105, 139, 34)
ORANGE = (255, 128, 0)
ORANGE1 = (255, 165, 0)
ORANGE2 = (238, 154, 0)
ORANGE3 = (205, 133, 0)
ORANGE4 = (139, 90, 0)
ORANGERED1 = (255, 69, 0)
ORANGERED2 = (238, 64, 0)
ORANGERED3 = (205, 55, 0)
ORANGERED4 = (139, 37, 0)
ORCHID = (218, 112, 214)
ORCHID1 = (255, 131, 250)
ORCHID2 = (238, 122, 233)
ORCHID3 = (205, 105, 201)
ORCHID4 = (139, 71, 137)
PALEGOLDENROD = (238, 232, 170)
PALEGREEN = (152, 251, 152)
PALEGREEN1 = (154, 255, 154)
PALEGREEN2 = (144, 238, 144)
PALEGREEN3 = (124, 205, 124)
PALEGREEN4 = (84, 139, 84)
PALETURQUOISE1 = (187, 255, 255)
PALETURQUOISE2 = (174, 238, 238)
PALETURQUOISE3 = (150, 205, 205)
PALETURQUOISE4 = (102, 139, 139)
PALEVIOLETRED = (219, 112, 147)
PALEVIOLETRED1 = (255, 130, 171)
PALEVIOLETRED2 = (238, 121, 159)
PALEVIOLETRED3 = (205, 104, 137)
PALEVIOLETRED4 = (139, 71, 93)
PAPAYAWHIP = (255, 239, 213)
PEACHPUFF1 = (255, 218, 185)
PEACHPUFF2 = (238, 203, 173)
PEACHPUFF3 = (205, 175, 149)
PEACHPUFF4 = (139, 119, 101)
PEACOCK = (51, 161, 201)
PINK = (255, 192, 203)
PINK1 = (255, 181, 197)
PINK2 = (238, 169, 184)
PINK3 = (205, 145, 158)
PINK4 = (139, 99, 108)
PLUM = (221, 160, 221)
PLUM1 = (255, 187, 255)
PLUM2 = (238, 174, 238)
PLUM3 = (205, 150, 205)
PLUM4 = (139, 102, 139)
POWDERBLUE = (176, 224, 230)
PURPLE = (128, 0, 128)
PURPLE1 = (155, 48, 255)
PURPLE2 = (145, 44, 238)
PURPLE3 = (125, 38, 205)
PURPLE4 = (85, 26, 139)
RASPBERRY = (135, 38, 87)
RAWSIENNA = (199, 97, 20)
RED = (255, 0, 0)
RED1 = (255, 0, 0)
RED2 = (238, 0, 0)
RED3 = (205, 0, 0)
RED4 = (139, 0, 0)
ROSYBROWN = (188, 143, 143)
ROSYBROWN1 = (255, 193, 193)
ROSYBROWN2 = (238, 180, 180)
ROSYBROWN3 = (205, 155, 155)
ROSYBROWN4 = (139, 105, 105)
ROYALBLUE = (65, 105, 225)
ROYALBLUE1 = (72, 118, 255)
ROYALBLUE2 = (67, 110, 238)
ROYALBLUE3 = (58, 95, 205)
ROYALBLUE4 = (39, 64, 139)
SALMON = (250, 128, 114)
SALMON1 = (255, 140, 105)
SALMON2 = (238, 130, 98)
SALMON3 = (205, 112, 84)
SALMON4 = (139, 76, 57)
SANDYBROWN = (244, 164, 96)
SAPGREEN = (48, 128, 20)
SEAGREEN1 = (84, 255, 159)
SEAGREEN2 = (78, 238, 148)
SEAGREEN3 = (67, 205, 128)
SEAGREEN4 = (46, 139, 87)
SEASHELL1 = (255, 245, 238)
SEASHELL2 = (238, 229, 222)
SEASHELL3 = (205, 197, 191)
SEASHELL4 = (139, 134, 130)
SEPIA = (94, 38, 18)
SGIBEET = (142, 56, 142)
SGIBRIGHTGRAY = (197, 193, 170)
SGICHARTREUSE = (113, 198, 113)
SGIDARKGRAY = (85, 85, 85)
SGIGRAY12 = (30, 30, 30)
SGIGRAY16 = (40, 40, 40)
SGIGRAY32 = (81, 81, 81)
SGIGRAY36 = (91, 91, 91)
SGIGRAY52 = (132, 132, 132)
SGIGRAY56 = (142, 142, 142)
SGIGRAY72 = (183, 183, 183)
SGIGRAY76 = (193, 193, 193)
SGIGRAY92 = (234, 234, 234)
SGIGRAY96 = (244, 244, 244)
SGILIGHTBLUE = (125, 158, 192)
SGILIGHTGRAY = (170, 170, 170)
SGIOLIVEDRAB = (142, 142, 56)
SGISALMON = (198, 113, 113)
SGISLATEBLUE = (113, 113, 198)
SGITEAL = (56, 142, 142)
SIENNA = (160, 82, 45)
SIENNA1 = (255, 130, 71)
SIENNA2 = (238, 121, 66)
SIENNA3 = (205, 104, 57)
SIENNA4 = (139, 71, 38)
SILVER = (192, 192, 192)
SKYBLUE = (135, 206, 235)
SKYBLUE1 = (135, 206, 255)
SKYBLUE2 = (126, 192, 238)
SKYBLUE3 = (108, 166, 205)
SKYBLUE4 = (74, 112, 139)
SLATEBLUE = (106, 90, 205)
SLATEBLUE1 = (131, 111, 255)
SLATEBLUE2 = (122, 103, 238)
SLATEBLUE3 = (105, 89, 205)
SLATEBLUE4 = (71, 60, 139)
SLATEGRAY = (112, 128, 144)
SLATEGRAY1 = (198, 226, 255)
SLATEGRAY2 = (185, 211, 238)
SLATEGRAY3 = (159, 182, 205)
SLATEGRAY4 = (108, 123, 139)
SNOW1 = (255, 250, 250)
SNOW2 = (238, 233, 233)
SNOW3 = (205, 201, 201)
SNOW4 = (139, 137, 137)
SPRINGGREEN = (0, 255, 127)
SPRINGGREEN1 = (0, 238, 118)
SPRINGGREEN2 = (0, 205, 102)
SPRINGGREEN3 = (0, 139, 69)
STEELBLUE = (70, 130, 180)
STEELBLUE1 = (99, 184, 255)
STEELBLUE2 = (92, 172, 238)
STEELBLUE3 = (79, 148, 205)
STEELBLUE4 = (54, 100, 139)
TAN = (210, 180, 140)
TAN1 = (255, 165, 79)
TAN2 = (238, 154, 73)
TAN3 = (205, 133, 63)
TAN4 = (139, 90, 43)
TEAL = (0, 128, 128)
THISTLE = (216, 191, 216)
THISTLE1 = (255, 225, 255)
THISTLE2 = (238, 210, 238)
THISTLE3 = (205, 181, 205)
THISTLE4 = (139, 123, 139)
TOMATO1 = (255, 99, 71)
TOMATO2 = (238, 92, 66)
TOMATO3 = (205, 79, 57)
TOMATO4 = (139, 54, 38)
TURQUOISE = (64, 224, 208)
TURQUOISE1 = (0, 245, 255)
TURQUOISE2 = (0, 229, 238)
TURQUOISE3 = (0, 197, 205)
TURQUOISE4 = (0, 134, 139)
TURQUOISEBLUE = (0, 199, 140)
VIOLET = (238, 130, 238)
VIOLETRED = (208, 32, 144)
VIOLETRED1 = (255, 62, 150)
VIOLETRED2 = (238, 58, 140)
VIOLETRED3 = (205, 50, 120)
VIOLETRED4 = (139, 34, 82)
WARMGREY = (128, 128, 105)
WHEAT = (245, 222, 179)
WHEAT1 = (255, 231, 186)
WHEAT2 = (238, 216, 174)
WHEAT3 = (205, 186, 150)
WHEAT4 = (139, 126, 102)
WHITE = (255, 255, 255)
WHITESMOKE = (245, 245, 245)
YELLOW1 = (255, 255, 0)
YELLOW2 = (238, 238, 0)
YELLOW3 = (205, 205, 0)
YELLOW4 = (139, 139, 0)

Add colors to colors dictionary

colors = {'aliceblue': (240, 248, 255), 'antiquewhite': (250, 235, 215), 'antiquewhite1': (255, 239, 219), 'antiquewhite2': (238, 223, 204), 'antiquewhite3': (205, 192, 176), 'antiquewhite4': (139, 131, 120), 'aqua': (0, 255, 255), 'aquamarine1': (127, 255, 212), 'aquamarine2': (118, 238, 198), 'aquamarine3': (102, 205, 170), 'aquamarine4': (69, 139, 116), 'azure1': (240, 255, 255), 'azure2': (224, 238, 238), 'azure3': (193, 205, 205), 'azure4': (131, 139, 139), 'banana': (227, 207, 87), 'beige': (245, 245, 220), 'bisque1': (255, 228, 196), 'bisque2': (238, 213, 183), 'bisque3': (205, 183, 158), 'bisque4': (139, 125, 107), 'black': (0, 0, 0), 'blanchedalmond': (255, 235, 205), 'blue': (0, 0, 255), 'blue2': (0, 0, 238), 'blue3': (0, 0, 205), 'blue4': (0, 0, 139), 'blueviolet': (138, 43, 226), 'brick': (156, 102, 31), 'brown': (165, 42, 42), 'brown1': (255, 64, 64), 'brown2': (238, 59, 59), 'brown3': (205, 51, 51), 'brown4': (139, 35, 35), 'burlywood': (222, 184, 135), 'burlywood1': (255, 211, 155), 'burlywood2': (238, 197, 145), 'burlywood3': (205, 170, 125), 'burlywood4': (139, 115, 85), 'burntsienna': (138, 54, 15), 'burntumber': (138, 51, 36), 'cadetblue': (95, 158, 160), 'cadetblue1': (152, 245, 255), 'cadetblue2': (142, 229, 238), 'cadetblue3': (122, 197, 205), 'cadetblue4': (83, 134, 139), 'cadmiumorange': (255, 97, 3), 'cadmiumyellow': (255, 153, 18), 'carrot': (237, 145, 33), 'chartreuse1': (127, 255, 0), 'chartreuse2': (118, 238, 0), 'chartreuse3': (102, 205, 0), 'chartreuse4': (69, 139, 0), 'chocolate': (210, 105, 30), 'chocolate1': (255, 127, 36), 'chocolate2': (238, 118, 33), 'chocolate3': (205, 102, 29), 'chocolate4': (139, 69, 19), 'cobalt': (61, 89, 171), 'cobaltgreen': (61, 145, 64), 'coldgrey': (128, 138, 135), 'coral': (255, 127, 80), 'coral1': (255, 114, 86), 'coral2': (238, 106, 80), 'coral3': (205, 91, 69), 'coral4': (139, 62, 47), 'cornflowerblue': (100, 149, 237), 'cornsilk1': (255, 248, 220), 'cornsilk2': (238, 232, 205), 'cornsilk3': (205, 200, 177), 'cornsilk4': (139, 136, 120), 'crimson': (220, 20, 60), 'cyan2': (0, 238, 238), 'cyan3': (0, 205, 205), 'cyan4': (0, 139, 139), 'darkgoldenrod': (184, 134, 11), 'darkgoldenrod1': (255, 185, 15), 'darkgoldenrod2': (238, 173, 14), 'darkgoldenrod3': (205, 149, 12), 'darkgoldenrod4': (139, 101, 8), 'darkgray': (169, 169, 169), 'darkgreen': (0, 100, 0), 'darkkhaki': (189, 183, 107), 'darkolivegreen': (85, 107, 47), 'darkolivegreen1': (202, 255, 112), 'darkolivegreen2': (188, 238, 104), 'darkolivegreen3': (162, 205, 90), 'darkolivegreen4': (110, 139, 61), 'darkorange': (255, 140, 0), 'darkorange1': (255, 127, 0), 'darkorange2': (238, 118, 0), 'darkorange3': (205, 102, 0), 'darkorange4': (139, 69, 0), 'darkorchid': (153, 50, 204), 'darkorchid1': (191, 62, 255), 'darkorchid2': (178, 58, 238), 'darkorchid3': (154, 50, 205), 'darkorchid4': (104, 34, 139), 'darksalmon': (233, 150, 122), 'darkseagreen': (143, 188, 143), 'darkseagreen1': (193, 255, 193), 'darkseagreen2': (180, 238, 180), 'darkseagreen3': (155, 205, 155), 'darkseagreen4': (105, 139, 105), 'darkslateblue': (72, 61, 139), 'darkslategray': (47, 79, 79), 'darkslategray1': (151, 255, 255), 'darkslategray2': (141, 238, 238), 'darkslategray3': (121, 205, 205), 'darkslategray4': (82, 139, 139), 'darkturquoise': (0, 206, 209), 'darkviolet': (148, 0, 211), 'deeppink1': (255, 20, 147), 'deeppink2': (238, 18, 137), 'deeppink3': (205, 16, 118), 'deeppink4': (139, 10, 80), 'deepskyblue1': (0, 191, 255), 'deepskyblue2': (0, 178, 238), 'deepskyblue3': (0, 154, 205), 'deepskyblue4': (0, 104, 139), 'dimgray': (105, 105, 105), 'dodgerblue1': (30, 144, 255), 'dodgerblue2': (28, 134, 238), 'dodgerblue3': (24, 116, 205), 'dodgerblue4': (16, 78, 139), 'eggshell': (252, 230, 201), 'emeraldgreen': (0, 201, 87), 'firebrick': (178, 34, 34), 'firebrick1': (255, 48, 48), 'firebrick2': (238, 44, 44), 'firebrick3': (205, 38, 38), 'firebrick4': (139, 26, 26), 'flesh': (255, 125, 64), 'floralwhite': (255, 250, 240), 'forestgreen': (34, 139, 34), 'gainsboro': (220, 220, 220), 'ghostwhite': (248, 248, 255), 'gold1': (255, 215, 0), 'gold2': (238, 201, 0), 'gold3': (205, 173, 0), 'gold4': (139, 117, 0), 'goldenrod': (218, 165, 32), 'goldenrod1': (255, 193, 37), 'goldenrod2': (238, 180, 34), 'goldenrod3': (205, 155, 29), 'goldenrod4': (139, 105, 20), 'gray': (128, 128, 128), 'gray1': (3, 3, 3), 'gray10': (26, 26, 26), 'gray11': (28, 28, 28), 'gray12': (31, 31, 31), 'gray13': (33, 33, 33), 'gray14': (36, 36, 36), 'gray15': (38, 38, 38), 'gray16': (41, 41, 41), 'gray17': (43, 43, 43), 'gray18': (46, 46, 46), 'gray19': (48, 48, 48), 'gray2': (5, 5, 5), 'gray20': (51, 51, 51), 'gray21': (54, 54, 54), 'gray22': (56, 56, 56), 'gray23': (59, 59, 59), 'gray24': (61, 61, 61), 'gray25': (64, 64, 64), 'gray26': (66, 66, 66), 'gray27': (69, 69, 69), 'gray28': (71, 71, 71), 'gray29': (74, 74, 74), 'gray3': (8, 8, 8), 'gray30': (77, 77, 77), 'gray31': (79, 79, 79), 'gray32': (82, 82, 82), 'gray33': (84, 84, 84), 'gray34': (87, 87, 87), 'gray35': (89, 89, 89), 'gray36': (92, 92, 92), 'gray37': (94, 94, 94), 'gray38': (97, 97, 97), 'gray39': (99, 99, 99), 'gray4': (10, 10, 10), 'gray40': (102, 102, 102), 'gray42': (107, 107, 107), 'gray43': (110, 110, 110), 'gray44': (112, 112, 112), 'gray45': (115, 115, 115), 'gray46': (117, 117, 117), 'gray47': (120, 120, 120), 'gray48': (122, 122, 122), 'gray49': (125, 125, 125), 'gray5': (13, 13, 13), 'gray50': (127, 127, 127), 'gray51': (130, 130, 130), 'gray52': (133, 133, 133), 'gray53': (135, 135, 135), 'gray54': (138, 138, 138), 'gray55': (140, 140, 140), 'gray56': (143, 143, 143), 'gray57': (145, 145, 145), 'gray58': (148, 148, 148), 'gray59': (150, 150, 150), 'gray6': (15, 15, 15), 'gray60': (153, 153, 153), 'gray61': (156, 156, 156), 'gray62': (158, 158, 158), 'gray63': (161, 161, 161), 'gray64': (163, 163, 163), 'gray65': (166, 166, 166), 'gray66': (168, 168, 168), 'gray67': (171, 171, 171), 'gray68': (173, 173, 173), 'gray69': (176, 176, 176), 'gray7': (18, 18, 18), 'gray70': (179, 179, 179), 'gray71': (181, 181, 181), 'gray72': (184, 184, 184), 'gray73': (186, 186, 186), 'gray74': (189, 189, 189), 'gray75': (191, 191, 191), 'gray76': (194, 194, 194), 'gray77': (196, 196, 196), 'gray78': (199, 199, 199), 'gray79': (201, 201, 201), 'gray8': (20, 20, 20), 'gray80': (204, 204, 204), 'gray81': (207, 207, 207), 'gray82': (209, 209, 209), 'gray83': (212, 212, 212), 'gray84': (214, 214, 214), 'gray85': (217, 217, 217), 'gray86': (219, 219, 219), 'gray87': (222, 222, 222), 'gray88': (224, 224, 224), 'gray89': (227, 227, 227), 'gray9': (23, 23, 23), 'gray90': (229, 229, 229), 'gray91': (232, 232, 232), 'gray92': (235, 235, 235), 'gray93': (237, 237, 237), 'gray94': (240, 240, 240), 'gray95': (242, 242, 242), 'gray97': (247, 247, 247), 'gray98': (250, 250, 250), 'gray99': (252, 252, 252), 'green': (0, 128, 0), 'green1': (0, 255, 0), 'green2': (0, 238, 0), 'green3': (0, 205, 0), 'green4': (0, 139, 0), 'greenyellow': (173, 255, 47), 'honeydew1': (240, 255, 240), 'honeydew2': (224, 238, 224), 'honeydew3': (193, 205, 193), 'honeydew4': (131, 139, 131), 'hotpink': (255, 105, 180), 'hotpink1': (255, 110, 180), 'hotpink2': (238, 106, 167), 'hotpink3': (205, 96, 144), 'hotpink4': (139, 58, 98), 'indianred': (205, 92, 92), 'indianred1': (255, 106, 106), 'indianred2': (238, 99, 99), 'indianred3': (205, 85, 85), 'indianred4': (139, 58, 58), 'indigo': (75, 0, 130), 'ivory1': (255, 255, 240), 'ivory2': (238, 238, 224), 'ivory3': (205, 205, 193), 'ivory4': (139, 139, 131), 'ivoryblack': (41, 36, 33), 'khaki': (240, 230, 140), 'khaki1': (255, 246, 143), 'khaki2': (238, 230, 133), 'khaki3': (205, 198, 115), 'khaki4': (139, 134, 78), 'lavender': (230, 230, 250), 'lavenderblush1': (255, 240, 245), 'lavenderblush2': (238, 224, 229), 'lavenderblush3': (205, 193, 197), 'lavenderblush4': (139, 131, 134), 'lawngreen': (124, 252, 0), 'lemonchiffon1': (255, 250, 205), 'lemonchiffon2': (238, 233, 191), 'lemonchiffon3': (205, 201, 165), 'lemonchiffon4': (139, 137, 112), 'lightblue': (173, 216, 230), 'lightblue1': (191, 239, 255), 'lightblue2': (178, 223, 238), 'lightblue3': (154, 192, 205), 'lightblue4': (104, 131, 139), 'lightcoral': (240, 128, 128), 'lightcyan1': (224, 255, 255), 'lightcyan2': (209, 238, 238), 'lightcyan3': (180, 205, 205), 'lightcyan4': (122, 139, 139), 'lightgoldenrod1': (255, 236, 139), 'lightgoldenrod2': (238, 220, 130), 'lightgoldenrod3': (205, 190, 112), 'lightgoldenrod4': (139, 129, 76), 'lightgoldenrodyellow': (250, 250, 210), 'lightgrey': (211, 211, 211), 'lightpink': (255, 182, 193), 'lightpink1': (255, 174, 185), 'lightpink2': (238, 162, 173), 'lightpink3': (205, 140, 149), 'lightpink4': (139, 95, 101), 'lightsalmon1': (255, 160, 122), 'lightsalmon2': (238, 149, 114), 'lightsalmon3': (205, 129, 98), 'lightsalmon4': (139, 87, 66), 'lightseagreen': (32, 178, 170), 'lightskyblue': (135, 206, 250), 'lightskyblue1': (176, 226, 255), 'lightskyblue2': (164, 211, 238), 'lightskyblue3': (141, 182, 205), 'lightskyblue4': (96, 123, 139), 'lightslateblue': (132, 112, 255), 'lightslategray': (119, 136, 153), 'lightsteelblue': (176, 196, 222), 'lightsteelblue1': (202, 225, 255), 'lightsteelblue2': (188, 210, 238), 'lightsteelblue3': (162, 181, 205), 'lightsteelblue4': (110, 123, 139), 'lightyellow1': (255, 255, 224), 'lightyellow2': (238, 238, 209), 'lightyellow3': (205, 205, 180), 'lightyellow4': (139, 139, 122), 'limegreen': (50, 205, 50), 'linen': (250, 240, 230), 'magenta': (255, 0, 255), 'magenta2': (238, 0, 238), 'magenta3': (205, 0, 205), 'magenta4': (139, 0, 139), 'manganeseblue': (3, 168, 158), 'maroon': (128, 0, 0), 'maroon1': (255, 52, 179), 'maroon2': (238, 48, 167), 'maroon3': (205, 41, 144), 'maroon4': (139, 28, 98), 'mediumorchid': (186, 85, 211), 'mediumorchid1': (224, 102, 255), 'mediumorchid2': (209, 95, 238), 'mediumorchid3': (180, 82, 205), 'mediumorchid4': (122, 55, 139), 'mediumpurple': (147, 112, 219), 'mediumpurple1': (171, 130, 255), 'mediumpurple2': (159, 121, 238), 'mediumpurple3': (137, 104, 205), 'mediumpurple4': (93, 71, 139), 'mediumseagreen': (60, 179, 113), 'mediumslateblue': (123, 104, 238), 'mediumspringgreen': (0, 250, 154), 'mediumturquoise': (72, 209, 204), 'mediumvioletred': (199, 21, 133), 'melon': (227, 168, 105), 'midnightblue': (25, 25, 112), 'mint': (189, 252, 201), 'mintcream': (245, 255, 250), 'mistyrose1': (255, 228, 225), 'mistyrose2': (238, 213, 210), 'mistyrose3': (205, 183, 181), 'mistyrose4': (139, 125, 123), 'moccasin': (255, 228, 181), 'navajowhite1': (255, 222, 173), 'navajowhite2': (238, 207, 161), 'navajowhite3': (205, 179, 139), 'navajowhite4': (139, 121, 94), 'navy': (0, 0, 128), 'oldlace': (253, 245, 230), 'olive': (128, 128, 0), 'olivedrab': (107, 142, 35), 'olivedrab1': (192, 255, 62), 'olivedrab2': (179, 238, 58), 'olivedrab3': (154, 205, 50), 'olivedrab4': (105, 139, 34), 'orange': (255, 128, 0), 'orange1': (255, 165, 0), 'orange2': (238, 154, 0), 'orange3': (205, 133, 0), 'orange4': (139, 90, 0), 'orangered1': (255, 69, 0), 'orangered2': (238, 64, 0), 'orangered3': (205, 55, 0), 'orangered4': (139, 37, 0), 'orchid': (218, 112, 214), 'orchid1': (255, 131, 250), 'orchid2': (238, 122, 233), 'orchid3': (205, 105, 201), 'orchid4': (139, 71, 137), 'palegoldenrod': (238, 232, 170), 'palegreen': (152, 251, 152), 'palegreen1': (154, 255, 154), 'palegreen2': (144, 238, 144), 'palegreen3': (124, 205, 124), 'palegreen4': (84, 139, 84), 'paleturquoise1': (187, 255, 255), 'paleturquoise2': (174, 238, 238), 'paleturquoise3': (150, 205, 205), 'paleturquoise4': (102, 139, 139), 'palevioletred': (219, 112, 147), 'palevioletred1': (255, 130, 171), 'palevioletred2': (238, 121, 159), 'palevioletred3': (205, 104, 137), 'palevioletred4': (139, 71, 93), 'papayawhip': (255, 239, 213), 'peachpuff1': (255, 218, 185), 'peachpuff2': (238, 203, 173), 'peachpuff3': (205, 175, 149), 'peachpuff4': (139, 119, 101), 'peacock': (51, 161, 201), 'pink': (255, 192, 203), 'pink1': (255, 181, 197), 'pink2': (238, 169, 184), 'pink3': (205, 145, 158), 'pink4': (139, 99, 108), 'plum': (221, 160, 221), 'plum1': (255, 187, 255), 'plum2': (238, 174, 238), 'plum3': (205, 150, 205), 'plum4': (139, 102, 139), 'powderblue': (176, 224, 230), 'purple': (128, 0, 128), 'purple1': (155, 48, 255), 'purple2': (145, 44, 238), 'purple3': (125, 38, 205), 'purple4': (85, 26, 139), 'raspberry': (135, 38, 87), 'rawsienna': (199, 97, 20), 'red': (255, 0, 0), 'red1': (255, 0, 0), 'red2': (238, 0, 0), 'red3': (205, 0, 0), 'red4': (139, 0, 0), 'rosybrown': (188, 143, 143), 'rosybrown1': (255, 193, 193), 'rosybrown2': (238, 180, 180), 'rosybrown3': (205, 155, 155), 'rosybrown4': (139, 105, 105), 'royalblue': (65, 105, 225), 'royalblue1': (72, 118, 255), 'royalblue2': (67, 110, 238), 'royalblue3': (58, 95, 205), 'royalblue4': (39, 64, 139), 'salmon': (250, 128, 114), 'salmon1': (255, 140, 105), 'salmon2': (238, 130, 98), 'salmon3': (205, 112, 84), 'salmon4': (139, 76, 57), 'sandybrown': (244, 164, 96), 'sapgreen': (48, 128, 20), 'seagreen1': (84, 255, 159), 'seagreen2': (78, 238, 148), 'seagreen3': (67, 205, 128), 'seagreen4': (46, 139, 87), 'seashell1': (255, 245, 238), 'seashell2': (238, 229, 222), 'seashell3': (205, 197, 191), 'seashell4': (139, 134, 130), 'sepia': (94, 38, 18), 'sgibeet': (142, 56, 142), 'sgibrightgray': (197, 193, 170), 'sgichartreuse': (113, 198, 113), 'sgidarkgray': (85, 85, 85), 'sgigray12': (30, 30, 30), 'sgigray16': (40, 40, 40), 'sgigray32': (81, 81, 81), 'sgigray36': (91, 91, 91), 'sgigray52': (132, 132, 132), 'sgigray56': (142, 142, 142), 'sgigray72': (183, 183, 183), 'sgigray76': (193, 193, 193), 'sgigray92': (234, 234, 234), 'sgigray96': (244, 244, 244), 'sgilightblue': (125, 158, 192), 'sgilightgray': (170, 170, 170), 'sgiolivedrab': (142, 142, 56), 'sgisalmon': (198, 113, 113), 'sgislateblue': (113, 113, 198), 'sgiteal': (56, 142, 142), 'sienna': (160, 82, 45), 'sienna1': (255, 130, 71), 'sienna2': (238, 121, 66), 'sienna3': (205, 104, 57), 'sienna4': (139, 71, 38), 'silver': (192, 192, 192), 'skyblue': (135, 206, 235), 'skyblue1': (135, 206, 255), 'skyblue2': (126, 192, 238), 'skyblue3': (108, 166, 205), 'skyblue4': (74, 112, 139), 'slateblue': (106, 90, 205), 'slateblue1': (131, 111, 255), 'slateblue2': (122, 103, 238), 'slateblue3': (105, 89, 205), 'slateblue4': (71, 60, 139), 'slategray': (112, 128, 144), 'slategray1': (198, 226, 255), 'slategray2': (185, 211, 238), 'slategray3': (159, 182, 205), 'slategray4': (108, 123, 139), 'snow1': (255, 250, 250), 'snow2': (238, 233, 233), 'snow3': (205, 201, 201), 'snow4': (139, 137, 137), 'springgreen': (0, 255, 127), 'springgreen1': (0, 238, 118), 'springgreen2': (0, 205, 102), 'springgreen3': (0, 139, 69), 'steelblue': (70, 130, 180), 'steelblue1': (99, 184, 255), 'steelblue2': (92, 172, 238), 'steelblue3': (79, 148, 205), 'steelblue4': (54, 100, 139), 'tan': (210, 180, 140), 'tan1': (255, 165, 79), 'tan2': (238, 154, 73), 'tan3': (205, 133, 63), 'tan4': (139, 90, 43), 'teal': (0, 128, 128), 'thistle': (216, 191, 216), 'thistle1': (255, 225, 255), 'thistle2': (238, 210, 238), 'thistle3': (205, 181, 205), 'thistle4': (139, 123, 139), 'tomato1': (255, 99, 71), 'tomato2': (238, 92, 66), 'tomato3': (205, 79, 57), 'tomato4': (139, 54, 38), 'turquoise': (64, 224, 208), 'turquoise1': (0, 245, 255), 'turquoise2': (0, 229, 238), 'turquoise3': (0, 197, 205), 'turquoise4': (0, 134, 139), 'turquoiseblue': (0, 199, 140), 'violet': (238, 130, 238), 'violetred': (208, 32, 144), 'violetred1': (255, 62, 150), 'violetred2': (238, 58, 140), 'violetred3': (205, 50, 120), 'violetred4': (139, 34, 82), 'warmgrey': (128, 128, 105), 'wheat': (245, 222, 179), 'wheat1': (255, 231, 186), 'wheat2': (238, 216, 174), 'wheat3': (205, 186, 150), 'wheat4': (139, 126, 102), 'white': (255, 255, 255), 'whitesmoke': (245, 245, 245), 'yellow1': (255, 255, 0), 'yellow2': (238, 238, 0), 'yellow3': (205, 205, 0), 'yellow4': (139, 139, 0)}

Color Constants

class play_helpers.ph_colors.RGB(red, green, blue)

Bases: RGB

Create new instance of RGB(red, green, blue)

hex_format()
Returns:

Returns color in hex format

play_helpers.ph_constants module

class play_helpers.ph_constants.PhConstants

Bases: object

AID_EUICC_ISDP_INITIAL = 'A0000005591010'
AID_EUICC_ISDR_OR_UICC_ISD = 'A000000151000000'
BEGIN_CERTIFICATE = '-----BEGIN CERTIFICATE-----'
CERTIFICATE = 'CERTIFICATE'
CHAR_ENCODING_ASCII = 'ascii'
CHAR_ENCODING_CP_1252 = 'cp1252'
CHAR_ENCODING_ERRORS_IGNORE = 'ignore'
CHAR_ENCODING_ERRORS_POOL = ['strict', 'ignore', 'replace', 'surrogateescape', 'xmlcharrefreplace', 'backslashreplace', 'namereplace']
CHAR_ENCODING_ERRORS_REPLACE = 'replace'
CHAR_ENCODING_ERRORS_STRICT = 'strict'
CHAR_ENCODING_ISO_8859 = 'ISO-8859-1'
CHAR_ENCODING_POOL = ['ascii', 'utf-8', 'ISO-8859-1', 'cp1252']
CHAR_ENCODING_UTF8 = 'utf-8'
CHILD = 22
CRLF = '\r\n'
DEFAULT_TRIM_STRING = '...'
DEFAULT_TRIM_STRING_LENGTH = 3
DETAILS = 'Details'
DICT_EMPTY = {}
DIR_CREATION = 1
DIR_DELETION = 2
EMPTY_INPUT_FILE = 'Empty Input File'
ENCLOSE_COMMENT = 8
ENCLOSE_HEX = 1
ENCLOSE_NAME_VALUE = 2
ENCLOSE_NAME_VALUE_DICT = 4
ENCLOSE_NAME_VALUE_HEX = 3
ENCLOSE_NAME_VALUE_HEX_DICT = 5
ENCLOSE_NAME_VALUE_SEQ = 7
ENCLOSE_NAME_VALUE_SEQ_DICT = 6
END_BLOCK = 2
END_CERTIFICATE = '-----END CERTIFICATE-----'
ENV_VARIABLES = {}
EXCEPTION_OCCURRED = 'Exception Occurred'
EXCEPTION_OCCURRED_AT_FUNC = 'Exception Occurred at function'
EXIT_VALUE_POOL = ('e', 'exit')
EXPORT_ERROR = 'export error'
FALSE_VALUE_POOL = ('no', 'false', 'f', 'n', '0')
FILE_EXTN_TMP = '.tmp'
FILE_TYPE_IN = 1
FILE_TYPE_OUT = 2
FORMAT_HEX_STRING_AS_COMMA = 8
FORMAT_HEX_STRING_AS_HEX = 2
FORMAT_HEX_STRING_AS_PACK = 1
FORMAT_HEX_STRING_AS_UPPERCASE = 4
HEADING_LENGTH_MAX = 120
HEADING_LENGTH_RESERVE_STARTING_AND_ENDING_SYMBOL = 2
HEADING_LENGTH_RESERVE_STARTING_AND_ENDING_WHITE_SPACES = 2
INCORRECT_BLOCK_STRUCTURE = 'Incorrect Block Structure; Opening and Closing Sequences are not matching'
INPUTS_ERROR = 'Check all your Inputs'
INVALID_INPUT_DATA = 'Check your Input Data'
INVALID_RAW_DATA = 'Check your Raw Data'
INVALID_TIME_OUT = 'Invalid Time Out'
INVALID_URL_TIME_OUT = 'Invalid URL Time Out'
ITEM = 'item'
KEYWORD_VARIABLE_DECLARATION_IN = ['var_In', 'var_in_list', 'var_in']
KEYWORD_VARIABLE_DECLARATION_OUT = ['var_Out', 'varlist', 'var_out', 'VAR_OUT', 'Var_Out']
KEYWORD_VARIABLE_QUANTITY = ['Quantity', 'Count']
KEY_DATE_TIME = 'Date & Time'
KNOWN = 'Known'
LENGTH_DIALING_NUMBER_DEFAULT = 12
LENGTH_EF_ACC = 2
LENGTH_EF_IMSI = 9
LENGTH_EF_SPN = 17
LENGTH_IMSI = 8
LENGTH_MSISDN = 12
LENGTH_PINS_PUKS_ADMS = 8
LENGTH_SMSC = 12
LENGTH_SPN_STRING = 16
LF = '\n'
LIST_EMPTY = []
MAX_SUPPORTED_DIGIT_IN_INT = 9
MISSING_INPUT_DATA = 'Missing Input Data'
MISSING_INPUT_YML = 'Missing "input" in Yml Config'
MULTIPLE_STEPS_FORWARD = '/**/'
NO = False
NON_ZERO_EXIT_STATUS_ERROR = 'non-zero exit status error'
OFFSET_NAME_FOR_ASN_FILE = 1
OFFSET_NAME_FOR_OUTPUT_FILE = 0
OFFSET_ONE = 1
OFFSET_ZERO = 0
ONE_STEP_BACKWARD = '/../'
ONE_STEP_FORWARD = '/'
OPEN_SSL_CERTIFICATE_COMMENTS = '-'
PACKAGE_NOT_FOUND_ERROR = 'package not found error'
PARENT = 21
PLACE_HOLDERS_FOR_VARIABLES = ['${VAR}', '${VAR  }', '${VAR    }']
POOL_16_BYTES_LENGTH = ['KI', 'KIC1', 'KID1', 'KIK1', 'KIC2', 'KID2', 'KIK2', 'KIC01', 'KID01', 'KIK01', 'KIC02', 'KID02', 'KIK02', 'KIC03', 'KID03', 'KIK03', 'KIC04', 'KID04', 'KIK04', 'KIC05', 'KID05', 'KIK05', 'KIC06', 'KID06', 'KIK06', 'KIC07', 'KID07', 'KIK07', 'KIC08', 'KID08', 'KIK08', 'KIC09', 'KID09', 'KIK09', 'KIC0A', 'KID0A', 'KIK0A', 'KIC0B', 'KID0B', 'KIK0B', 'KIC0C', 'KID0C', 'KIK0C', 'KIC0D', 'KID0D', 'KIK0D', 'KIC0E', 'KID0E', 'KIK0E', 'KIC0F', 'KID0F', 'KIK0F']
POOL_4_DIGITS_LENGTH = ['PIN1', 'PIN2', 'secondPINAppl1', 'secondPINAppl2']
POOL_8_DIGITS_LENGTH = ['PUK1', 'PUK2', 'ADM1', 'ADM2', 'ADM3', 'ADM4', 'ADM5', 'secondPUKAppl1', 'secondPUKAppl2']
PUBLIC_IP_SERVICES_IPV4_POOL = ['https://ipinfo.io/ip', 'https://api.ipify.org/', 'https://ipv4.icanhazip.com/', 'https://v4.ident.me/']
PUBLIC_IP_SERVICES_IPV6_POOL = ['https://v6.ipinfo.io/ip', 'https://api64.ipify.org/', 'https://ipv6.icanhazip.com/', 'https://v6.ident.me/']
PUBLIC_IP_SERVICES_POOL = ['https://ifconfig.co/ip', 'https://ipecho.net/plain', 'https://checkip.amazonaws.com', 'https://ipinfo.io/ip', 'https://api.ipify.org', 'https://icanhazip.com/', 'https://ident.me']
class Position(value)

Bases: Enum

An enumeration.

BOTTOM = 3
LEFT = 4
RIGHT = 2
TOP = 1
READ_WRITE_ERROR = 'input/output path reading/writing error'
REMARKS_MAX_LENGTH = 116
SEARCH_TYPE_PLAIN = 1
SEARCH_TYPE_REGEX = 2
SEPERATOR_FILE_NAME = '_'
SEPERATOR_INFO = ' => '
SEPERATOR_KEY_VALUE = ': '
SEPERATOR_MULTI_LINE = ':\n'
SEPERATOR_MULTI_LINE_TABBED = ':\n\t'
SEPERATOR_MULTI_OBJ = '; '
SEPERATOR_NAME_VERSION = ' '
SEPERATOR_ONE_LINE = ': '
SEPERATOR_TITLE = ' | '
SEPERATOR_TWO_DATA_SET = '     -----     '
SEPERATOR_TWO_LINES = '\n'
SEPERATOR_TWO_LINES_MULTI = '\n\n'
SEPERATOR_TWO_WORDS = ' '
SET_EMPTY = {}
START_BLOCK = 1
STR_CURLY_BRACE_END = '}'
STR_CURLY_BRACE_START = '{'
STR_EMPTY = ''
STR_OTHER_OPTION = '-- Other --'
STR_SELECT_OPTION = '-- Select --'
STR_SPACE = ' '
STR_TAB = '    '
STR_TYPE_ALPHA_NUMERIC_LOWER_CASE = 30
STR_TYPE_ALPHA_NUMERIC_RANDOM_CASE = 32
STR_TYPE_ALPHA_NUMERIC_UPPER_CASE = 31
STR_TYPE_ASCII_LOWER_CASE = 21
STR_TYPE_ASCII_RANDOM_CASE = 32
STR_TYPE_ASCII_UPPER_CASE = 22
STR_TYPE_HEX_LOWER_CASE = 11
STR_TYPE_HEX_RANDOM_CASE = 13
STR_TYPE_HEX_UPPER_CASE = 12
STR_TYPE_NUMERIC = 1
STR_TYPE_NUMERIC_BIN = 3
STR_TYPE_NUMERIC_OCT = 2
STR_TYPE_PASSWORD_LOWER_CASE = 40
STR_TYPE_PASSWORD_RANDOM_CASE = 42
STR_TYPE_PASSWORD_UPPER_CASE = 41
SUB = 'sub '
SUMMARY = 'Summary'
TEST_DATA_0_9_LEN_10 = '0123456789'
TEST_DATA_A_Z_LOWER_LEN_26 = 'abcdefghijklmnopqrstuvwxyz'
TEST_DATA_A_Z_UPPER_LEN_26 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
TEST_DATA_MIX_LEN_75 = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()_+'
TEST_DATA_SYMBOL_LEN_13 = '~!@#$%^&*()_+'
TIME_OUT_ERROR = 'time out error'
TRUE_VALUE_POOL = ('yes', 'true', 't', 'y', '1')
TUPLE_EMPTY = ((),)
UNIX_LINE_ENDING = '\n'
UNKNOWN = 'UnKnown'
UNKNOWN_INPUT_FORMAT = 'Unknown Input Format'
USER_INPUT_OPTIONS = ' [Yes/No/Exit]: '
VAR_POOL_2_PIN1 = ['2PIN1', 'secondPINAppl1']
VAR_POOL_2_PUK1 = ['2PUK1', 'secondPUKAppl1']
VAR_POOL_3_PIN1 = ['3PIN1', 'secondPINAppl2']
VAR_POOL_3_PUK1 = ['3PUK1', 'secondPUKAppl2']
VAR_POOL_ACC = ['ACC', 'ef-acc', 'Access_Control']
VAR_POOL_ADM1 = ['ADM1', 'adm1', 'ISC1', 'ADM1_0A', 'ADM', 'ADMIN']
VAR_POOL_ADM2 = ['ADM2', 'adm2', 'ISC2', 'ADM1_0B']
VAR_POOL_ADM3 = ['ADM3', 'adm3', 'ISC3', 'ADM1_0C']
VAR_POOL_ADM4 = ['ADM4', 'adm4', 'ISC4', 'ADM1_0D']
VAR_POOL_ADM5 = ['ADM5', 'adm5', 'ISC5', 'ADM1_0E']
VAR_POOL_ICCID = ['ICCID', 'iccid', 'ICCID_FROM', 'SER_NB', 'Ser_nb']
VAR_POOL_ICCID_WO_CHECKSUM = ['SER_NB', 'Ser_nb']
VAR_POOL_IMSI = ['IMSI', 'imsi', 'IMSI_FROM']
VAR_POOL_IMSI2 = ['imsi2', 'imsi-9009-2601-rec2']
VAR_POOL_KI = ['KI', 'key', 'ki', 'KEY']
VAR_POOL_KIC1 = ['KIC1', 'kic1IsdR', 'KIC', 'KIC_KID']
VAR_POOL_KIC2 = ['KIC2', 'kic1IsdP']
VAR_POOL_KID1 = ['KID1', 'kid1IsdR', 'KID', 'KIC_KID']
VAR_POOL_KID2 = ['KID2', 'kid1IsdP']
VAR_POOL_KIK1 = ['KIK1', 'kik1IsdR', 'KIK']
VAR_POOL_KIK2 = ['KIK2', 'kik1IsdP']
VAR_POOL_MNO_SD_KIC_01 = ['KIC01', 'mno_sd_kic_01']
VAR_POOL_MNO_SD_KIC_02 = ['KIC02', 'mno_sd_kic_02']
VAR_POOL_MNO_SD_KIC_03 = ['KIC03', 'mno_sd_kic_03']
VAR_POOL_MNO_SD_KIC_04 = ['KIC04', 'mno_sd_kic_04']
VAR_POOL_MNO_SD_KIC_05 = ['KIC05', 'mno_sd_kic_05']
VAR_POOL_MNO_SD_KIC_06 = ['KIC06', 'mno_sd_kic_06']
VAR_POOL_MNO_SD_KIC_07 = ['KIC07', 'mno_sd_kic_07']
VAR_POOL_MNO_SD_KIC_08 = ['KIC08', 'mno_sd_kic_08']
VAR_POOL_MNO_SD_KIC_09 = ['KIC09', 'mno_sd_kic_09']
VAR_POOL_MNO_SD_KIC_0A = ['KIC0A', 'mno_sd_kic_0A']
VAR_POOL_MNO_SD_KIC_0B = ['KIC0B', 'mno_sd_kic_0B']
VAR_POOL_MNO_SD_KIC_0C = ['KIC0C', 'mno_sd_kic_0C']
VAR_POOL_MNO_SD_KIC_0D = ['KIC0D', 'mno_sd_kic_0D']
VAR_POOL_MNO_SD_KIC_0E = ['KIC0E', 'mno_sd_kic_0E']
VAR_POOL_MNO_SD_KIC_0F = ['KIC0F', 'mno_sd_kic_0F']
VAR_POOL_MNO_SD_KID_01 = ['KID01', 'mno_sd_kid_01']
VAR_POOL_MNO_SD_KID_02 = ['KID02', 'mno_sd_kid_02']
VAR_POOL_MNO_SD_KID_03 = ['KID03', 'mno_sd_kid_03']
VAR_POOL_MNO_SD_KID_04 = ['KID04', 'mno_sd_kid_04']
VAR_POOL_MNO_SD_KID_05 = ['KID05', 'mno_sd_kid_05']
VAR_POOL_MNO_SD_KID_06 = ['KID06', 'mno_sd_kid_06']
VAR_POOL_MNO_SD_KID_07 = ['KID07', 'mno_sd_kid_07']
VAR_POOL_MNO_SD_KID_08 = ['KID08', 'mno_sd_kid_08']
VAR_POOL_MNO_SD_KID_09 = ['KID09', 'mno_sd_kid_09']
VAR_POOL_MNO_SD_KID_0A = ['KID0A', 'mno_sd_kid_0A']
VAR_POOL_MNO_SD_KID_0B = ['KID0B', 'mno_sd_kid_0B']
VAR_POOL_MNO_SD_KID_0C = ['KID0C', 'mno_sd_kid_0C']
VAR_POOL_MNO_SD_KID_0D = ['KID0D', 'mno_sd_kid_0D']
VAR_POOL_MNO_SD_KID_0E = ['KID0E', 'mno_sd_kid_0E']
VAR_POOL_MNO_SD_KID_0F = ['KID0F', 'mno_sd_kid_0F']
VAR_POOL_MNO_SD_KIK_01 = ['KIK01', 'mno_sd_kik_01']
VAR_POOL_MNO_SD_KIK_02 = ['KIK02', 'mno_sd_kik_02']
VAR_POOL_MNO_SD_KIK_03 = ['KIK03', 'mno_sd_kik_03']
VAR_POOL_MNO_SD_KIK_04 = ['KIK04', 'mno_sd_kik_04']
VAR_POOL_MNO_SD_KIK_05 = ['KIK05', 'mno_sd_kik_05']
VAR_POOL_MNO_SD_KIK_06 = ['KIK06', 'mno_sd_kik_06']
VAR_POOL_MNO_SD_KIK_07 = ['KIK07', 'mno_sd_kik_07']
VAR_POOL_MNO_SD_KIK_08 = ['KIK08', 'mno_sd_kik_08']
VAR_POOL_MNO_SD_KIK_09 = ['KIK09', 'mno_sd_kik_09']
VAR_POOL_MNO_SD_KIK_0A = ['KIK0A', 'mno_sd_kik_0A']
VAR_POOL_MNO_SD_KIK_0B = ['KIK0B', 'mno_sd_kik_0B']
VAR_POOL_MNO_SD_KIK_0C = ['KIK0C', 'mno_sd_kik_0C']
VAR_POOL_MNO_SD_KIK_0D = ['KIK0D', 'mno_sd_kik_0D']
VAR_POOL_MNO_SD_KIK_0E = ['KIK0E', 'mno_sd_kik_0E']
VAR_POOL_MNO_SD_KIK_0F = ['KIK0F', 'mno_sd_kik_0F']
VAR_POOL_PIN1 = ['PIN1', 'pinAppl1', 'CHV1', 'PIN', 'CHV']
VAR_POOL_PIN2 = ['PIN2', 'pinAppl2', 'CHV2']
VAR_POOL_PUK1 = ['PUK1', 'pukAppl1', 'PUK']
VAR_POOL_PUK2 = ['PUK2', 'pukAppl2']
VAR_TYPE_IN = 1
VAR_TYPE_OUT = 2
VAR_TYPE_PROFILE = 3
WINDOWS_LINE_ENDING = '\r\n'
WRITE_PATH_ERROR = 'output path writing error'
YES = True

play_helpers.ph_constants_config module

class play_helpers.ph_constants_config.PhConfigConst

Bases: object

TOOL_DESCRIPTION = 'A Python software package suite to provide various utility functions.'
TOOL_GIT_SUMMARY = 'cc65905;  (HEAD, origin/main, origin/HEAD, main); 2026-03-25 10:36:52 +0530; imPratik <impratikjaiswal@gmail.com>; aligh'
TOOL_META_DESCRIPTION = 'A Python software package suite to provide various utility functions.'
TOOL_META_KEYWORDS = 'Play Helpers, Common Functions, Funcs, Util, Utility'
TOOL_NAME = 'playHelpers'
TOOL_SW_MODULE_NAME = 'play_helpers'
TOOL_SW_PACKAGE_NAME = 'play_helpers'
TOOL_TEST_PACKAGE_NAME = 'play_helpers.test'
TOOL_TITLE = 'Play Helpers'
TOOL_URL = 'https://github.com/AmenityPj/playHelpers'
TOOL_URL_BUG_TRACKER = 'https://github.com/AmenityPj/playHelpers/issues'
TOOL_VERSION = '7.0.8'
TOOL_VERSION_DETAILED = 'v7.0.8'

play_helpers.ph_crypto module

class play_helpers.ph_crypto.PhCrypto

Bases: object

classmethod aes_encrypt(hex_strkey, hex_str_buff, algo=2, hex_str_iv='00000000000000000000000000000000')

AES Encryption :param hex_strkey: Key as Hex Str :param hex_str_buff: Main Message as Hex Str to be encrypted :param algo: algo to be used :param hex_str_iv: iv value as Hex Str :return: output as hex String

classmethod append_luhn(str_plain_data, min_len_iccid_wo_luhn=18)
classmethod append_luhn_if_needed(str_plain_data, min_len_iccid_wo_luhn=18)
Consider the case:

89446172120000011 : 17 Chars, Luhn digit 4 894461721200000114 : 18 Chars, Luhn digit 6

Parameters:
  • str_plain_data

  • min_len_iccid_wo_luhn

Returns:

classmethod compare_two_files(file_1, file_2)
Parameters:
  • file_1

  • file_2

Returns:

classmethod gen_opc(ki_hex, op_hex)
Parameters:
  • ki_hex

  • op_hex

Returns:

classmethod generate_opc(hex_str_ki, hex_str_op)

Generate Opc using Ki and Op :param hex_str_ki: Ki as hex String :param hex_str_op: OP as hex String :return: hexStrOpc: OPC as hex String

classmethod get_luhn_digit(msg)

TODO: Function needs to be thoroughly tested

Parameters:

msg

Returns:

classmethod get_odd_even_digits(msg, sum_to_single_digit=True)
classmethod hash_algos_list()
classmethod hash_file(file_obj, hex_digest=True)
Parameters:
  • file_obj

  • hex_digest

  • msg

Returns:

classmethod hash_str(msg, hash_algo='sha256', hex_digest=True, encoding='utf-8', encoding_errors='replace')
Parameters:
  • msg

  • hash_algo – check hash_algos_list()

‘md5-sha1’, ‘sha3_224’, ‘sha3_256’, ‘shake_128’, ‘sm3’, ‘sha512’, ‘sha3_384’, ‘sha256’, ‘sha384’, ‘whirlpool’, ‘sha3_512’, ‘mdc2’, ‘sha1’, ‘md4’, ‘sha512_256’, ‘ripemd160’, ‘blake2s’, ‘blake2b’, ‘sha512_224’, ‘md5’, ‘shake_256’, ‘sha224’ :param hex_digest: :param encoding: :param encoding_errors:

Returns:

classmethod hash_str_sha256(msg, hex_digest=True, encoding='utf-8', encoding_errors='replace')
Parameters:
  • msg

  • hex_digest

  • encoding

  • encoding_errors

Returns:

classmethod logical_xor(str1_hex, str2_hex)
Parameters:
  • str1_hex

  • str2_hex

Returns:

classmethod logical_xor_(hex_str_msg, hex_str_key)

Logical XOR among two hex String :param hex_str_msg: Main Message as Hex Str :param hex_str_key: Key as Hex Str :return: output as hex String

classmethod remove_luhn_if_present(str_plain_data)
Parameters:

str_plain_data

Returns:

classmethod sum_to_single_digit(num)
classmethod validate_eid(msg)

TODO:Check if EID last digit is with or without Luhn Check sum digit :param msg: :return:

classmethod validate_luhn_digit(msg)

TODO:Check if iccid last digit is with or without Luhn Check sum digit :param msg: :return:

play_helpers.ph_data_master module

class play_helpers.ph_data_master.PhMasterData(data=None, meta_data=None, info_data=None, error_data=None)

Bases: object

Parameters:
  • data

  • meta_data

  • info_data

  • error_data

__init__(data=None, meta_data=None, info_data=None, error_data=None)
Parameters:
  • data

  • meta_data

  • info_data

  • error_data

get()
get_master_data(key)
get_output_data(only_output)
set_master_data(key, value)
class play_helpers.ph_data_master.PhMasterDataKeys

Bases: object

DATA = 'data'
ERROR_DATA = 'error_data'
INFO_DATA = 'info_data'
META_DATA = 'meta_data'

play_helpers.ph_defaults module

class play_helpers.ph_defaults.PhDefaultTypesExclude

Bases: object

INPUT_DATA = [<class 'int'>, <class 'float'>, <class 'bool'>]
class play_helpers.ph_defaults.PhDefaultTypesInclude

Bases: object

ARCHIVE_OUTPUT

alias of bool

ARCHIVE_OUTPUT_FORMAT

alias of str

ENCODING

alias of str

ENCODING_ERRORS

alias of str

OUTPUT_PATH

alias of str

PRINT_INFO

alias of bool

PRINT_INPUT

alias of bool

PRINT_OUTPUT

alias of bool

QUITE_MODE

alias of bool

class play_helpers.ph_defaults.PhDefaults

Bases: object

ARCHIVE_FORMAT = '.zip'
ARCHIVE_OUTPUT = True
ARCHIVE_OUTPUT_FORMAT = '.zip'
CHAR_ENCODING = 'utf-8'
CHAR_ENCODING_ERRORS = 'replace'
DUMMY_VERSION = '-1.-1.-1'
ENCODING = 'utf-8'
ENCODING_ERRORS = 'replace'
ERROR_HANDLING_MODE = 2
EXECUTION_MODE = 1
OUTPUT_FILE_NAME_KEYWORD = ''
OUTPUT_PATH = ''
PRINT_INFO = True
PRINT_INPUT = True
PRINT_OUTPUT = True
QUITE_MODE = False
VERSION = '1.0.1'

play_helpers.ph_dos module

class play_helpers.ph_dos.PhDos

Bases: object

BATCH_RUN_TC = 'run_tc.bat'
classmethod call_script_for_env_handling(activate_venv=True)
classmethod change_directory(target_dir_path)
classmethod change_directory_parent()
classmethod comment_line(line=None)
classmethod common_info()
classmethod create_directory(dir_path=None, file_path=None, conditional=True)
classmethod create_zip_file(target_zip, source_files)
classmethod delete_empty_dirs_in_current_folder()
classmethod delete_file(target_file_path, conditional=True)
classmethod echo(msg, wrap_up=False)
classmethod echo_off()
classmethod echo_on()
classmethod get_seperator(heading=None)
classmethod redirect_output(file_path)
classmethod run_python(module_name)
classmethod switch_to_current_folder()
classmethod time_stamp()
classmethod user_name()
classmethod windows_version()

play_helpers.ph_exception module

exception play_helpers.ph_exception.PhException(msg)

Bases: Exception

__init__(msg)

play_helpers.ph_exception_helper module

class play_helpers.ph_exception_helper.PhExceptionHelper(msg_key=None, function_name=None, line_num=None, exception=None, msg_value=None, key_value_sep=': ', additional_msgs_list=None, summary_msg=None, known=None)

Bases: object

__init__(msg_key=None, function_name=None, line_num=None, exception=None, msg_value=None, key_value_sep=': ', additional_msgs_list=None, summary_msg=None, known=None)
get_details()
get_exception()
set_summary_msg(msg, known=False)
play_helpers.ph_exception_helper.get_exception_object(e)

play_helpers.ph_file_extensions module

class play_helpers.ph_file_extensions.PhFileExtensions

Bases: object

ALL_EXT = '.*'
ASN = '.asn'
ASN1 = '.asn1'
ASN_AUTO_CORRECTED = '.asn_auto_corrected'
ASN_FORMATTED = '.asn_formatted'
ASN_MANUALLY_CORRECTED = '.asn_manually_corrected'
ASN_ORG = '.asn_org'
BASE_64 = '.base64'
BKP = '.bkp'
CSV = '.csv'
DOC = '.doc'
DOCX = '.docx'
FUNCTION_SPECIFIC = '.function_specific'
HASH = '.hash'
HEX = '.hex'
IN = '.in'
JAVA = '.java'
JPEG = '.jpeg'
JPG = '.jpg'
JSON = '.json'
OUT = '.out'
PDF = '.pdf'
PNG = '.png'
PY = '.py'
SEP = '.'
SVG = '.svg'
TMP = '.tmp'
TXT = '.txt'
XLS = '.xls'
XLSX = '.xlsx'
YAML = '.yaml'
YML = '.yml'
ZIP = '.zip'
class play_helpers.ph_file_extensions.PhFileExtensionsGroups

Bases: object

ARCHIVE_OUTPUT_FORMATS_SUPPORTED = ['.zip']

play_helpers.ph_formats module

class play_helpers.ph_formats.PhFormats

Bases: object

APNG = 'apng'
ASN = 'asn'
ASN1 = 'asn1'
ASN_AUTO_CORRECTED = 'asn_auto_corrected'
ASN_FORMATTED = 'asn_formatted'
ASN_MANUALLY_CORRECTED = 'asn_manually_corrected'
ASN_ORG = 'asn_org'
AVIF = 'avif'
BASE_64 = 'base64'
BKP = 'bkp'
CSV = 'csv'
DER = 'der'
FUNCTION_SPECIFIC = 'function_specific'
GIF = 'gif'
HASH = 'hash'
HEX = 'hex'
IN = 'in'
JAVA = 'java'
JPEG = 'jpeg'
JPG = 'jpg'
JSON = 'json'
OUT = 'out'
PNG = 'png'
PNG_URI = 'png_uri'
PY = 'py'
SVG = 'svg'
SVG_URI = 'svg_uri'
TMP = 'tmp'
TXT = 'txt'
URL = 'url'
WEBP = 'webp'
XLS = 'xls'
XLSX = 'xlsx'
YAML = 'yaml'
YML = 'yml'
ZIP = 'zip'
class play_helpers.ph_formats.PhFormatsGroups

Bases: object

ARCHIVE_OUTPUT_FORMATS_SUPPORTED = ['zip']
class play_helpers.ph_formats.PhMimeTypes

Bases: object

Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/MIME_types#image_types

APNG = 'image/apng'
AVIF = 'image/avif'
GIF = 'image/gif'
JPEG = 'image/jpeg'
PNG = 'image/png'
SVG = 'image/svg+xml'
WEBP = 'image/webp'
format_to_mimetype_mappings = {'apng': 'image/apng', 'avif': 'image/avif', 'gif': 'image/gif', 'jpeg': 'image/jpeg', 'jpg': 'image/jpeg', 'png': 'image/png', 'svg': 'image/png', 'webp': 'image/webp'}

play_helpers.ph_git module

class play_helpers.ph_git.PhGit

Bases: object

Alternatives: https://pypi.org/project/python-git-info/

KEY_GIT_DESCRIBE_ALWAYS = 'git_describe_always'
KEY_GIT_LOCAL_FILE_HEAD = 'git_local_file_head'
KEY_GIT_SUMMARY = 'git_summary'
classmethod execute_command_in_shell(cmd, cwd=None, encoding='utf-8', encoding_errors='replace')
classmethod get_git_info_detailed(key=None, cwd=None, encoding=None, encoding_errors=None, with_path_always=False)
classmethod get_git_summary()
git_cmds_pool = {'git_describe': ['git', 'describe'], 'git_describe_always': ['git', 'describe', '--always'], 'git_local_file_head': ['cat', '../.git/HEAD'], 'git_log_commit_hash': ['git', 'log', '-n', '1', '--pretty=format:%H'], 'git_log_commit_short_hash': ['git', 'log', '-n', '1', '--pretty=format:%h'], 'git_log_commiter_email': ['git', 'log', '-n', '1', '--pretty=format:%ce'], 'git_log_commiter_name': ['git', 'log', '-n', '1', '--pretty=format:%cn'], 'git_log_head': ['git', 'log', '-n', '1', '--pretty=format:%d'], 'git_log_message': ['git', 'log', '-n', '1', '--pretty=format:%s'], 'git_log_parent_hash': ['git', 'log', '-n', '1', '--pretty=format:%P'], 'git_log_parent_short_hash': ['git', 'log', '-n', '1', '--pretty=format:%p'], 'git_log_time': ['git', 'log', '-n', '1', '--pretty=format:%ci'], 'git_log_tree_hash': ['git', 'log', '-n', '1', '--pretty=format:%T'], 'git_log_tree_short_hash': ['git', 'log', '-n', '1', '--pretty=format:%t'], 'git_rev_parse_branch': ['git', 'rev-parse', '--abbrev-ref', 'HEAD'], 'git_rev_parse_hash': ['git', 'rev-parse', 'HEAD'], 'git_rev_parse_short_hash': ['git', 'rev-parse', '--short', 'HEAD'], 'git_summary': ['git', 'log', '-n', '1', '--pretty=format:%h; %d; %ci; %cn <%ce>; %s'], 'git_symbolic-ref_head': ['git', 'symbolic-ref', 'HEAD']}

play_helpers.ph_keys module

class play_helpers.ph_keys.PhKeys

Bases: object

AFTER = 'After : '
ALERT_CSS_CLASS_DANGER = 'danger'
ALERT_CSS_CLASS_DARK = 'dark'
ALERT_CSS_CLASS_DISMISSIBLE = 'dismissible'
ALERT_CSS_CLASS_HEADING = 'heading'
ALERT_CSS_CLASS_INFO = 'info'
ALERT_CSS_CLASS_LIGHT = 'light'
ALERT_CSS_CLASS_PRIMARY = 'primary'
ALERT_CSS_CLASS_SECONDARY = 'secondary'
ALERT_CSS_CLASS_SUCCESS = 'success'
ALERT_CSS_CLASS_WARNING = 'warning'
API = 'api'
APP_CANONICAL_URL = 'app_canonical_url'
APP_CODE = 'app_code'
APP_DESCRIPTION = 'app_description'
APP_DESCRIPTION_LEVEL_1 = 'app_description_level_1'
APP_DESCRIPTION_LEVEL_2 = 'app_description_level_2'
APP_DESCRIPTION_LEVEL_3 = 'app_description_level_3'
APP_DESCRIPTION_LEVEL_4 = 'app_description_level_4'
APP_DESCRIPTION_LEVEL_5 = 'app_description_level_5'
APP_DESCRIPTION_LEVEL_6 = 'app_description_level_6'
APP_END_POINT = 'app_end_point'
APP_GITHUB_PAGES_URL = 'app_github_pages_url'
APP_GITHUB_URL = 'app_github_url'
APP_GIT_SUMMARY = 'app_git_summary'
APP_HEADER = 'app_header'
APP_HEADER_POST = 'app_header_post'
APP_HEADER_PRE = 'app_header_pre'
APP_HOST = 'app_host'
APP_META_AUTHOR = 'app_meta_author'
APP_META_DESCRIPTION = 'app_meta_description'
APP_META_KEYWORDS = 'app_meta_keywords'
APP_PARENT_TITLE = 'app_parent_title'
APP_PARENT_VERSION = 'app_parent_version'
APP_STATS_ID = 'app_stats_id'
APP_TEMPLATE = 'app_template'
APP_TITLE = 'app_title'
APP_URL = 'app_url'
APP_URL_ALT = 'app_url_alt'
APP_URL_API = 'app_url_api'
APP_VERSION = 'app_version'
ARCHIVE_OUTPUT = 'archive_output'
ARCHIVE_OUTPUT_FORMAT = 'archive_output_format'
ARCHIVE_OUTPUT_FORMATS = 'archive_output_formats'
ARCHIVE_OUTPUT_FORMAT_SELECTED = 'archive_output_format_selected'
ASN1PLAY = 'asn1play'
ASN1_ELEMENT = 'asn1_element'
ASN1_MODULE = 'asn1_module'
ASN1_MODULE_VERSION = 'asn1_module_version'
ASN1_OBJECT = 'asn1_object'
ASN1_OBJECTS = 'asn1_objects'
ASN1_OBJECT_ALTERNATE = 'asn1_object_alternate'
ASN1_OBJECT_SELECTED = 'asn1_object_selected'
ASN1_SCHEMA = 'asn1_schema'
ASN1_SCHEMAS = 'asn1_schemas'
ASN1_SCHEMA_SELECTED = 'asn1_schema_selected'
ASN1_SOURCE_PATH_FORMATTED = 'formatted'
ASN1_SOURCE_PATH_MODIFIED = 'modified'
ASN1_SOURCE_PATH_ORG = 'original'
BATCH_PARAMS = 'batch_params'
BEFORE = 'Before: '
BLOCK_LEVEL = 'block_level'
CFG_COUNTERS_STATS = 'cfg_counters_stats'
CFG_COUNTERS_STATS_FORMAT = 'cfg_counters_stats_format'
CFG_HIGHLIGHT_SYNTAX = 'cfg_highlight_syntax'
CFG_HIGHLIGHT_SYNTAX_LANGUAGE = 'cfg_highlight_syntax_language'
CFG_HIGHLIGHT_SYNTAX_STYLE = 'cfg_highlight_syntax_style'
COMPILE_TIME = 'compile_time'
CONTENT_MAPPINGS = 'content_mappings'
DATA_GROUP = 'data_group'
DATE_FIRST_AVAILABLE = 'date_first_available'
DATE_LAST_UPDATE = 'date_last_updated'
DECORATE_QR = 'decorate_qr'
DEFAULT = 'default'
DELETE_BLOCK = 'delete_block'
ENCODING = 'encoding'
ENCODING_ERRORS = 'encoding_errors'
ENCODING_ERRORS_POOL = 'encoding_errors_pool'
ENCODING_ERRORS_SELECTED = 'encoding_errors_selected'
ENCODING_POOL = 'encoding_pool'
ENCODING_SELECTED = 'encoding_selected'
EUICC_PROFILE_PACKAGE = 'eUICC_Profile_Package'
EXCLUDES = 'excludes'
EXCLUDE_END_BLOCK_PATTERN = 'exclude_end_block_pattern'
EXCLUDE_END_BLOCK_PATTERN_IS_REGEX = 'exclude_end_block_pattern_is_regex'
EXCLUDE_SEARCH_PATTERN = 'exclude_search_pattern'
EXCLUDE_SEARCH_PATTERN_IS_REGEX = 'exclude_search_pattern_is_regex'
EXCLUDE_START_BLOCK_PATTERN = 'exclude_start_block_pattern'
EXCLUDE_START_BLOCK_PATTERN_IS_REGEX = 'exclude_start_block_pattern_is_regex'
EXPORT_FILE = 'export_file'
FETCH_ASN1_OBJECTS_LIST = 'fetch_asn1_objects_list'
GET = 'GET'
IMAGE_FORMAT = 'image_format'
INCLUDE_DIRS = 'include_dirs'
INCLUDE_END_BLOCK_PATTERN = 'include_end_block_pattern'
INCLUDE_END_BLOCK_PATTERN_IS_REGEX = 'include_end_block_pattern_is_regex'
INCLUDE_FILES = 'include_files'
INCLUDE_SEARCH_PATTERN = 'include_search_pattern'
INCLUDE_SEARCH_PATTERN_IS_REGEX = 'include_search_pattern_is_regex'
INCLUDE_START_BLOCK_PATTERN = 'include_start_block_pattern'
INCLUDE_START_BLOCK_PATTERN_IS_REGEX = 'include_start_block_pattern_is_regex'
INFO = 'info'
INFO_DATA = 'info_data'
INPUT = 'input'
INPUT_DATA = 'input_data'
INPUT_DICT = 'input_dict'
INPUT_DIR = 'input_dir'
INPUT_ENCODING = 'input_encoding'
INPUT_ENCODING_ERRORS = 'input_encoding_errors'
INPUT_FILE = 'input_file'
INPUT_FORMAT = 'input_format'
INPUT_FORMATS = 'input_formats'
INPUT_FORMAT_SELECTED = 'input_format_selected'
INPUT_LIST = 'input_list'
INPUT_MODES_HIERARCHY = 'input_modes_hierarchy'
INPUT_TUPLE = 'input_tuple'
INPUT_YML = 'input_yml'
INTERNAL = 'internal'
LABEL = 'label'
LABEL_POSITION = 'label_position'
LENGTH = 'length'
LENGTH_IN_DECIMAL = 'length_in_decimal'
LOG = 'log'
LOGIN_PASS_WORD = 'login_pass_word'
LOGIN_USER_NAME = 'login_user_name'
MODE = 'mode'
NAME_MAPPINGS = 'name_mappings'
NAV_BAR_APP_ITEMS = 'nav_bar_app_items'
NON_TLV_NEIGHBOR = 'non_tlv_neighbor'
ONE_LINER = 'one_liner'
OUTPUT = 'output'
OUTPUT_DATA = 'output_data'
OUTPUT_DIC = 'output_dic'
OUTPUT_DIR = 'output_dir'
OUTPUT_ENCODING = 'output_encoding'
OUTPUT_ENCODING_ERRORS = 'output_encoding_errors'
OUTPUT_FILE = 'output_file'
OUTPUT_FILE_NAME_KEYWORD = 'output_file_name_keyword'
OUTPUT_FORMAT = 'output_format'
OUTPUT_FORMATS = 'output_formats'
OUTPUT_FORMAT_SELECTED = 'output_format_selected'
OUTPUT_LIST = 'output_list'
OUTPUT_MODES_HIERARCHY = 'output_modes_hierarchy'
OUTPUT_PATH = 'output_path'
OUTPUT_TUPLE = 'output_tuple'
OUTPUT_VERSION = 'output_version'
OUTPUT_YML = 'output_yml'
PASSWORD = 'password'
PH_KEYS = 'PhKeys'
PLAY_HELPERS = 'playHelpers'
POST = 'POST'
PRINT_INFO = 'print_info'
PRINT_INPUT = 'print_input'
PRINT_OUTPUT = 'print_output'
PROCESS = 'process'
PROCESS_COPY_CLIPBOARD = 'process_copy_clipboard'
PROCESS_DOWNLOAD_OUTPUT = 'process_download_output'
PROCESS_DOWNLOAD_YML = 'process_download_yml'
PROCESS_INPUT = 'process_input'
PROCESS_RESET = 'process_reset'
PROCESS_SAMPLE = 'process_sample'
PROCESS_SAMPLE_RANDOM = 'process_sample_random'
PYTHON = 'Python'
QR_CODE_VERSION = 'qr_code_version'
QR_CODE_VERSIONS = 'qr_code_versions'
QR_CODE_VERSION_SELECTED = 'qr_code_version_selected'
QUITE_MODE = 'quite_mode'
RAW_DATA = 'raw_data'
REMARKS = 'remarks'
REMARKS_GENERATED = 'remarks_generated'
REMARKS_LIST = 'remarks_list'
REPLACE_WITH = 'replace_with'
REPLACE_WITH_IS_REGEX = 'replace_with_is_regex'
RESULT = 'result'
RESULT_PROCESSED = 'result_processed'
RESULT_UNPROCESSED = 'result_unprocessed'
RE_OUTPUT_PATH = 're_output_path'
RE_PARSED_DATA = 're_parsed_data'
RE_PARSE_OUTPUT = 're_parse_output'
ROOT_PATH = 'root_path'
RUN_TIME = 'run_time'
SAMPLE = 'sample'
SAMPLES = 'samples'
SAMPLE_LOAD_AND_SUBMIT = 'load_and_submit'
SAMPLE_LOAD_ONLY = 'load_only'
SAMPLE_OPTION = 'sample_option'
SAMPLE_SELECTED = 'sample_selected'
SCALE = 'scale'
SGP22 = 'SGP22'
SGP32 = 'SGP32'
SIZE = 'size'
SIZES = 'sizes'
SIZE_SELECTED = 'size_selected'
SPLIT_QRS = 'split_qrs'
TESTIMONIAL_POST = 'testimonial_post'
TESTIMONIAL_POSTS = 'testimonial_posts'
TESTIMONIAL_POST_CONTENT = 'testimonial_post_content'
TESTIMONIAL_POST_CREATED = 'testimonial_post_created'
TESTIMONIAL_POST_ID = 'testimonial_post_id'
TESTIMONIAL_POST_PUBLISHER = 'testimonial_post_publisher'
TESTIMONIAL_POST_TITLE = 'testimonial_post_title'
TEST_CASE_FILE_NAME = 'test_case_file_name'
TEST_CASE_ID = 'test_case_id'
TEST_CASE_NAME = 'test_case_name'
TIME_STAMP = 'time_stamp'
TLV_PARSING_OF_OUTPUT = 'tlv_parsing_of_output'
TRANSACTION_ID = 'transaction_id'
TRAVERSE_MODE = 'traverse_mode'
UNKNOWN = 'unknown'
URL_ALL_CERTS = 'url_all_certs'
URL_CERT_FETCH_ONLY = 'url_cert_fetch_only'
URL_PRE_ACCESS = 'url_pre_access'
URL_TIME_OUT = 'url_time_out'
URL_TIME_OUTS = 'url_time_outs'
URL_TIME_OUT_SELECTED = 'url_time_out_selected'
USERNAME = 'username'
VALUE_IN_ASCII = 'value_in_ascii'
VAR_ERROR_HANDLING_MODE = 'error_handling_mode'
VAR_EXECUTION_MODE = 'execution_mode'
VAR_TOP_FOLDER_PATH = 'top_folder_path'
VERSION = 'version'

play_helpers.ph_modes_error_handling module

class play_helpers.ph_modes_error_handling.PhErrorHandlingModes

Bases: object

CONTINUE_ON_ERROR = 2
STOP_ON_ERROR = 1

play_helpers.ph_modes_execution module

class play_helpers.ph_modes_execution.PhExecutionModes

Bases: object

ALL = 6
CLI = 9
DEV = 2
KEYS_NAME = {1: 'user', 2: 'dev', 3: 'unit_testing', 4: 'sample_specific', 5: 'sample_generic', 6: 'all', 7: 'unit_testing_external', 8: 'samples_list', 9: 'cli', 22: 'known_issues', 999: 'pj_exclusive'}
KNOWN_ISSUES = 22
PJ_EXCLUSIVE = 999
SAMPLES_LIST = 8
SAMPLE_GENERIC = 5
SAMPLE_SPECIFIC = 4
UNIT_TESTING = 3
UNIT_TESTING_EXTERNAL = 7
USER = 1
classmethod get_key_name(key)

play_helpers.ph_modules module

class play_helpers.ph_modules.PhApps

Bases: object

BEYOND_COMPARE = 'beyond compare'
NOTEPAD_PLUS_PLUS = 'notepad++'
class play_helpers.ph_modules.PhModules

Bases: object

PLAY_HELPERS = 'playHelpers'
PYCRATE = 'pycrate'
PYCRATE_VERSION_SUPPORTING_MULTI_LINE_COMMENTS = '0.5.4'
SEGNO = 'segno'

play_helpers.ph_process module

class play_helpers.ph_process.PhProcess

Bases: object

Alternatives: https://pypi.org/project/python-git-info/

classmethod execute_command_in_shell(cmd, cwd=None, encoding='utf-8', encoding_errors='replace', strip_data=True, fail_safe=False)
classmethod open_file(file_path)
classmethod run_batch_file(batch_file_path)

Run a batch file

Parameters:

batch_file_path

Returns:

play_helpers.ph_time module

class play_helpers.ph_time.PhTime

Bases: object

__init__()
get_state()
print()
Returns:

result()
start()
Returns:

stop()
Returns:

class play_helpers.ph_time.TimeStates

Bases: object

TIMER_INIT = 1
TIMER_OFF = 3
TIMER_ON = 2
name_mapping = {1: 'TIMER_INIT', 2: 'TIMER_ON', 3: 'TIMER_OFF'}

play_helpers.ph_util module

class play_helpers.ph_util.PhUtil

Bases: object

__init__()
classmethod adjust_paths(execution_from_inside=False, folder_path=None)
Parameters:
  • execution_from_inside

  • folder_path

Returns:

classmethod all_chars_to_utf8(input_text, current_encoding=None, target_encoding='utf-8', encoding_errors='replace', via_regex=True)
classmethod analyse_data(str_hex_data, cmt_to_print='', print_also=False, log=None)
Parameters:
  • str_hex_data

  • cmt_to_print

  • print_also

  • log

Returns:

classmethod analyse_profile(base_profile, imp_info=False)
classmethod append_in_file_name(str_file_path, str_append=None, sep=None, new_name=None, new_ext=None, file_path_is_dir=None, ext_available_in_file_name=None, append_post=None, treat_folder_as_file=False, default_ext=None)
Parameters:
  • default_ext

  • treat_folder_as_file

  • str_file_path

  • str_append

  • sep

  • new_name

  • new_ext

  • file_path_is_dir

  • ext_available_in_file_name

  • append_post

Returns:

classmethod append_path(dir_file_list)
Parameters:

dir_file_list

Returns:

classmethod append_remarks(main_remarks, additional_remarks=None, max_length=116, append_mode_post=True)
classmethod archive_files(source_files_dir, archive_format='.zip', delete_dir_after_archive=False, export_hash=False)
classmethod ascii_to_hex_str(ascii_str)
classmethod backup_file_name(str_file_path, default_file_ext='.bkp', default_key_word='backup', file_path_is_dir=None)
classmethod check_and_assign(primary_value, secondary_value)
Parameters:
  • primary_value

  • secondary_value

Returns:

classmethod check_if_iter(the_iter, list_as_str, check_for_dict_attibute)
classmethod clean_names(lst)
classmethod clear_quotation_marks(v)
classmethod combine_list_items(list_data, trim_data=True, clean_data=True, sep='; ', filter_none=True, sep_data_set=None)
Parameters:
  • sep_data_set

  • list_data

  • trim_data

  • clean_data

  • sep

  • filter_none

Returns:

classmethod combine_list_items_lite(list_data, sep_data='\n', sep_data_set='     -----     ')
Parameters:
  • sep_data

  • sep_data_set

  • list_data

  • sep

Returns:

classmethod compare_two_data_frame(file_input_left, file_input_right, col_name, file_result='', sort=False, print_shape=True, print_frame=False, encoding=None, log=None)
classmethod count(main_str, sub_string, start=None, end=None)
classmethod cpu_usage()
Returns:

classmethod create_zip(zip_file_name, source_dir, keep_source_dir_in_zip=False, include_files=None, include_dirs=None, excludes=None)
classmethod dec_to_hex(dec_num, digit_required=None, even_digits=True, signed_byte_handling=True)
Parameters:
  • dec_num

  • digit_required

  • even_digits

  • signed_byte_handling – Byte in Java is represented by signed int in range (-128, 127), Byte Python is represented by unsigned int in range(0, 255).

Returns:

classmethod decode_to_base64_if_hex(raw_data)
Parameters:

raw_data

Returns:

classmethod decode_to_hex_if_base64(raw_data)
Parameters:

raw_data

Returns:

classmethod decorate_info_data(info_data_pool)
classmethod decorate_output_data(output_data)
classmethod dict_clean(dict1)
classmethod dict_merge(dict1, dict2)
classmethod dict_to_data(user_dict, data_types_include={}, data_types_exclude={}, trim_quotation_marks=True, trim_data=True, replace_line_endings=True)
classmethod dict_update(dict1, key_pair_list)
classmethod enclose(format, data1, data2='', indent_level=0)
classmethod extend_list(obj, expected_length=0, filler='', unique_entries=False, trim_data=False)
classmethod file_dir_exists(file_path)
classmethod find_offset_of_next_non_white_space_char(temp, current_offset)
classmethod find_offset_of_section(data, char_to_find, corresponding_char_to_find)

Considering Ideal Scenario: Any target char is not present as a comment Data Pattern is correct,target characters are available in pairs

Parameters:
  • data

  • char_to_find

  • corresponding_char_to_find

Returns:

classmethod format_data_as_hex(str_data)
Parameters:

str_data

Returns:

classmethod format_profile_parsing_log(profile_hex_data, profiles_asn_data, profile_name=None)
Parameters:
  • profile_hex_data

  • profiles_asn_data

  • profile_name

Returns:

dict with log_folder, log_name, log_data

classmethod format_time(time_value, time_interval=False)
classmethod format_tool_name_w_version(tool_name, tool_version, dic_format)
classmethod gen_acc(str_imsi)
Parameters:

str_imsi

Returns:

classmethod gen_isim_data(imsi, mcc_mnc, pattern_or_data)
Parameters:
  • imsi

  • mcc_mnc

  • pattern_or_data – Could be pattern as well as real data

Returns:

classmethod generalise_list(data_list, append_na=True, sort=True, append_others=False)
classmethod generalise_list_reverse(data_list)
classmethod generate_hash(files_list, hash_file_path)
classmethod generate_key_and_data_group(remarks)
classmethod generate_range_str(start_point, end_point, func=None)
classmethod generate_test_data(require_length, sample_data=None, sep=None)
classmethod generate_transaction_id()
classmethod get_absolute_path(rel_path)
classmethod get_all_installed_distributions(dic_format=False)

Retrieves the names and versions of all installed distributions.

Parameters:

dic_format

Returns:

classmethod get_classes_list(module_to_explore, parent_class=None, obj_name_needed=True, sort=True, print_also=False)
classmethod get_current_dir_path()
classmethod get_current_func_name(parent_level=1)
classmethod get_current_script_folder()
classmethod get_current_script_path()
classmethod get_dic_data_and_print(key, sep, value, dic_format=True, print_also=True, length_needed=False)
classmethod get_directory_path(path)
classmethod get_environment_variables(var_name, var_default_value=None, check_presence_only=False)
Parameters:
  • var_name

  • var_value

  • check_presence_only

Returns:

classmethod get_file_name_and_extn(file_path, name_with_out_extn=None, only_extn=None, extn_with_out_dot=None, only_path=None, ext_available=None, path_with_out_extn=None, only_folder_name=None)
Parameters:
  • file_path

  • name_with_out_extn

  • only_extn

  • extn_with_out_dot

  • only_path

  • ext_available

  • path_with_out_extn

  • only_folder_name

Returns:

classmethod get_file_size(file_path, unit_level=None, print_also=False)
classmethod get_help_for_param(help_msg=None, default_value=None, include_none=False)
classmethod get_ip(ipv4=True)
classmethod get_item_from_list(current_list, value_index=None)
classmethod get_key_from_dict_based_on_val(my_dict, value_to_check, operation=None)
classmethod get_key_value_pair(*args, **kwargs)
classmethod get_module_version(module_name='playHelpers', minimum_version_required=None)
Parameters:
  • module_name

  • minimum_version_required

Returns:

classmethod get_obj_list(cls_to_explore, obj_name_filter='', obj_name_needed=True, obj_value_to_find=None, clean_name=False, sort=True, print_also=False)
Parameters:
  • print_also

  • cls_to_explore

  • obj_name_filter

  • obj_name_needed

  • obj_value_to_find

  • clean_name

  • sort

Returns:

classmethod get_python_friendly_name(user_variable_name, all_lower=True, case_sensitive=True)
classmethod get_random_item_from_iter(the_iter, skip_generalise_item=True)
classmethod get_random_string(target_str_length=8, str_type=12)
Parameters:
  • target_str_length

  • str_type

Returns:

classmethod get_random_string_for_variable(var_name)
Parameters:

var_name

Returns:

classmethod get_relative_path(abs_path)
classmethod get_synonym_of_variable_name(var_name, var_type=2)
Parameters:
  • var_name

  • var_type

Returns:

classmethod get_time_stamp(files_format=True, date_only=False, default_format=False)
classmethod get_tool_name_w_version(tool_name=None, tool_version=None, dic_format=False, fetch_tool_version=None)
Parameters:
  • tool_name

  • tool_version

  • dic_format

  • fetch_tool_version

  • list_all_installed

Returns:

classmethod get_user_details_account_name()
Returns:

classmethod get_user_details_display_name()
Returns:

classmethod get_user_friendly_name(*args, **kwargs)
Parameters:
  • args

  • kwargs

Returns:

classmethod get_version_from_name(name, max_depth=None, trim_v=False)
Parameters:
  • name

  • max_depth

  • trim_v

Returns:

classmethod hex_str_to_ascii(str_data, only_if_printable=True, encoding='utf-8', encoding_errors='strict')
classmethod hex_str_to_dec(hex_str, signed_byte_handling=False)
Parameters:
  • hex_str

  • signed_byte_handling – Byte in Java is represented by signed int in range (-128, 127), Byte Python is represented by unsigned int in range(0, 255).

Returns:

classmethod hex_str_to_dec_list(hex_str, signed_byte_handling=False)
Parameters:
  • hex_str

  • signed_byte_handling – Byte in Java is represented by signed int in range (-128, 127), Byte Python is represented by unsigned int in range(0, 255).

Returns:

classmethod is_ascii(s)
classmethod is_base64(s)

Data Set is: [A-Za-z0-9+/] :param s: :return:

classmethod is_clean_name(name)
Parameters:

name

Returns:

classmethod is_empty(value)
classmethod is_empty_or_comment_string(str_data, comments_pool=None)

Check if line is a comment :param str_data: :param comments_pool: :return:

classmethod is_empty_string(str_data)
Parameters:

str_data

Returns:

classmethod is_generalised_item(item, target_item='-- Select --')
classmethod is_hex(s)
classmethod is_none(value)
classmethod is_not_empty(value)
classmethod is_not_empty_string(str_data)
Parameters:

str_data

Returns:

classmethod is_not_none(value)
classmethod is_numeric(s)
classmethod last_modification_time(file_or_folder_path)
classmethod len_even(str_data)
classmethod len_hex(str_hex_data, output_in_str_format=False)
classmethod len_odd(str_data)
classmethod list_clean(list1)
classmethod lstrip_hex_str(hex_str)
classmethod lstrip_str(plain_str, data_to_strip)
classmethod make_dirs(dir_path=None, file_path=None, absolute_path_needed=False, quite_mode=True)
name_current_script = 'ph_util.py'
classmethod normalise_list(user_list)
classmethod normalise_name_pandas_to_user(col_name, all_caps_keywords=None)
Parameters:
  • col_name

  • all_caps_keywords

Returns:

classmethod normalise_name_user_to_pandas(col_name, upper_case=True, fix_names=[])
classmethod normalise_user_input(user_input)
Parameters:

user_input

Returns:

path_current_folder = '/home/docs/checkouts/readthedocs.org/user_builds/playhelpers/checkouts/latest'
path_current_script = '/home/docs/checkouts/readthedocs.org/user_builds/playhelpers/checkouts/latest/play_helpers/ph_util.py'
path_default_bkp_folder = '/home/docs/checkouts/readthedocs.org/user_builds/playhelpers/checkouts/latest/backup'
path_default_data_bkp_folder = '/home/docs/checkouts/readthedocs.org/user_builds/playhelpers/checkouts/latest/data/backup'
path_default_data_folder = '/home/docs/checkouts/readthedocs.org/user_builds/playhelpers/checkouts/latest/data'
path_default_log_folder = '/home/docs/checkouts/readthedocs.org/user_builds/playhelpers/checkouts/latest/logs'
path_default_out_folder = '/home/docs/checkouts/readthedocs.org/user_builds/playhelpers/checkouts/latest/out'
path_default_res_folder = '/home/docs/checkouts/readthedocs.org/user_builds/playhelpers/checkouts/latest/res'
path_default_tst_folder = '/home/docs/checkouts/readthedocs.org/user_builds/playhelpers/checkouts/latest/tests'
path_python_executable = '/home/docs/checkouts/readthedocs.org/user_builds/playhelpers/envs/latest/bin/python'
path_python_folder = '/home/docs/checkouts/readthedocs.org/user_builds/playhelpers/envs/latest/bin'
path_python_script_folder = '/home/docs/checkouts/readthedocs.org/user_builds/playhelpers/envs/latest/bin/Scripts'
classmethod popup_msg(msg, caption=None, no_user_interation=False)
classmethod prepare_file_name(keywords_list, file_ext='.txt', time_stamp=True)
classmethod print(data='', log=None)
classmethod print_all_environment_variables(custom_only=False)
Parameters:

custom_only

Returns:

classmethod print_all_installed_distributions(dic_format=False)
classmethod print_cmt(main_text='', character='-', count=40, log=None, quite_mode=False)
classmethod print_data(cmt_to_print, str_hex_data='', log=None)
classmethod print_data_frame(output, cmt='', level=0, log=None)
Parameters:
  • output

  • cmt

  • level

  • log

Returns:

classmethod print_data_frame_shape(output, cmt='', level=1, log=None)
classmethod print_done(main_text='All Done.', log=None, with_time_stamp=True)
classmethod print_error(str_heading, log=None)
classmethod print_heading(str_heading=None, heading_level=1, char=None, max_length=None, log=None, parent_level=None)
Parameters:
  • str_heading

  • heading_level

  • char

  • max_length

  • log

Returns:

classmethod print_input_output(input_data=None, output_data=None, log=None, verbose=False, output_remarks=None, input_remark=None, mode='input_w_output', heading=None, sep_data=None, sep_data_set=None)
Parameters:
  • input_data

  • output_data

  • log

  • verbose

  • output_remarks

  • input_remark

  • mode

  • heading

  • sep_data

  • sep_data_set

Returns:

classmethod print_iter(the_iter, header=None, log=None, list_as_str=None, depth_level=-1, verbose=False, formatting_level=0, sep=None, sep_child=None, check_for_dict_attribute=None)

This function takes a positional argument called ‘the_iter’, which is any Python list (of, possibly, nested lists). Each data item in the provided list is (recursively) printed to the screen on its own line.

Parameters:
  • sep

  • sep_child

  • verbose

  • formatting_level

  • depth_level

  • the_iter

  • header

  • log

  • list_as_str

  • check_for_dict_attribute – Force checking of Dict Attribute while checking for iter object. However, it may caused “RecursionError” for unhandled types

For “RecursionError”, set this flag as false :return:

classmethod print_modules(filter_string=None, depth_level=0)
classmethod print_output(heading=None, output_data=None, log=None, sep_data=None, sep_data_set=None)
Parameters:
  • heading

  • output_data

  • log

  • sep_data

  • sep_data_set

Returns:

classmethod print_separator(character='-', count=80, main_text='', log=None, get_only=False, multi_line=False)
Parameters:
  • multi_line

  • character

  • count

  • main_text

  • log

  • get_only

Returns:

classmethod print_version(tool_name=None, tool_version=None, fetch_tool_version=False, log=None, parameters_pool=None, no_additional_info=False, with_python=True, with_ph_lib=True, with_user_info=True, with_time_stamp=True, with_git_summary=True, with_ip=False, with_git_detailed_info=False, get_only=False, dic_format=False)
Parameters:
  • tool_name

  • tool_version

  • fetch_tool_version

  • log

  • parameters_pool – List of Dicts containing parameters

  • no_additional_info

  • with_python

  • with_ph_lib

  • with_user_info

  • with_time_stamp

  • with_git_summary

  • with_ip

  • with_git_detailed_info

  • get_only

  • dic_format

Returns:

classmethod print_work_in_progress(main_text='Work In Progress', append_function_name=True, log=None)
classmethod read_csv(file_name, sep='\\s+', rename_col=False, comment='*', print_shape=True, print_frame=False, names=None, encoding=None, log=None)
classmethod remove_dirs(dir_path=None, file_path=None, absolute_path_needed=False, quite_mode=True)
classmethod remove_file(file_path)
classmethod replace_line_endings(v)
classmethod replace_multiple(input_text, replacement_characters_dict)
classmethod rreplace(main_str, old, new, max_split=1)
classmethod rstrip_hex_str(hex_str)
classmethod rstrip_str(plain_str, data_to_strip)
classmethod set_if_empty(current_value, new_value='', new_type=None)
classmethod set_if_none(current_value, new_value='', new_type=None)
classmethod set_if_unknown(current_value, known_values=[], default_value=None, default_value_index=0)
Parameters:
  • current_value

  • known_values

  • default_value

  • default_value_index

Returns:

classmethod set_type_if_different(value=None, new_type=None)
classmethod str_insert_char_repeatedly(my_str, group=3, char=',', reverse=False)
classmethod str_to_bool(value)
Parameters:

value

Returns:

classmethod strip_all_columns(df_input)
classmethod swap_nibbles_str(hex_str_data, pad_if_required=True)

Swap nibbles in a hex string. len(s) must be even otherwise ValueError will be raised.

classmethod test(actual, expected)

Simple provided test() function used in other functions() to print what each function returns vs. what it’s supposed to return. :param actual: any Object (Actual Output) :param expected: any Object (Expected Output) :return: None

classmethod to_csv(output, file_name, str_append='', new_ext='', sep=' ', index=False, print_shape=True, print_frame=False, log=None, encoding='utf-8', encoding_errors='replace')
Parameters:
  • output – DataFrame

  • file_name

  • str_append

  • new_ext

  • sep

  • index

  • print_shape

  • print_frame

  • encoding

  • log

Returns:

classmethod to_file(output_lines, file_name='', str_append='', new_ext='', lines_sep='\n', encoding='utf-8', encoding_errors='replace', back_up_file=False, file_path_is_dir=None)
Parameters:
  • file_path_is_dir

  • output_lines

  • file_name

  • str_append

  • new_ext

  • lines_sep

  • encoding

  • encoding_errors

  • back_up_file

Returns:

classmethod to_hex_string(bytes_data=[], required_format=0)

Returns a hex string representing bytes

Parameters:
  • bytes_data – a list of bytes to stringify; e.g. [59, 22, 148, 32, 2, 1, 0, 0, 13]

  • required_format – a logical OR of - COMMA: add a comma between bytes - HEX: add the 0x chars before bytes - UPPERCASE: use 0X before bytes (need HEX) - PACK: remove blanks

Returns:

classmethod to_json(json_data, json_file_path)
classmethod to_list(obj, all_str=False, trim_data=True)
classmethod to_list_lite(obj)
Parameters:
  • obj

  • all_str

  • trim_data

Returns:

classmethod traverse_it(top='/home/docs/checkouts/readthedocs.org/user_builds/playhelpers/checkouts/latest', traverse_mode='Regex', include_files=None, include_dirs=None, excludes=None, detail_info=False, print_also=False)

Usage: python <programName.py> <folderName>

glob: https://en.wikipedia.org/wiki/Glob_(programming)

Parameters:
  • top

  • traverse_mode

  • include_files – applicable only when traverseMode is ‘Regex’ Sample: [’.mp3’, ‘.mp4’]

  • include_dirs

  • excludes – for dirs and files, applicable only when traverseMode is ‘Regex’ Sample1: [‘/home/paulo-freitas/Documents’] Sample2: [‘E:EntertainmentSongs_Mp319’s’, ‘E:EntertainmentSongs_Mp32000-2009’]

  • detail_info

  • print_also

Returns:

traverse_modes = ['ImmediateFilesOnly', 'ImmediateFoldersOnly', 'ImmediateFolderAndFiles', 'RecursiveFilesOnly', 'RecursiveFoldersOnly', 'RecursiveAll', 'Regex']
classmethod trim_and_kill_all_white_spaces(str_data)
classmethod trim_and_kill_extra_white_spaces(str_data)
classmethod trim_remarks(user_remarks, max_length=116)
classmethod trim_white_spaces_in_str(data)
classmethod valid_index_of_list(current_list, value_index=None)
classmethod zip_and_clean_dir(source_files_dir, target_dir=None, target_file_name_wo_extn=None, delete_dir_after_zip=False, keep_source_dir_in_zip=False, export_hash=True, include_files=None, include_dirs=None, excludes=None)

play_helpers.ph_variables module

class play_helpers.ph_variables.PhVariables

Bases: object

ASN1_ELEMENT = '$asn1_element'
CONTENT_MAPPINGS = '$content_mappings'
DECORATE_QR = '$decorate_qr'
INPUT_FORMAT = '$input_format'
ITEM_INDEX = '$ITEM_INDEX'
KEY_NAME = '$KEY_NAME'
LABEL = '$label'
LABEL_POSITION = '$label_position'
LENGTH_IN_DECIMAL = '$length_in_decimal'
NAME_MAPPINGS = '$name_mappings'
NON_TLV_NEIGHBOR = '$non_tlv_neighbor'
ONE_LINER = '$one_liner'
OUTPUT_FORMAT = '$output_format'
QR_CODE_VERSION = '$qr_code_version'
REMARKS = '$remarks'
RE_PARSE_OUTPUT = '$re_parse_output'
SIZE = '$size'
SPLIT_QRS = '$split_qrs'
TLV_PARSING_OF_OUTPUT = '$tlv_parsing_of_output'
URL_ALL_CERTS = '$url_all_certs'
URL_CERT_FETCH_ONLY = '$url_cert_fetch_only'
URL_PRE_ACCESS = '$url_pre_access'
URL_TIME_OUT = '$url_time_out'
VALUE_IN_ASCII = '$value_in_ascii'
VERSION = '$version'

Module contents