├── usecase.pdf ├── RES ├── front.png ├── exo_dataset_P001.xlsx └── card.css ├── LICENSE ├── OUTPUT ├── index.html └── ID Card Generator.ipynb └── README.md /usecase.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedaElmar/ID-Cards-Generator/HEAD/usecase.pdf -------------------------------------------------------------------------------- /RES/front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedaElmar/ID-Cards-Generator/HEAD/RES/front.png -------------------------------------------------------------------------------- /RES/exo_dataset_P001.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedaElmar/ID-Cards-Generator/HEAD/RES/exo_dataset_P001.xlsx -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Reda Elmar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /OUTPUT/index.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
Jameson Hugueville

5 |
Teacher
6 |
7 |
8 |
9 |
2261412840
10 |
12-05-1991
11 |
02-01-2019
12 |
13 |
14 | 15 | -------------------------------------------------------------------------------- /RES/card.css: -------------------------------------------------------------------------------- 1 | @page { 2 | /* dimensions for the whole page */ 3 | size: 74mm 51.7mm; 4 | 5 | margin: 0; 6 | } 7 | 8 | html { 9 | /* off-white, so body edge is visible in browser */ 10 | background: #eee; 11 | } 12 | 13 | body { 14 | height: 51.7mm; 15 | width: 74mm; 16 | 17 | margin: 0; 18 | } 19 | #BARCODE { 20 | z-index: 11; 21 | width: 7cm; 22 | height: 0.8cm; 23 | position: fixed; 24 | top: 0; 25 | margin-top: 41mm; 26 | margin-left: 3mm; 27 | 28 | } 29 | /* fill half the height with each face */ 30 | .face { 31 | height: 100%; 32 | width: 100%; 33 | position: relative; 34 | } 35 | 36 | /* an image that fills the whole of the front face */ 37 | .face-front img { 38 | position: absolute; 39 | top: 0; 40 | left: 0; 41 | bottom: 0; 42 | right: 0; 43 | width: 100%; 44 | height: 100%; 45 | } 46 | #infoi { 47 | width: 50mm; 48 | height: 35mm; 49 | position: fixed; 50 | top: 0; 51 | text-align: center; 52 | margin-left: -12.5mm; 53 | margin-top: -0.8mm; 54 | } 55 | #infoi { 56 | z-index: 10; 57 | } 58 | #info { 59 | width: 69mm; 60 | height: 50mm; 61 | position: fixed; 62 | top: 0; 63 | text-align: right; 64 | margin-top: 15mm; 65 | } 66 | #info { 67 | z-index: 09; 68 | } 69 | #infoi img { 70 | position: relative; 71 | margin-left: 7.8mm; 72 | margin-top: 5.7mm; 73 | 74 | 75 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ![header](https://user-images.githubusercontent.com/30802364/69887234-e65abc80-12dd-11ea-8111-3643447fd4ca.PNG) 3 | 4 | # ID Card Generator Project P001 CODE ESI 5 | 6 | ### Imports 7 | 8 | 9 | ```python 10 | import pandas as pd 11 | import pdfkit 12 | from datetime import datetime, timedelta 13 | import code128 14 | import random 15 | ``` 16 | 17 | ### Functions 18 | 19 | 20 | ```python 21 | #generate costum html file using the arguments 22 | def HTMLgen(code,first_name,last_name,function,date_of_birth,picture,expiration_date): 23 | html= r"""
24 |
25 |
26 |
@fname @lname

27 |
@function
28 |
29 |
30 |
31 |
@code
32 |
@date_of_birth
33 |
@expiration_date
34 |
35 |
36 | 37 | """ 38 | html = html.replace("@picture",picture) 39 | html = html.replace("@code",str(code)) 40 | html = html.replace("@fname",first_name) 41 | html = html.replace("@lname",last_name) 42 | html = html.replace("@function",function) 43 | html = html.replace("@date_of_birth",date_of_birth) 44 | html = html.replace("@expiration_date",expiration_date) 45 | f= open("index.html","w") 46 | f.write(html) 47 | f.close() 48 | return 49 | #generate a file bar.png contains barcode of the 10 digits code 50 | def BARgen(code): 51 | code128.image(code).save("../RES/bar.png") 52 | return 53 | #generate costum pdf file using the existing html file // code argument is only to name the file generated 54 | def PDFgen(code): 55 | config = pdfkit.configuration(wkhtmltopdf='C:\\Program Files\\wkhtmltopdf\\bin\\wkhtmltopdf.exe') 56 | options = {'dpi': 365,'margin-top': '0in','margin-bottom': '0in','margin-right': '0in','margin-left': '0in','page-size': 'A8',"orientation": "Landscape",'disable-smart-shrinking': ''} 57 | pdfkit.from_file('index.html', str(code)+".pdf",configuration=config , options = options) 58 | return 59 | #complete with random digits an integer x until it contains 10 digits 60 | def complete(x): 61 | x=str(x) 62 | while len(x)<10: 63 | x+=str(random.randint(0,9)) 64 | return int(x) 65 | ``` 66 | 67 | ### Import Dataset 68 | 69 | 70 | ```python 71 | data=pd.read_excel("../RES/exo_dataset_P001.xlsx") 72 | ``` 73 | 74 | ### Show Sample 75 | 76 | 77 | ```python 78 | data.head(5) 79 | ``` 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 |
codefirst_namelast_namefunctiondate_of_birthsubmission_datepicture
05591927432PrentHickenbottomSenior Editor4/3/199322/1/2019https://robohash.org/quidemsaepequi.png?size=3...
15071682362JardSteinGeological Engineer15/7/199210/4/2019https://robohash.org/teneturautsunt.png?size=3...
26295398980LevonNoenResearch Assistant IV12/10/199927/3/2019https://robohash.org/quaeetsed.png?size=300x30...
33718164078NonahScogginJunior Executive9/7/200021/1/2019https://robohash.org/debitisinciduntdolore.png...
42261412840JamesonHuguevilleTeacher5/12/19911/2/2019https://robohash.org/facilisrerumad.png?size=3...
148 | 149 | 150 | some of the code column entries are only 9 digits or less, so we will add some random degits to them. 151 | 152 | 153 | ```python 154 | data['code'] = data['code'].apply(lambda x: complete(x)) 155 | ``` 156 | 157 | 158 | ```python 159 | data.dtypes 160 | ``` 161 | 162 | 163 | 164 | 165 | code int64
166 | first_name object
167 | last_name object
168 | function object
169 | date_of_birth object
170 | submission_date object
171 | picture object
172 | dtype: object
173 | 174 | 175 | 176 | ### convert to datetime elements 177 | 178 | 179 | ```python 180 | data['submission_date']=pd.to_datetime(data['submission_date']) 181 | data['date_of_birth'] = pd.to_datetime(data['date_of_birth']) 182 | ``` 183 | 184 | 185 | ```python 186 | data.dtypes 187 | ``` 188 | 189 | 190 | 191 | 192 | code int64
193 | first_name object
194 | last_name object
195 | function object
196 | date_of_birth datetime64[ns]
197 | submission_date datetime64[ns]
198 | picture object
199 | dtype: object
200 | 201 | 202 | 203 | 204 | ```python 205 | data.head(5) 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 |
codefirst_namelast_namefunctiondate_of_birthsubmission_datepicture
05591927432PrentHickenbottomSenior Editor1993-04-032019-01-22https://robohash.org/quidemsaepequi.png?size=3...
15071682362JardSteinGeological Engineer1992-07-152019-10-04https://robohash.org/teneturautsunt.png?size=3...
26295398980LevonNoenResearch Assistant IV1999-12-102019-03-27https://robohash.org/quaeetsed.png?size=300x30...
33718164078NonahScogginJunior Executive2000-09-072019-01-21https://robohash.org/debitisinciduntdolore.png...
42261412840JamesonHuguevilleTeacher1991-05-122019-01-02https://robohash.org/facilisrerumad.png?size=3...
278 |
279 | 280 | 281 | 282 | ### add expiration date column (submission date + 15 days) 283 | 284 | 285 | ```python 286 | data["expiration_date"] = data["submission_date"] + timedelta(days=15) 287 | ``` 288 | 289 | ### Controlling date form DD-MM-YYYY 290 | 291 | 292 | ```python 293 | data['date_of_birth']=data['date_of_birth'].dt.strftime('%d-%m-%Y') 294 | data['submission_date']=data['submission_date'].dt.strftime('%d-%m-%Y') 295 | data['expiration_date']=data['expiration_date'].dt.strftime('%d-%m-%Y') 296 | ``` 297 | 298 | 299 | ```python 300 | data.head(5) 301 | ``` 302 | 303 | 304 | 305 | 306 |
307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 |
codefirst_namelast_namefunctiondate_of_birthsubmission_datepictureexpiration_date
05591927432PrentHickenbottomSenior Editor03-04-199322-01-2019https://robohash.org/quidemsaepequi.png?size=3...06-02-2019
15071682362JardSteinGeological Engineer15-07-199204-10-2019https://robohash.org/teneturautsunt.png?size=3...19-10-2019
26295398980LevonNoenResearch Assistant IV10-12-199927-03-2019https://robohash.org/quaeetsed.png?size=300x30...11-04-2019
33718164078NonahScogginJunior Executive07-09-200021-01-2019https://robohash.org/debitisinciduntdolore.png...05-02-2019
42261412840JamesonHuguevilleTeacher12-05-199102-01-2019https://robohash.org/facilisrerumad.png?size=3...17-01-2019
379 |
380 | 381 | 382 | 383 | ### Generating Costumized Pdf files from the dataset 384 | 385 | 386 | ```python 387 | for index, row in data.head(n=5).iterrows() : 388 | code=row[0] 389 | fname = row[1] 390 | lname = row[2] 391 | func = row[3] 392 | dob = row[4] 393 | ed = row[5] 394 | pic = row[6] 395 | BARgen(code) 396 | HTMLgen(code,fname,lname,func,dob,pic,ed) 397 | PDFgen(code) 398 | 399 | ``` 400 | 401 | Loading pages (1/6)
402 | Counting pages (2/6)
403 | Resolving links (4/6)
404 | Loading headers and footers (5/6)
405 | Printing pages (6/6)
406 | Done
407 | 408 | #### **generated 5 pdf files with thier corresponding enteries** 409 | 410 |

411 | 412 |

413 | 414 | ### Thank you 415 | -------------------------------------------------------------------------------- /OUTPUT/ID Card Generator.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "# ID Card Generator Project P001 CODE ESI" 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "metadata": {}, 20 | "source": [ 21 | "### Imports" 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": 1, 27 | "metadata": {}, 28 | "outputs": [], 29 | "source": [ 30 | "import pandas as pd \n", 31 | "import pdfkit\n", 32 | "from datetime import datetime, timedelta\n", 33 | "import code128\n", 34 | "import random" 35 | ] 36 | }, 37 | { 38 | "cell_type": "markdown", 39 | "metadata": {}, 40 | "source": [ 41 | "### Functions" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": 2, 47 | "metadata": {}, 48 | "outputs": [], 49 | "source": [ 50 | "#generate costum html file using the arguments\n", 51 | "def HTMLgen(code,first_name,last_name,function,date_of_birth,picture,expiration_date):\n", 52 | " html= r\"\"\"
\n", 53 | "
\n", 54 | "
\n", 55 | "
@fname @lname

\n", 56 | "
@function
\n", 57 | "
\n", 58 | "
\n", 59 | "
\n", 60 | "
@code
\n", 61 | "
@date_of_birth
\n", 62 | "
@expiration_date
\n", 63 | "
\n", 64 | "
\n", 65 | "\n", 66 | "\"\"\"\n", 67 | " html = html.replace(\"@picture\",picture)\n", 68 | " html = html.replace(\"@code\",str(code))\n", 69 | " html = html.replace(\"@fname\",first_name)\n", 70 | " html = html.replace(\"@lname\",last_name)\n", 71 | " html = html.replace(\"@function\",function)\n", 72 | " html = html.replace(\"@date_of_birth\",date_of_birth)\n", 73 | " html = html.replace(\"@expiration_date\",expiration_date)\n", 74 | " f= open(\"index.html\",\"w\")\n", 75 | " f.write(html)\n", 76 | " f.close()\n", 77 | " return \n", 78 | "#generate a file bar.png contains barcode of the 10 digits code \n", 79 | "def BARgen(code):\n", 80 | " code128.image(code).save(\"../RES/bar.png\")\n", 81 | " return\n", 82 | "#generate costum pdf file using the existing html file // code argument is only to name the file generated\n", 83 | "def PDFgen(code):\n", 84 | " config = pdfkit.configuration(wkhtmltopdf='C:\\\\Program Files\\\\wkhtmltopdf\\\\bin\\\\wkhtmltopdf.exe')\n", 85 | " options = {'dpi': 365,'margin-top': '0in','margin-bottom': '0in','margin-right': '0in','margin-left': '0in','page-size': 'A8',\"orientation\": \"Landscape\",'disable-smart-shrinking': ''}\n", 86 | " pdfkit.from_file('index.html', str(code)+\".pdf\",configuration=config , options = options)\n", 87 | " return \n", 88 | "#complete with random digits an integer x until it contains 10 digits\n", 89 | "def complete(x):\n", 90 | " x=str(x)\n", 91 | " while len(x)<10:\n", 92 | " x+=str(random.randint(0,9))\n", 93 | " return int(x)" 94 | ] 95 | }, 96 | { 97 | "cell_type": "markdown", 98 | "metadata": {}, 99 | "source": [ 100 | "### Import Dataset" 101 | ] 102 | }, 103 | { 104 | "cell_type": "code", 105 | "execution_count": 3, 106 | "metadata": {}, 107 | "outputs": [], 108 | "source": [ 109 | "data=pd.read_excel(\"../RES/exo_dataset_P001.xlsx\")" 110 | ] 111 | }, 112 | { 113 | "cell_type": "markdown", 114 | "metadata": {}, 115 | "source": [ 116 | "### Show Sample" 117 | ] 118 | }, 119 | { 120 | "cell_type": "code", 121 | "execution_count": 4, 122 | "metadata": {}, 123 | "outputs": [ 124 | { 125 | "data": { 126 | "text/html": [ 127 | "
\n", 128 | "\n", 141 | "\n", 142 | " \n", 143 | " \n", 144 | " \n", 145 | " \n", 146 | " \n", 147 | " \n", 148 | " \n", 149 | " \n", 150 | " \n", 151 | " \n", 152 | " \n", 153 | " \n", 154 | " \n", 155 | " \n", 156 | " \n", 157 | " \n", 158 | " \n", 159 | " \n", 160 | " \n", 161 | " \n", 162 | " \n", 163 | " \n", 164 | " \n", 165 | " \n", 166 | " \n", 167 | " \n", 168 | " \n", 169 | " \n", 170 | " \n", 171 | " \n", 172 | " \n", 173 | " \n", 174 | " \n", 175 | " \n", 176 | " \n", 177 | " \n", 178 | " \n", 179 | " \n", 180 | " \n", 181 | " \n", 182 | " \n", 183 | " \n", 184 | " \n", 185 | " \n", 186 | " \n", 187 | " \n", 188 | " \n", 189 | " \n", 190 | " \n", 191 | " \n", 192 | " \n", 193 | " \n", 194 | " \n", 195 | " \n", 196 | " \n", 197 | " \n", 198 | " \n", 199 | " \n", 200 | " \n", 201 | " \n", 202 | " \n", 203 | " \n", 204 | " \n", 205 | " \n", 206 | " \n", 207 | " \n", 208 | " \n", 209 | " \n", 210 | " \n", 211 | " \n", 212 | " \n", 213 | " \n", 214 | " \n", 215 | " \n", 216 | " \n", 217 | " \n", 218 | " \n", 219 | " \n", 220 | " \n", 221 | " \n", 222 | " \n", 223 | " \n", 224 | " \n", 225 | " \n", 226 | " \n", 227 | " \n", 228 | " \n", 229 | " \n", 230 | " \n", 231 | " \n", 232 | " \n", 233 | " \n", 234 | " \n", 235 | " \n", 236 | " \n", 237 | " \n", 238 | " \n", 239 | " \n", 240 | " \n", 241 | " \n", 242 | " \n", 243 | " \n", 244 | " \n", 245 | " \n", 246 | " \n", 247 | " \n", 248 | " \n", 249 | " \n", 250 | " \n", 251 | " \n", 252 | " \n", 253 | " \n", 254 | " \n", 255 | " \n", 256 | " \n", 257 | " \n", 258 | " \n", 259 | " \n", 260 | " \n", 261 | " \n", 262 | " \n", 263 | " \n", 264 | " \n", 265 | " \n", 266 | " \n", 267 | " \n", 268 | " \n", 269 | " \n", 270 | " \n", 271 | " \n", 272 | " \n", 273 | " \n", 274 | " \n", 275 | " \n", 276 | " \n", 277 | " \n", 278 | " \n", 279 | " \n", 280 | " \n", 281 | " \n", 282 | " \n", 283 | " \n", 284 | " \n", 285 | " \n", 286 | " \n", 287 | " \n", 288 | " \n", 289 | " \n", 290 | " \n", 291 | " \n", 292 | " \n", 293 | " \n", 294 | " \n", 295 | " \n", 296 | " \n", 297 | " \n", 298 | " \n", 299 | " \n", 300 | " \n", 301 | " \n", 302 | " \n", 303 | " \n", 304 | " \n", 305 | " \n", 306 | " \n", 307 | " \n", 308 | " \n", 309 | " \n", 310 | " \n", 311 | " \n", 312 | " \n", 313 | " \n", 314 | " \n", 315 | " \n", 316 | " \n", 317 | " \n", 318 | " \n", 319 | " \n", 320 | " \n", 321 | " \n", 322 | " \n", 323 | " \n", 324 | " \n", 325 | " \n", 326 | " \n", 327 | " \n", 328 | " \n", 329 | " \n", 330 | " \n", 331 | " \n", 332 | " \n", 333 | " \n", 334 | " \n", 335 | " \n", 336 | " \n", 337 | " \n", 338 | " \n", 339 | " \n", 340 | " \n", 341 | " \n", 342 | " \n", 343 | " \n", 344 | " \n", 345 | " \n", 346 | " \n", 347 | " \n", 348 | " \n", 349 | " \n", 350 | " \n", 351 | " \n", 352 | " \n", 353 | " \n", 354 | " \n", 355 | " \n", 356 | " \n", 357 | " \n", 358 | " \n", 359 | " \n", 360 | " \n", 361 | " \n", 362 | " \n", 363 | " \n", 364 | " \n", 365 | " \n", 366 | " \n", 367 | " \n", 368 | " \n", 369 | " \n", 370 | " \n", 371 | " \n", 372 | " \n", 373 | " \n", 374 | " \n", 375 | " \n", 376 | " \n", 377 | " \n", 378 | " \n", 379 | " \n", 380 | " \n", 381 | " \n", 382 | " \n", 383 | " \n", 384 | " \n", 385 | " \n", 386 | " \n", 387 | " \n", 388 | " \n", 389 | " \n", 390 | " \n", 391 | " \n", 392 | " \n", 393 | " \n", 394 | " \n", 395 | " \n", 396 | " \n", 397 | " \n", 398 | " \n", 399 | " \n", 400 | " \n", 401 | " \n", 402 | " \n", 403 | " \n", 404 | " \n", 405 | " \n", 406 | " \n", 407 | " \n", 408 | " \n", 409 | " \n", 410 | " \n", 411 | " \n", 412 | " \n", 413 | " \n", 414 | " \n", 415 | " \n", 416 | " \n", 417 | " \n", 418 | " \n", 419 | " \n", 420 | " \n", 421 | " \n", 422 | " \n", 423 | " \n", 424 | " \n", 425 | " \n", 426 | " \n", 427 | " \n", 428 | " \n", 429 | " \n", 430 | " \n", 431 | " \n", 432 | " \n", 433 | " \n", 434 | " \n", 435 | " \n", 436 | " \n", 437 | " \n", 438 | " \n", 439 | " \n", 440 | " \n", 441 | " \n", 442 | " \n", 443 | " \n", 444 | " \n", 445 | " \n", 446 | " \n", 447 | " \n", 448 | " \n", 449 | " \n", 450 | " \n", 451 | " \n", 452 | " \n", 453 | " \n", 454 | " \n", 455 | " \n", 456 | " \n", 457 | " \n", 458 | " \n", 459 | " \n", 460 | " \n", 461 | " \n", 462 | " \n", 463 | " \n", 464 | " \n", 465 | " \n", 466 | " \n", 467 | " \n", 468 | " \n", 469 | " \n", 470 | " \n", 471 | " \n", 472 | " \n", 473 | " \n", 474 | " \n", 475 | " \n", 476 | " \n", 477 | " \n", 478 | " \n", 479 | " \n", 480 | " \n", 481 | " \n", 482 | " \n", 483 | " \n", 484 | " \n", 485 | " \n", 486 | " \n", 487 | " \n", 488 | " \n", 489 | " \n", 490 | " \n", 491 | " \n", 492 | " \n", 493 | " \n", 494 | " \n", 495 | " \n", 496 | " \n", 497 | " \n", 498 | " \n", 499 | " \n", 500 | " \n", 501 | " \n", 502 | " \n", 503 | " \n", 504 | " \n", 505 | " \n", 506 | " \n", 507 | " \n", 508 | " \n", 509 | " \n", 510 | " \n", 511 | " \n", 512 | " \n", 513 | " \n", 514 | " \n", 515 | " \n", 516 | " \n", 517 | " \n", 518 | " \n", 519 | " \n", 520 | " \n", 521 | " \n", 522 | " \n", 523 | " \n", 524 | " \n", 525 | " \n", 526 | " \n", 527 | " \n", 528 | " \n", 529 | " \n", 530 | " \n", 531 | " \n", 532 | " \n", 533 | " \n", 534 | " \n", 535 | " \n", 536 | " \n", 537 | " \n", 538 | " \n", 539 | " \n", 540 | " \n", 541 | " \n", 542 | " \n", 543 | " \n", 544 | " \n", 545 | " \n", 546 | " \n", 547 | " \n", 548 | " \n", 549 | " \n", 550 | " \n", 551 | " \n", 552 | " \n", 553 | " \n", 554 | " \n", 555 | " \n", 556 | "
codefirst_namelast_namefunctiondate_of_birthsubmission_datepicture
05591927432PrentHickenbottomSenior Editor4/3/199322/1/2019https://robohash.org/quidemsaepequi.png?size=3...
15071682362JardSteinGeological Engineer15/7/199210/4/2019https://robohash.org/teneturautsunt.png?size=3...
26295398980LevonNoenResearch Assistant IV12/10/199927/3/2019https://robohash.org/quaeetsed.png?size=300x30...
33718164078NonahScogginJunior Executive9/7/200021/1/2019https://robohash.org/debitisinciduntdolore.png...
42261412840JamesonHuguevilleTeacher5/12/19911/2/2019https://robohash.org/facilisrerumad.png?size=3...
57226393395LynnettHambrickSoftware Engineer II17/5/199823/2/2019https://robohash.org/eosculpaquam.png?size=300...
61088777325DavieWetwoodRecruiter1/3/199314/4/2019https://robohash.org/cumofficiarepudiandae.png...
74971860363TaborHarrowerSenior Financial Analyst9/1/199527/3/2019https://robohash.org/etdoloribusreiciendis.png...
89695067972AbagailJouanninProgrammer IV5/4/199411/4/2019https://robohash.org/suntliberoveritatis.png?s...
94931427782ShanteeCorderoElectrical Engineer20/6/200014/4/2019https://robohash.org/suscipithicest.png?size=3...
102561912337DannyGarkenAnalog Circuit Design manager17/4/199117/2/2019https://robohash.org/etetconsequatur.png?size=...
114256157018RosaleenDomonkosWeb Designer II16/10/19963/2/2019https://robohash.org/reprehenderitdebitisnobis...
122055115286KristineDevaneyJunior Executive4/10/19927/1/2019https://robohash.org/seddictaab.png?size=300x3...
137984595380CarrieDumperChief Design Engineer22/10/199422/3/2019https://robohash.org/undeidveritatis.png?size=...
143386631134LukeBickerstaffMedia Manager III25/9/199327/3/2019https://robohash.org/doloresillumvitae.png?siz...
155253322272TabathaCatleySoftware Test Engineer III26/11/199512/2/2019https://robohash.org/autiustoreiciendis.png?si...
164738968260OberonBeazerCommunity Outreach Specialist14/1/199616/2/2019https://robohash.org/utinmolestias.png?size=30...
171425469388KristosLuxGeological Engineer31/7/19997/2/2019https://robohash.org/quodvoluptatesdebitis.png...
189326331857LucinaLanahanActuary25/2/19947/4/2019https://robohash.org/porroetnobis.png?size=300...
192860174680MaureDaviesVP Marketing4/12/199224/2/2019https://robohash.org/consequatursitcupiditate....
207461604813HaroldKordasProgrammer Analyst III22/7/199524/3/2019https://robohash.org/inciduntomnisqui.png?size...
217341605200DmitriLethemMarketing Assistant20/12/199628/1/2019https://robohash.org/quoadaut.png?size=300x300...
224777281970AlejandraMacCauleyAccounting Assistant IV9/4/19964/1/2019https://robohash.org/nemosimiliquevelit.png?si...
234157762282CarlynneRickettSenior Developer12/6/199715/3/2019https://robohash.org/voluptatemvelexcepturi.pn...
241081781408CaroleBendeSenior Editor3/10/199624/2/2019https://robohash.org/doloriureeum.png?size=300...
257557982436JeanineFortieNurse Practicioner28/8/199530/1/2019https://robohash.org/inciduntcumexercitationem...
268352361872VanyaBennetonStructural Engineer16/6/199617/2/2019https://robohash.org/nesciuntsitdebitis.png?si...
278982911871IngeborgSpadaSocial Worker27/7/19921/1/2019https://robohash.org/voluptatemdolorofficiis.p...
281890373168JewelleGrelikSenior Sales Associate2/8/199311/4/2019https://robohash.org/quiaestnon.png?size=300x3...
29597199779EllissaDmtrovicSenior Quality Engineer15/4/199827/3/2019https://robohash.org/essererumvoluptatem.png?s...
308643041742NadyaGamonSenior Financial Analyst15/12/199217/3/2019https://robohash.org/etrerumrepudiandae.png?si...
317399610088JorryBaudassoVP Sales7/12/19922/3/2019https://robohash.org/rerumsedvel.png?size=300x...
325255564982TamarNuttingInformation Systems Manager14/8/199323/3/2019https://robohash.org/oditenimlaborum.png?size=...
338557336683ShaunKemetGIS Technical Architect7/1/199229/3/2019https://robohash.org/sintpariaturut.png?size=3...
346784154681AugusteWeetchStructural Engineer26/11/199926/1/2019https://robohash.org/utasperiorescum.png?size=...
358124097216TheressaYakubovichAccountant IV6/5/199322/3/2019https://robohash.org/quibusdamnontotam.png?siz...
366206125874ZoraKingdomClinical Specialist26/2/199313/4/2019https://robohash.org/praesentiumquiafacere.png...
374808909243ElsworthWishamData Coordiator10/4/199818/2/2019https://robohash.org/nostrumexcepturirem.png?s...
384958537813JaimieCaisleyJunior Executive15/9/199513/4/2019https://robohash.org/suntsedsimilique.png?size...
397453768691BrittniTopperElectrical Engineer7/4/19954/3/2019https://robohash.org/rematquevoluptatum.png?si...
\n", 557 | "
" 558 | ], 559 | "text/plain": [ 560 | " code first_name last_name function \\\n", 561 | "0 5591927432 Prent Hickenbottom Senior Editor \n", 562 | "1 5071682362 Jard Stein Geological Engineer \n", 563 | "2 6295398980 Levon Noen Research Assistant IV \n", 564 | "3 3718164078 Nonah Scoggin Junior Executive \n", 565 | "4 2261412840 Jameson Hugueville Teacher \n", 566 | "5 7226393395 Lynnett Hambrick Software Engineer II \n", 567 | "6 1088777325 Davie Wetwood Recruiter \n", 568 | "7 4971860363 Tabor Harrower Senior Financial Analyst \n", 569 | "8 9695067972 Abagail Jouannin Programmer IV \n", 570 | "9 4931427782 Shantee Cordero Electrical Engineer \n", 571 | "10 2561912337 Danny Garken Analog Circuit Design manager \n", 572 | "11 4256157018 Rosaleen Domonkos Web Designer II \n", 573 | "12 2055115286 Kristine Devaney Junior Executive \n", 574 | "13 7984595380 Carrie Dumper Chief Design Engineer \n", 575 | "14 3386631134 Luke Bickerstaff Media Manager III \n", 576 | "15 5253322272 Tabatha Catley Software Test Engineer III \n", 577 | "16 4738968260 Oberon Beazer Community Outreach Specialist \n", 578 | "17 1425469388 Kristos Lux Geological Engineer \n", 579 | "18 9326331857 Lucina Lanahan Actuary \n", 580 | "19 2860174680 Maure Davies VP Marketing \n", 581 | "20 7461604813 Harold Kordas Programmer Analyst III \n", 582 | "21 7341605200 Dmitri Lethem Marketing Assistant \n", 583 | "22 4777281970 Alejandra MacCauley Accounting Assistant IV \n", 584 | "23 4157762282 Carlynne Rickett Senior Developer \n", 585 | "24 1081781408 Carole Bende Senior Editor \n", 586 | "25 7557982436 Jeanine Fortie Nurse Practicioner \n", 587 | "26 8352361872 Vanya Benneton Structural Engineer \n", 588 | "27 8982911871 Ingeborg Spada Social Worker \n", 589 | "28 1890373168 Jewelle Grelik Senior Sales Associate \n", 590 | "29 597199779 Ellissa Dmtrovic Senior Quality Engineer \n", 591 | "30 8643041742 Nadya Gamon Senior Financial Analyst \n", 592 | "31 7399610088 Jorry Baudasso VP Sales \n", 593 | "32 5255564982 Tamar Nutting Information Systems Manager \n", 594 | "33 8557336683 Shaun Kemet GIS Technical Architect \n", 595 | "34 6784154681 Auguste Weetch Structural Engineer \n", 596 | "35 8124097216 Theressa Yakubovich Accountant IV \n", 597 | "36 6206125874 Zora Kingdom Clinical Specialist \n", 598 | "37 4808909243 Elsworth Wisham Data Coordiator \n", 599 | "38 4958537813 Jaimie Caisley Junior Executive \n", 600 | "39 7453768691 Brittni Topper Electrical Engineer \n", 601 | "\n", 602 | " date_of_birth submission_date \\\n", 603 | "0 4/3/1993 22/1/2019 \n", 604 | "1 15/7/1992 10/4/2019 \n", 605 | "2 12/10/1999 27/3/2019 \n", 606 | "3 9/7/2000 21/1/2019 \n", 607 | "4 5/12/1991 1/2/2019 \n", 608 | "5 17/5/1998 23/2/2019 \n", 609 | "6 1/3/1993 14/4/2019 \n", 610 | "7 9/1/1995 27/3/2019 \n", 611 | "8 5/4/1994 11/4/2019 \n", 612 | "9 20/6/2000 14/4/2019 \n", 613 | "10 17/4/1991 17/2/2019 \n", 614 | "11 16/10/1996 3/2/2019 \n", 615 | "12 4/10/1992 7/1/2019 \n", 616 | "13 22/10/1994 22/3/2019 \n", 617 | "14 25/9/1993 27/3/2019 \n", 618 | "15 26/11/1995 12/2/2019 \n", 619 | "16 14/1/1996 16/2/2019 \n", 620 | "17 31/7/1999 7/2/2019 \n", 621 | "18 25/2/1994 7/4/2019 \n", 622 | "19 4/12/1992 24/2/2019 \n", 623 | "20 22/7/1995 24/3/2019 \n", 624 | "21 20/12/1996 28/1/2019 \n", 625 | "22 9/4/1996 4/1/2019 \n", 626 | "23 12/6/1997 15/3/2019 \n", 627 | "24 3/10/1996 24/2/2019 \n", 628 | "25 28/8/1995 30/1/2019 \n", 629 | "26 16/6/1996 17/2/2019 \n", 630 | "27 27/7/1992 1/1/2019 \n", 631 | "28 2/8/1993 11/4/2019 \n", 632 | "29 15/4/1998 27/3/2019 \n", 633 | "30 15/12/1992 17/3/2019 \n", 634 | "31 7/12/1992 2/3/2019 \n", 635 | "32 14/8/1993 23/3/2019 \n", 636 | "33 7/1/1992 29/3/2019 \n", 637 | "34 26/11/1999 26/1/2019 \n", 638 | "35 6/5/1993 22/3/2019 \n", 639 | "36 26/2/1993 13/4/2019 \n", 640 | "37 10/4/1998 18/2/2019 \n", 641 | "38 15/9/1995 13/4/2019 \n", 642 | "39 7/4/1995 4/3/2019 \n", 643 | "\n", 644 | " picture \n", 645 | "0 https://robohash.org/quidemsaepequi.png?size=3... \n", 646 | "1 https://robohash.org/teneturautsunt.png?size=3... \n", 647 | "2 https://robohash.org/quaeetsed.png?size=300x30... \n", 648 | "3 https://robohash.org/debitisinciduntdolore.png... \n", 649 | "4 https://robohash.org/facilisrerumad.png?size=3... \n", 650 | "5 https://robohash.org/eosculpaquam.png?size=300... \n", 651 | "6 https://robohash.org/cumofficiarepudiandae.png... \n", 652 | "7 https://robohash.org/etdoloribusreiciendis.png... \n", 653 | "8 https://robohash.org/suntliberoveritatis.png?s... \n", 654 | "9 https://robohash.org/suscipithicest.png?size=3... \n", 655 | "10 https://robohash.org/etetconsequatur.png?size=... \n", 656 | "11 https://robohash.org/reprehenderitdebitisnobis... \n", 657 | "12 https://robohash.org/seddictaab.png?size=300x3... \n", 658 | "13 https://robohash.org/undeidveritatis.png?size=... \n", 659 | "14 https://robohash.org/doloresillumvitae.png?siz... \n", 660 | "15 https://robohash.org/autiustoreiciendis.png?si... \n", 661 | "16 https://robohash.org/utinmolestias.png?size=30... \n", 662 | "17 https://robohash.org/quodvoluptatesdebitis.png... \n", 663 | "18 https://robohash.org/porroetnobis.png?size=300... \n", 664 | "19 https://robohash.org/consequatursitcupiditate.... \n", 665 | "20 https://robohash.org/inciduntomnisqui.png?size... \n", 666 | "21 https://robohash.org/quoadaut.png?size=300x300... \n", 667 | "22 https://robohash.org/nemosimiliquevelit.png?si... \n", 668 | "23 https://robohash.org/voluptatemvelexcepturi.pn... \n", 669 | "24 https://robohash.org/doloriureeum.png?size=300... \n", 670 | "25 https://robohash.org/inciduntcumexercitationem... \n", 671 | "26 https://robohash.org/nesciuntsitdebitis.png?si... \n", 672 | "27 https://robohash.org/voluptatemdolorofficiis.p... \n", 673 | "28 https://robohash.org/quiaestnon.png?size=300x3... \n", 674 | "29 https://robohash.org/essererumvoluptatem.png?s... \n", 675 | "30 https://robohash.org/etrerumrepudiandae.png?si... \n", 676 | "31 https://robohash.org/rerumsedvel.png?size=300x... \n", 677 | "32 https://robohash.org/oditenimlaborum.png?size=... \n", 678 | "33 https://robohash.org/sintpariaturut.png?size=3... \n", 679 | "34 https://robohash.org/utasperiorescum.png?size=... \n", 680 | "35 https://robohash.org/quibusdamnontotam.png?siz... \n", 681 | "36 https://robohash.org/praesentiumquiafacere.png... \n", 682 | "37 https://robohash.org/nostrumexcepturirem.png?s... \n", 683 | "38 https://robohash.org/suntsedsimilique.png?size... \n", 684 | "39 https://robohash.org/rematquevoluptatum.png?si... " 685 | ] 686 | }, 687 | "execution_count": 4, 688 | "metadata": {}, 689 | "output_type": "execute_result" 690 | } 691 | ], 692 | "source": [ 693 | "data.head(40)" 694 | ] 695 | }, 696 | { 697 | "cell_type": "markdown", 698 | "metadata": {}, 699 | "source": [ 700 | "As you can see some of the code entries are only 9 digits or less, so we will add some random degits to them." 701 | ] 702 | }, 703 | { 704 | "cell_type": "code", 705 | "execution_count": 5, 706 | "metadata": {}, 707 | "outputs": [], 708 | "source": [ 709 | "data['code'] = data['code'].apply(lambda x: complete(x))" 710 | ] 711 | }, 712 | { 713 | "cell_type": "code", 714 | "execution_count": 6, 715 | "metadata": {}, 716 | "outputs": [ 717 | { 718 | "data": { 719 | "text/plain": [ 720 | "code int64\n", 721 | "first_name object\n", 722 | "last_name object\n", 723 | "function object\n", 724 | "date_of_birth object\n", 725 | "submission_date object\n", 726 | "picture object\n", 727 | "dtype: object" 728 | ] 729 | }, 730 | "execution_count": 6, 731 | "metadata": {}, 732 | "output_type": "execute_result" 733 | } 734 | ], 735 | "source": [ 736 | "data.dtypes" 737 | ] 738 | }, 739 | { 740 | "cell_type": "markdown", 741 | "metadata": {}, 742 | "source": [ 743 | "### convert to datetime elements " 744 | ] 745 | }, 746 | { 747 | "cell_type": "code", 748 | "execution_count": 7, 749 | "metadata": {}, 750 | "outputs": [], 751 | "source": [ 752 | "data['submission_date']=pd.to_datetime(data['submission_date'])\n", 753 | "data['date_of_birth'] = pd.to_datetime(data['date_of_birth'])" 754 | ] 755 | }, 756 | { 757 | "cell_type": "code", 758 | "execution_count": 8, 759 | "metadata": {}, 760 | "outputs": [ 761 | { 762 | "data": { 763 | "text/plain": [ 764 | "code int64\n", 765 | "first_name object\n", 766 | "last_name object\n", 767 | "function object\n", 768 | "date_of_birth datetime64[ns]\n", 769 | "submission_date datetime64[ns]\n", 770 | "picture object\n", 771 | "dtype: object" 772 | ] 773 | }, 774 | "execution_count": 8, 775 | "metadata": {}, 776 | "output_type": "execute_result" 777 | } 778 | ], 779 | "source": [ 780 | "data.dtypes" 781 | ] 782 | }, 783 | { 784 | "cell_type": "code", 785 | "execution_count": 9, 786 | "metadata": {}, 787 | "outputs": [ 788 | { 789 | "data": { 790 | "text/html": [ 791 | "
\n", 792 | "\n", 805 | "\n", 806 | " \n", 807 | " \n", 808 | " \n", 809 | " \n", 810 | " \n", 811 | " \n", 812 | " \n", 813 | " \n", 814 | " \n", 815 | " \n", 816 | " \n", 817 | " \n", 818 | " \n", 819 | " \n", 820 | " \n", 821 | " \n", 822 | " \n", 823 | " \n", 824 | " \n", 825 | " \n", 826 | " \n", 827 | " \n", 828 | " \n", 829 | " \n", 830 | " \n", 831 | " \n", 832 | " \n", 833 | " \n", 834 | " \n", 835 | " \n", 836 | " \n", 837 | " \n", 838 | " \n", 839 | " \n", 840 | " \n", 841 | " \n", 842 | " \n", 843 | " \n", 844 | " \n", 845 | " \n", 846 | " \n", 847 | " \n", 848 | " \n", 849 | " \n", 850 | " \n", 851 | " \n", 852 | " \n", 853 | " \n", 854 | " \n", 855 | " \n", 856 | " \n", 857 | " \n", 858 | " \n", 859 | " \n", 860 | " \n", 861 | " \n", 862 | " \n", 863 | " \n", 864 | " \n", 865 | " \n", 866 | " \n", 867 | " \n", 868 | " \n", 869 | " \n", 870 | "
codefirst_namelast_namefunctiondate_of_birthsubmission_datepicture
05591927432PrentHickenbottomSenior Editor1993-04-032019-01-22https://robohash.org/quidemsaepequi.png?size=3...
15071682362JardSteinGeological Engineer1992-07-152019-10-04https://robohash.org/teneturautsunt.png?size=3...
26295398980LevonNoenResearch Assistant IV1999-12-102019-03-27https://robohash.org/quaeetsed.png?size=300x30...
33718164078NonahScogginJunior Executive2000-09-072019-01-21https://robohash.org/debitisinciduntdolore.png...
42261412840JamesonHuguevilleTeacher1991-05-122019-01-02https://robohash.org/facilisrerumad.png?size=3...
\n", 871 | "
" 872 | ], 873 | "text/plain": [ 874 | " code first_name last_name function date_of_birth \\\n", 875 | "0 5591927432 Prent Hickenbottom Senior Editor 1993-04-03 \n", 876 | "1 5071682362 Jard Stein Geological Engineer 1992-07-15 \n", 877 | "2 6295398980 Levon Noen Research Assistant IV 1999-12-10 \n", 878 | "3 3718164078 Nonah Scoggin Junior Executive 2000-09-07 \n", 879 | "4 2261412840 Jameson Hugueville Teacher 1991-05-12 \n", 880 | "\n", 881 | " submission_date picture \n", 882 | "0 2019-01-22 https://robohash.org/quidemsaepequi.png?size=3... \n", 883 | "1 2019-10-04 https://robohash.org/teneturautsunt.png?size=3... \n", 884 | "2 2019-03-27 https://robohash.org/quaeetsed.png?size=300x30... \n", 885 | "3 2019-01-21 https://robohash.org/debitisinciduntdolore.png... \n", 886 | "4 2019-01-02 https://robohash.org/facilisrerumad.png?size=3... " 887 | ] 888 | }, 889 | "execution_count": 9, 890 | "metadata": {}, 891 | "output_type": "execute_result" 892 | } 893 | ], 894 | "source": [ 895 | "data.head(5)" 896 | ] 897 | }, 898 | { 899 | "cell_type": "markdown", 900 | "metadata": {}, 901 | "source": [ 902 | "### add expiration date column (submission date + 15 days) " 903 | ] 904 | }, 905 | { 906 | "cell_type": "code", 907 | "execution_count": 10, 908 | "metadata": {}, 909 | "outputs": [], 910 | "source": [ 911 | "data[\"expiration_date\"] = data[\"submission_date\"] + timedelta(days=15)" 912 | ] 913 | }, 914 | { 915 | "cell_type": "markdown", 916 | "metadata": {}, 917 | "source": [ 918 | "### Controlling date form DD-MM-YYYY" 919 | ] 920 | }, 921 | { 922 | "cell_type": "code", 923 | "execution_count": 11, 924 | "metadata": {}, 925 | "outputs": [], 926 | "source": [ 927 | "data['date_of_birth']=data['date_of_birth'].dt.strftime('%d-%m-%Y')\n", 928 | "data['submission_date']=data['submission_date'].dt.strftime('%d-%m-%Y')\n", 929 | "data['expiration_date']=data['expiration_date'].dt.strftime('%d-%m-%Y')" 930 | ] 931 | }, 932 | { 933 | "cell_type": "code", 934 | "execution_count": 12, 935 | "metadata": {}, 936 | "outputs": [ 937 | { 938 | "data": { 939 | "text/html": [ 940 | "
\n", 941 | "\n", 954 | "\n", 955 | " \n", 956 | " \n", 957 | " \n", 958 | " \n", 959 | " \n", 960 | " \n", 961 | " \n", 962 | " \n", 963 | " \n", 964 | " \n", 965 | " \n", 966 | " \n", 967 | " \n", 968 | " \n", 969 | " \n", 970 | " \n", 971 | " \n", 972 | " \n", 973 | " \n", 974 | " \n", 975 | " \n", 976 | " \n", 977 | " \n", 978 | " \n", 979 | " \n", 980 | " \n", 981 | " \n", 982 | " \n", 983 | " \n", 984 | " \n", 985 | " \n", 986 | " \n", 987 | " \n", 988 | " \n", 989 | " \n", 990 | " \n", 991 | " \n", 992 | " \n", 993 | " \n", 994 | " \n", 995 | " \n", 996 | " \n", 997 | " \n", 998 | " \n", 999 | " \n", 1000 | " \n", 1001 | " \n", 1002 | " \n", 1003 | " \n", 1004 | " \n", 1005 | " \n", 1006 | " \n", 1007 | " \n", 1008 | " \n", 1009 | " \n", 1010 | " \n", 1011 | " \n", 1012 | " \n", 1013 | " \n", 1014 | " \n", 1015 | " \n", 1016 | " \n", 1017 | " \n", 1018 | " \n", 1019 | " \n", 1020 | " \n", 1021 | " \n", 1022 | " \n", 1023 | " \n", 1024 | " \n", 1025 | "
codefirst_namelast_namefunctiondate_of_birthsubmission_datepictureexpiration_date
05591927432PrentHickenbottomSenior Editor03-04-199322-01-2019https://robohash.org/quidemsaepequi.png?size=3...06-02-2019
15071682362JardSteinGeological Engineer15-07-199204-10-2019https://robohash.org/teneturautsunt.png?size=3...19-10-2019
26295398980LevonNoenResearch Assistant IV10-12-199927-03-2019https://robohash.org/quaeetsed.png?size=300x30...11-04-2019
33718164078NonahScogginJunior Executive07-09-200021-01-2019https://robohash.org/debitisinciduntdolore.png...05-02-2019
42261412840JamesonHuguevilleTeacher12-05-199102-01-2019https://robohash.org/facilisrerumad.png?size=3...17-01-2019
\n", 1026 | "
" 1027 | ], 1028 | "text/plain": [ 1029 | " code first_name last_name function date_of_birth \\\n", 1030 | "0 5591927432 Prent Hickenbottom Senior Editor 03-04-1993 \n", 1031 | "1 5071682362 Jard Stein Geological Engineer 15-07-1992 \n", 1032 | "2 6295398980 Levon Noen Research Assistant IV 10-12-1999 \n", 1033 | "3 3718164078 Nonah Scoggin Junior Executive 07-09-2000 \n", 1034 | "4 2261412840 Jameson Hugueville Teacher 12-05-1991 \n", 1035 | "\n", 1036 | " submission_date picture \\\n", 1037 | "0 22-01-2019 https://robohash.org/quidemsaepequi.png?size=3... \n", 1038 | "1 04-10-2019 https://robohash.org/teneturautsunt.png?size=3... \n", 1039 | "2 27-03-2019 https://robohash.org/quaeetsed.png?size=300x30... \n", 1040 | "3 21-01-2019 https://robohash.org/debitisinciduntdolore.png... \n", 1041 | "4 02-01-2019 https://robohash.org/facilisrerumad.png?size=3... \n", 1042 | "\n", 1043 | " expiration_date \n", 1044 | "0 06-02-2019 \n", 1045 | "1 19-10-2019 \n", 1046 | "2 11-04-2019 \n", 1047 | "3 05-02-2019 \n", 1048 | "4 17-01-2019 " 1049 | ] 1050 | }, 1051 | "execution_count": 12, 1052 | "metadata": {}, 1053 | "output_type": "execute_result" 1054 | } 1055 | ], 1056 | "source": [ 1057 | "data.head(5)" 1058 | ] 1059 | }, 1060 | { 1061 | "cell_type": "markdown", 1062 | "metadata": {}, 1063 | "source": [ 1064 | "### Generating Costumized Pdf files from the dataset" 1065 | ] 1066 | }, 1067 | { 1068 | "cell_type": "code", 1069 | "execution_count": 13, 1070 | "metadata": {}, 1071 | "outputs": [ 1072 | { 1073 | "name": "stdout", 1074 | "output_type": "stream", 1075 | "text": [ 1076 | "Loading pages (1/6)\n", 1077 | "Counting pages (2/6) \n", 1078 | "Resolving links (4/6) \n", 1079 | "Loading headers and footers (5/6) \n", 1080 | "Printing pages (6/6)\n", 1081 | "Done \n", 1082 | "Loading pages (1/6)\n", 1083 | "Counting pages (2/6) \n", 1084 | "Resolving links (4/6) \n", 1085 | "Loading headers and footers (5/6) \n", 1086 | "Printing pages (6/6)\n", 1087 | "Done \n", 1088 | "Loading pages (1/6)\n", 1089 | "Counting pages (2/6) \n", 1090 | "Resolving links (4/6) \n", 1091 | "Loading headers and footers (5/6) \n", 1092 | "Printing pages (6/6)\n", 1093 | "Done \n", 1094 | "Loading pages (1/6)\n", 1095 | "Counting pages (2/6) \n", 1096 | "Resolving links (4/6) \n", 1097 | "Loading headers and footers (5/6) \n", 1098 | "Printing pages (6/6)\n", 1099 | "Done \n", 1100 | "Loading pages (1/6)\n", 1101 | "Counting pages (2/6) \n", 1102 | "Resolving links (4/6) \n", 1103 | "Loading headers and footers (5/6) \n", 1104 | "Printing pages (6/6)\n", 1105 | "Done \n" 1106 | ] 1107 | } 1108 | ], 1109 | "source": [ 1110 | "for index, row in data.head(n=5).iterrows() :\n", 1111 | " code=row[0]\n", 1112 | " fname = row[1]\n", 1113 | " lname = row[2]\n", 1114 | " func = row[3]\n", 1115 | " dob = row[4]\n", 1116 | " ed = row[5]\n", 1117 | " pic = row[6]\n", 1118 | " BARgen(code)\n", 1119 | " HTMLgen(code,fname,lname,func,dob,pic,ed)\n", 1120 | " PDFgen(code)\n", 1121 | " " 1122 | ] 1123 | }, 1124 | { 1125 | "cell_type": "markdown", 1126 | "metadata": {}, 1127 | "source": [ 1128 | "#### **generated 5 pdf files with thier corresponding enteries**" 1129 | ] 1130 | }, 1131 | { 1132 | "cell_type": "markdown", 1133 | "metadata": {}, 1134 | "source": [ 1135 | "

\n", 1136 | "\n", 1137 | "

" 1138 | ] 1139 | }, 1140 | { 1141 | "cell_type": "markdown", 1142 | "metadata": {}, 1143 | "source": [ 1144 | "### done" 1145 | ] 1146 | } 1147 | ], 1148 | "metadata": { 1149 | "kernelspec": { 1150 | "display_name": "Python 3", 1151 | "language": "python", 1152 | "name": "python3" 1153 | }, 1154 | "language_info": { 1155 | "codemirror_mode": { 1156 | "name": "ipython", 1157 | "version": 3 1158 | }, 1159 | "file_extension": ".py", 1160 | "mimetype": "text/x-python", 1161 | "name": "python", 1162 | "nbconvert_exporter": "python", 1163 | "pygments_lexer": "ipython3", 1164 | "version": "3.7.3" 1165 | } 1166 | }, 1167 | "nbformat": 4, 1168 | "nbformat_minor": 2 1169 | } 1170 | --------------------------------------------------------------------------------