plkit
#
A package for automating EUBC PlayerLayer kit orders
Modules:
-
generate_order_form–Functions and classes for generating order forms given order information
-
read_orders–Functions and classes for reading in order information from the excel sheet
-
validate–
Functions:
-
read_order–Obtain the order information for a specific person
-
extract_orders–Read in the order response form as a pandas DataFrame.
-
generate_product_order–Generate a DataFrame of product-specific order information,
-
generate_product_personalisations–Generate a DataFrame of product-specific order personalisations,
-
assert_order_count–Assert that the item count in the DataFrame of
-
assert_back_personalisations–Assert that the back name personalisations count in the
-
assert_sleeve_personalisations–Assert that the sleeve name personalisations count in the
-
count_initial_order–Internal function to count the total number of orders
-
count_initial_back_personalisations–Internal function to count the total
-
count_initial_sleeve_personalisations–Internal function to count the total number of orders
-
count_processed_order–Internal function to count the total number of items in a
-
count_processed_back_personalisations–Internal function to count the total number of requested back
-
count_processed_sleeve_personalisations–Internal function to count the total number of requested back
read_order
#
Obtain the order information for a specific person
Parameters#
df_orders: pd.DataFrame The pandas DataFrame containing all the order information name : str The name of the person placing the order email : str, optional The email address of the person placing the order
Returns#
order : class Instance of the Order class for the specified name
Source code in plkit/read_orders.py
extract_orders
#
Read in the order response form as a pandas DataFrame.
Parameters#
filename : str, optional The name of the responses form saved from Microsoft forms
Returns#
df_orders : pd.DataFrame The order details converted to a pandas DataFrame
Source code in plkit/read_orders.py
generate_product_order
#
Generate a DataFrame of product-specific order information, given a DataFrame of orders
Parameters#
df_orders: _pd.DataFrame The order details converted to a pandas DataFrame
Returns#
df_products: _pd.DataFrame Full order details for every product, completed with the orders contained in df_orders
Source code in plkit/generate_order_form.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | |
generate_product_personalisations
#
Generate a DataFrame of product-specific order personalisations, given a DataFrame of orders
Parameters#
df_orders: _pd.DataFrame The order details converted to a pandas DataFrame
Returns#
df_personal: _pd.DataFrame Full personalisation details for every product, completed with the orders contained in df_orders
Source code in plkit/generate_order_form.py
assert_order_count
#
Assert that the item count in the DataFrame of products to order matches the total number of items in the initial order.
Parameters#
df_orders: _pd.DataFrame The order details converted to a pandas DataFrame df_products: _pd.DataFrame Full order details for every product, completed with the orders contained in df_orders
Returns#
None
Source code in plkit/validate/tests.py
assert_back_personalisations
#
Assert that the back name personalisations count in the DataFrame of products to order matches the total number of personalisations in the initial order.
Parameters#
df_orders: _pd.DataFrame The order details converted to a pandas DataFrame df_personal: __pd.DataFrame Full personalisation details for every product, completed with the orders contained in df_orders
Returns#
None
Source code in plkit/validate/tests.py
assert_sleeve_personalisations
#
Assert that the sleeve name personalisations count in the DataFrame of products to order matches the total number of personalisations in the initial order.
Parameters#
df_orders: _pd.DataFrame The order details converted to a pandas DataFrame df_personal: __pd.DataFrame Full personalisation details for every product, completed with the orders contained in df_orders
Returns#
None
Source code in plkit/validate/tests.py
count_initial_order
#
Internal function to count the total number of orders Some code is repeated in count_initial_back_personalisations and count_initial_sleeve_personalisations but cba to change it
Source code in plkit/validate/tests.py
count_initial_back_personalisations
#
Internal function to count the total number of back name personalisations
Source code in plkit/validate/tests.py
count_initial_sleeve_personalisations
#
Internal function to count the total number of orders
Source code in plkit/validate/tests.py
count_processed_order
#
Internal function to count the total number of items in a processed order form - could make this a bit simpler actually
Source code in plkit/validate/tests.py
count_processed_back_personalisations
#
Internal function to count the total number of requested back name personalisations
Source code in plkit/validate/tests.py
count_processed_sleeve_personalisations
#
Internal function to count the total number of requested back name personalisations