|
47 | 47 | " None.\r\n",
|
48 | 48 | "\r\n",
|
49 | 49 | "Options:\r\n",
|
50 |
| - " -v, --verbose\r\n", |
| 50 | + " -v, --verbose [x>=0]\r\n", |
51 | 51 | " -q, --quiet TEXT\r\n",
|
52 | 52 | " --help Show this message and exit.\r\n",
|
53 | 53 | "\r\n",
|
54 | 54 | "Commands:\r\n",
|
55 |
| - " flatten Flatten a file to TSV/CSV Example: jfl flatten --input my.yaml...\r\n", |
56 |
| - " unflatten Unflatten a file from TSV/CSV Example: jfl unflatten --input...\r\n" |
| 55 | + " flatten Flatten a file to TSV/CSV\r\n", |
| 56 | + " unflatten Unflatten a file from TSV/CSV\r\n" |
57 | 57 | ]
|
58 | 58 | }
|
59 | 59 | ],
|
|
97 | 97 | " -i, --input PATH Input file, e.g. a SSSOM tsv file. [required]\r\n",
|
98 | 98 | " -I, --input-format TEXT The string denoting the input format, e.g.\r\n",
|
99 | 99 | " tsv,csv,yaml,json\r\n",
|
100 |
| - "\r\n", |
101 | 100 | " -o, --output TEXT Output file, e.g. a SSSOM tsv file.\r\n",
|
102 | 101 | " -t, --output-format TEXT Desired output format, e.g. tsv,csv,yaml,json\r\n",
|
103 | 102 | " -L, --multivalued-keys TEXT List of keys that are multivalued\r\n",
|
104 | 103 | " -F, --flatten-keys TEXT List of keys that are to be flattened\r\n",
|
105 | 104 | " -s, --serializer TEXT Serializer to use for complex keys\r\n",
|
106 | 105 | " -S, --serialized-keys TEXT List of keys that are to be serialized using\r\n",
|
107 | 106 | " the serializer\r\n",
|
108 |
| - "\r\n", |
109 | 107 | " -C, --config-key TEXT Key configuration. Must be of form\r\n",
|
110 | 108 | " KEY={yaml,json,flat,multivalued}*\r\n",
|
111 |
| - "\r\n", |
112 | 109 | " -c, --load-config TEXT Path to global configuration file to be loaded\r\n",
|
113 | 110 | " -O, --save-config TEXT Path to global configuration file to be saved\r\n",
|
114 | 111 | " -k, --key TEXT Key in root object to be used.\r\n",
|
|
309 | 306 | },
|
310 | 307 | {
|
311 | 308 | "cell_type": "code",
|
312 |
| - "execution_count": 6, |
| 309 | + "execution_count": 5, |
313 | 310 | "id": "4332920e",
|
314 | 311 | "metadata": {},
|
315 | 312 | "outputs": [
|
316 | 313 | {
|
317 | 314 | "name": "stdout",
|
318 | 315 | "output_type": "stream",
|
319 | 316 | "text": [
|
320 |
| - "genres\tid\tname\tcreator_from_country\tcreator_name\tbooks_summary\tbooks_name\tbooks_price\tbooks_id\tcreator_genres\r", |
| 317 | + "genres\tid\tname\tcreator_from_country\tcreator_name\tbooks_name\tbooks_price\tbooks_id\tbooks_summary\tcreator_genres\r", |
321 | 318 | "\r\n",
|
322 |
| - "[fantasy]\tS001\tLord of the Rings\tEngland\tJRR Tolkein\t[Hobbits|More hobbits|Yet more hobbits]\t[Fellowship of the Ring|The Two Towers|Return of the King]\t[5.99|5.99|6.99]\t[S001.1|S001.2|S001.3]\t\r", |
| 319 | + "[fantasy]\tS001\tLord of the Rings\tEngland\tJRR Tolkein\t[Fellowship of the Ring|The Two Towers|Return of the King]\t[5.99|5.99|6.99]\t[S001.1|S001.2|S001.3]\t[Hobbits|More hobbits|Yet more hobbits]\t\r", |
323 | 320 | "\r\n",
|
324 |
| - "[scifi]\tS002\tThe Culture Series\tScotland\tIan M Banks\t\t[Consider Phlebas|Player of Games]\t[5.99|5.99]\t[S002.1|S002.2]\t\r", |
| 321 | + "[scifi]\tS002\tThe Culture Series\tScotland\tIan M Banks\t[Consider Phlebas|Player of Games]\t[5.99|5.99]\t[S002.1|S002.2]\t\t\r", |
325 | 322 | "\r\n",
|
326 |
| - "[scifi|fantasy]\tS003\tBook of the New Sun\tUSA\tGene Wolfe\t\t[Shadow of the Torturer|Claw of the Conciliator]\t[|6.99]\t[S003.1|S003.2]\t[scifi|fantasy]\r", |
| 323 | + "[scifi|fantasy]\tS003\tBook of the New Sun\tUSA\tGene Wolfe\t[Shadow of the Torturer|Claw of the Conciliator]\t[|6.99]\t[S003.1|S003.2]\t\t[scifi|fantasy]\r", |
327 | 324 | "\r\n",
|
328 |
| - "\tS004\tExample with single book\tUSA\tMs Writer\t\t[Blah]\t\t[S004.1]\t[romance]\r", |
| 325 | + "\tS004\tExample with single book\tUSA\tMs Writer\t[Blah]\t\t[S004.1]\t\t[romance]\r", |
329 | 326 | "\r\n",
|
330 | 327 | "\tS005\tExample with no books\tUSA\tMr Unproductive\t\t\t\t\t[romance|scifi|fantasy]\r",
|
331 | 328 | "\r\n"
|
|
348 | 345 | },
|
349 | 346 | {
|
350 | 347 | "cell_type": "code",
|
351 |
| - "execution_count": 7, |
| 348 | + "execution_count": 6, |
352 | 349 | "id": "8fe7ed12",
|
353 | 350 | "metadata": {},
|
354 | 351 | "outputs": [],
|
|
358 | 355 | },
|
359 | 356 | {
|
360 | 357 | "cell_type": "code",
|
361 |
| - "execution_count": 8, |
| 358 | + "execution_count": 7, |
362 | 359 | "id": "74984e70",
|
363 | 360 | "metadata": {},
|
364 | 361 | "outputs": [
|
|
388 | 385 | " <th>name</th>\n",
|
389 | 386 | " <th>creator_from_country</th>\n",
|
390 | 387 | " <th>creator_name</th>\n",
|
391 |
| - " <th>books_summary</th>\n", |
392 | 388 | " <th>books_name</th>\n",
|
393 | 389 | " <th>books_price</th>\n",
|
394 | 390 | " <th>books_id</th>\n",
|
| 391 | + " <th>books_summary</th>\n", |
395 | 392 | " <th>creator_genres</th>\n",
|
396 | 393 | " </tr>\n",
|
397 | 394 | " </thead>\n",
|
|
403 | 400 | " <td>Lord of the Rings</td>\n",
|
404 | 401 | " <td>England</td>\n",
|
405 | 402 | " <td>JRR Tolkein</td>\n",
|
406 |
| - " <td>[Hobbits|More hobbits|Yet more hobbits]</td>\n", |
407 | 403 | " <td>[Fellowship of the Ring|The Two Towers|Return ...</td>\n",
|
408 | 404 | " <td>[5.99|5.99|6.99]</td>\n",
|
409 | 405 | " <td>[S001.1|S001.2|S001.3]</td>\n",
|
| 406 | + " <td>[Hobbits|More hobbits|Yet more hobbits]</td>\n", |
410 | 407 | " <td>NaN</td>\n",
|
411 | 408 | " </tr>\n",
|
412 | 409 | " <tr>\n",
|
|
416 | 413 | " <td>The Culture Series</td>\n",
|
417 | 414 | " <td>Scotland</td>\n",
|
418 | 415 | " <td>Ian M Banks</td>\n",
|
419 |
| - " <td>NaN</td>\n", |
420 | 416 | " <td>[Consider Phlebas|Player of Games]</td>\n",
|
421 | 417 | " <td>[5.99|5.99]</td>\n",
|
422 | 418 | " <td>[S002.1|S002.2]</td>\n",
|
423 | 419 | " <td>NaN</td>\n",
|
| 420 | + " <td>NaN</td>\n", |
424 | 421 | " </tr>\n",
|
425 | 422 | " <tr>\n",
|
426 | 423 | " <th>2</th>\n",
|
|
429 | 426 | " <td>Book of the New Sun</td>\n",
|
430 | 427 | " <td>USA</td>\n",
|
431 | 428 | " <td>Gene Wolfe</td>\n",
|
432 |
| - " <td>NaN</td>\n", |
433 | 429 | " <td>[Shadow of the Torturer|Claw of the Conciliator]</td>\n",
|
434 | 430 | " <td>[|6.99]</td>\n",
|
435 | 431 | " <td>[S003.1|S003.2]</td>\n",
|
| 432 | + " <td>NaN</td>\n", |
436 | 433 | " <td>[scifi|fantasy]</td>\n",
|
437 | 434 | " </tr>\n",
|
438 | 435 | " <tr>\n",
|
|
442 | 439 | " <td>Example with single book</td>\n",
|
443 | 440 | " <td>USA</td>\n",
|
444 | 441 | " <td>Ms Writer</td>\n",
|
445 |
| - " <td>NaN</td>\n", |
446 | 442 | " <td>[Blah]</td>\n",
|
447 | 443 | " <td>NaN</td>\n",
|
448 | 444 | " <td>[S004.1]</td>\n",
|
| 445 | + " <td>NaN</td>\n", |
449 | 446 | " <td>[romance]</td>\n",
|
450 | 447 | " </tr>\n",
|
451 | 448 | " <tr>\n",
|
|
473 | 470 | "3 NaN S004 Example with single book USA \n",
|
474 | 471 | "4 NaN S005 Example with no books USA \n",
|
475 | 472 | "\n",
|
476 |
| - " creator_name books_summary \\\n", |
477 |
| - "0 JRR Tolkein [Hobbits|More hobbits|Yet more hobbits] \n", |
478 |
| - "1 Ian M Banks NaN \n", |
479 |
| - "2 Gene Wolfe NaN \n", |
480 |
| - "3 Ms Writer NaN \n", |
481 |
| - "4 Mr Unproductive NaN \n", |
| 473 | + " creator_name books_name \\\n", |
| 474 | + "0 JRR Tolkein [Fellowship of the Ring|The Two Towers|Return ... \n", |
| 475 | + "1 Ian M Banks [Consider Phlebas|Player of Games] \n", |
| 476 | + "2 Gene Wolfe [Shadow of the Torturer|Claw of the Conciliator] \n", |
| 477 | + "3 Ms Writer [Blah] \n", |
| 478 | + "4 Mr Unproductive NaN \n", |
482 | 479 | "\n",
|
483 |
| - " books_name books_price \\\n", |
484 |
| - "0 [Fellowship of the Ring|The Two Towers|Return ... [5.99|5.99|6.99] \n", |
485 |
| - "1 [Consider Phlebas|Player of Games] [5.99|5.99] \n", |
486 |
| - "2 [Shadow of the Torturer|Claw of the Conciliator] [|6.99] \n", |
487 |
| - "3 [Blah] NaN \n", |
488 |
| - "4 NaN NaN \n", |
| 480 | + " books_price books_id \\\n", |
| 481 | + "0 [5.99|5.99|6.99] [S001.1|S001.2|S001.3] \n", |
| 482 | + "1 [5.99|5.99] [S002.1|S002.2] \n", |
| 483 | + "2 [|6.99] [S003.1|S003.2] \n", |
| 484 | + "3 NaN [S004.1] \n", |
| 485 | + "4 NaN NaN \n", |
489 | 486 | "\n",
|
490 |
| - " books_id creator_genres \n", |
491 |
| - "0 [S001.1|S001.2|S001.3] NaN \n", |
492 |
| - "1 [S002.1|S002.2] NaN \n", |
493 |
| - "2 [S003.1|S003.2] [scifi|fantasy] \n", |
494 |
| - "3 [S004.1] [romance] \n", |
495 |
| - "4 NaN [romance|scifi|fantasy] " |
| 487 | + " books_summary creator_genres \n", |
| 488 | + "0 [Hobbits|More hobbits|Yet more hobbits] NaN \n", |
| 489 | + "1 NaN NaN \n", |
| 490 | + "2 NaN [scifi|fantasy] \n", |
| 491 | + "3 NaN [romance] \n", |
| 492 | + "4 NaN [romance|scifi|fantasy] " |
496 | 493 | ]
|
497 | 494 | },
|
498 |
| - "execution_count": 8, |
| 495 | + "execution_count": 7, |
499 | 496 | "metadata": {},
|
500 | 497 | "output_type": "execute_result"
|
501 | 498 | }
|
|
520 | 517 | },
|
521 | 518 | {
|
522 | 519 | "cell_type": "code",
|
523 |
| - "execution_count": 9, |
| 520 | + "execution_count": 8, |
524 | 521 | "id": "3479e425",
|
525 | 522 | "metadata": {},
|
526 | 523 | "outputs": [
|
|
539 | 536 | },
|
540 | 537 | {
|
541 | 538 | "cell_type": "code",
|
542 |
| - "execution_count": 10, |
| 539 | + "execution_count": 9, |
543 | 540 | "id": "de1bc259",
|
544 | 541 | "metadata": {},
|
545 | 542 | "outputs": [
|
|
600 | 597 | },
|
601 | 598 | {
|
602 | 599 | "cell_type": "code",
|
603 |
| - "execution_count": 11, |
| 600 | + "execution_count": 10, |
604 | 601 | "id": "7abc7bfd",
|
605 | 602 | "metadata": {},
|
606 | 603 | "outputs": [
|
|
618 | 615 | " -i, --input PATH Input file, e.g. a SSSOM tsv file. [required]\r\n",
|
619 | 616 | " -I, --input-format TEXT The string denoting the input format, e.g.\r\n",
|
620 | 617 | " tsv,csv,yaml,json\r\n",
|
621 |
| - "\r\n", |
622 | 618 | " -o, --output TEXT Output file, e.g. a SSSOM tsv file.\r\n",
|
623 | 619 | " -t, --output-format TEXT Desired output format, e.g. tsv,csv,yaml,json\r\n",
|
624 | 620 | " -L, --multivalued-keys TEXT List of keys that are multivalued\r\n",
|
625 | 621 | " -F, --flatten-keys TEXT List of keys that are to be flattened\r\n",
|
626 | 622 | " -s, --serializer TEXT Serializer to use for complex keys\r\n",
|
627 | 623 | " -S, --serialized-keys TEXT List of keys that are to be serialized using\r\n",
|
628 | 624 | " the serializer\r\n",
|
629 |
| - "\r\n", |
630 | 625 | " -C, --config-key TEXT Key configuration. Must be of form\r\n",
|
631 | 626 | " KEY={yaml,json,flat,multivalued}*\r\n",
|
632 |
| - "\r\n", |
633 | 627 | " -c, --load-config TEXT Path to global configuration file to be loaded\r\n",
|
634 | 628 | " -k, --key TEXT Key in root object to be used.\r\n",
|
635 | 629 | " --help Show this message and exit.\r\n"
|
|
642 | 636 | },
|
643 | 637 | {
|
644 | 638 | "cell_type": "code",
|
645 |
| - "execution_count": 12, |
| 639 | + "execution_count": 11, |
646 | 640 | "id": "e0bd52be",
|
647 | 641 | "metadata": {},
|
648 | 642 | "outputs": [],
|
|
653 | 647 | },
|
654 | 648 | {
|
655 | 649 | "cell_type": "code",
|
656 |
| - "execution_count": 13, |
| 650 | + "execution_count": 12, |
657 | 651 | "id": "ced1c890",
|
658 | 652 | "metadata": {},
|
659 | 653 | "outputs": [
|
|
0 commit comments