8000 :books: update documentation · pyexcel/pyexcel@60855a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 60855a4

Browse files
committed
📚 update documentation
1 parent 78a4a06 commit 60855a4

File tree

3 files changed

+59
-50
lines changed

3 files changed

+59
-50
lines changed

.moban.d/one-liners.rst.jj2

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -393,23 +393,26 @@ Suppose you want to save the below dictionary to an excel file :
393393
.. code-block:: python
394394

395395
>>> a_dictionary_of_two_dimensional_arrays = {
396-
... 'Sheet 1':
396+
... 'Top 3 Aircraft Manufacturers':
397397
... [
398-
... [1.0, 2.0, 3.0],
399-
... [4.0, 5.0, 6.0],
400-
... [7.0, 8.0, 9.0]
398+
... ['Name', 'Revenue'],
399+
... ['Lockheed Martin', '65.4 billion USD'],
400+
... ['Airbus', '78.9 billion USD'],
401+
... ['Boeing', '58.16 billion USD']
401402
... ],
402-
... 'Sheet 2':
403+
... 'Top 3 Airlines':
403404
... [
404-
... ['X', 'Y', 'Z'],
405-
... [1.0, 2.0, 3.0],
406-
... [4.0, 5.0, 6.0]
405+
... ['Name', 'Country', 'Revenue'],
406+
... ['Delta Air Lines', 'US', 61.6],
407+
... ['American Airlines Holdings', 'US', 57.1],
408+
... ['American Airlines Group', 'US', 54.2]
407409
... ],
408-
... 'Sheet 3':
410+
... 'Biggest 3 Airoplanes':
409411
... [
410-
... ['O', 'P', 'Q'],
411-
... [3.0, 2.0, 1.0],
412-
... [4.0, 3.0, 2.0]
412+
... ['Model', 'Passenger limt'],
413+
... ['Airbus A380-800', 853],
414+
... ['Boeing 747-400', 660],
415+
... ['Boeing 747-8', 605]
413416
... ]
414417
... }
415418

@@ -428,9 +431,9 @@ pass on an ordered dictionary to the function itself. For example:
428431
.. code-block:: python
429432

430433
>>> data = OrderedDict()
431-
>>> data.update({"Sheet 2": a_dictionary_of_two_dimensional_arrays['Sheet 2']})
432-
>>> data.update({"Sheet 1": a_dictionary_of_two_dimensional_arrays['Sheet 1']})
433-
>>> data.update({"Sheet 3": a_dictionary_of_two_dimensional_arrays['Sheet 3']})
434+
>>> data.update({"Sheet 2": a_dictionary_of_two_dimensional_arrays['Top 3 Airlines']})
435+
>>> data.update({"Sheet 1": a_dictionary_of_two_dimensional_arrays['Top 3 Aircraft Manufacturers']})
436+
>>> data.update({"Sheet 3": a_dictionary_of_two_dimensional_arrays['Biggest 3 Airoplanes']})
434437
>>> p.save_book_as(bookdict=data, dest_file_name="book.xls")
435438

436439
Let's verify its order:
@@ -440,9 +443,9 @@ Let's verify its order:
440443
>>> book_dict = p.get_book_dict(file_name="book.xls")
441444
>>> for key, item in book_dict.items():
442445
... print(json.dumps({key: item}))
443-
{"Sheet 2": [["X", "Y", "Z"], [1, 2, 3], [4, 5, 6]]}
444-
{"Sheet 1": [[1, 2, 3], [4, 5, 6], [7, 8, 9]]}
445-
{"Sheet 3": [["O", "P", "Q"], [3, 2, 1], [4, 3, 2]]}
446+
{"Sheet 2": [["Name", "Country", "Revenue"], ["Delta Air Lines", "US", 61.6], ["American Airlines Holdings", "US", 57.1], ["American Airlines Group", "US", 54.2]]}
447+
{"Sheet 1": [["Name", "Revenue"], ["Lockheed Martin", "65.4 billion USD"], ["Airbus", "78.9 billion USD"], ["Boeing", "58.16 billion USD"]]}
448+
{"Sheet 3": [["Model", "Passenger limt"], ["Airbus A380-800", 853], ["Boeing 747-400", 660], ["Boeing 747-8", 605]]}
446449

447450
Please notice that "Sheet 2" is the first item in the *book_dict*, meaning the order of sheets are preserved.
448451

README.rst

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -384,23 +384,26 @@ Suppose you want to save the below dictionary to an excel file :
384384
.. code-block:: python
67E6
385385
386386
>>> a_dictionary_of_two_dimensional_arrays = {
387-
... 'Sheet 1':
387+
... 'Top 3 Aircraft Manufacturers':
388388
... [
389-
... [1.0, 2.0, 3.0],
390-
... [4.0, 5.0, 6.0],
391-
... [7.0, 8.0, 9.0]
389+
... ['Name', 'Revenue'],
390+
... ['Lockheed Martin', '65.4 billion USD'],
391+
... ['Airbus', '78.9 billion USD'],
392+
... ['Boeing', '58.16 billion USD']
392393
... ],
393-
... 'Sheet 2':
394+
... 'Top 3 Airlines':
394395
... [
395-
... ['X', 'Y', 'Z'],
396-
... [1.0, 2.0, 3.0],
397-
... [4.0, 5.0, 6.0]
396+
... ['Name', 'Country', 'Revenue'],
397+
... ['Delta Air Lines', 'US', 61.6],
398+
... ['American Airlines Holdings', 'US', 57.1],
399+
... ['American Airlines Group', 'US', 54.2]
398400
... ],
399-
... 'Sheet 3':
401+
... 'Biggest 3 Airoplanes':
400402
... [
401-
... ['O', 'P', 'Q'],
402-
... [3.0, 2.0, 1.0],
403-
... [4.0, 3.0, 2.0]
403+
... ['Model', 'Passenger limt'],
404+
... ['Airbus A380-800', 853],
405+
... ['Boeing 747-400', 660],
406+
... ['Boeing 747-8', 605]
404407
... ]
405408
... }
406409
@@ -419,9 +422,9 @@ pass on an ordered dictionary to the function itself. For example:
419422
.. code-block:: python
420423
421424
>>> data = OrderedDict()
422-
>>> data.update({"Sheet 2": a_dictionary_of_two_dimensional_arrays['Sheet 2']})
423-
>>> data.update({"Sheet 1": a_dictionary_of_two_dimensional_arrays['Sheet 1']})
424-
>>> data.update({"Sheet 3": a_dictionary_of_two_dimensional_arrays['Sheet 3']})
425+
>>> data.update({"Sheet 2": a_dictionary_of_two_dimensional_arrays['Top 3 Airlines']})
426+
>>> data.update({"Sheet 1": a_dictionary_of_two_dimensional_arrays['Top 3 Aircraft Manufacturers']})
427+
>>> data.update({"Sheet 3": a_dictionary_of_two_dimensional_arrays['Biggest 3 Airoplanes']})
425428
>>> p.save_book_as(bookdict=data, dest_file_name="book.xls")
426429
427430
Let's verify its order:
@@ -432,7 +435,7 @@ Let's verify its order:
432435
>>> for key, item in book_dict.items():
433436
... print(json.dumps({key: item}))
434437
{"Sheet 2": [["X", "Y", "Z"], [1, 2, 3], [4, 5, 6]]}
435-
{"Sheet 1": [[1, 2, 3], [4, 5, 6], [7, 8, 9]]}
438+
{"Sheet 1": [["Name", "Revenue"], ["Lockheed Martin", "65.4 billion USD"], ["Airbus", "78.9 billion USD"], ["Boeing", "58.16 billion USD"]]}
436439
{"Sheet 3": [["O", "P", "Q"], [3, 2, 1], [4, 3, 2]]}
437440
438441
Please notice that "Sheet 2" is the first item in the *book_dict*, meaning the order of sheets are preserved.

docs/source/quickstart.rst

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -327,23 +327,26 @@ Suppose you want to save the below dictionary to an excel file :
327327
.. code-block:: python
328328
329329
>>> a_dictionary_of_two_dimensional_arrays = {
330-
... 'Sheet 1':
330+
... 'Top 3 Aircraft Manufacturers':
331331
... [
332-
... [1.0, 2.0, 3.0],
333-
... [4.0, 5.0, 6.0],
334-
... [7.0, 8.0, 9.0]
332+
... ['Name', 'Revenue'],
333+
... ['Lockheed Martin', '65.4 billion USD'],
334+
... ['Airbus', '78.9 billion USD'],
335+
... ['Boeing', '58.16 billion USD']
335336
... ],
336-
... 'Sheet 2':
337+
... 'Top 3 Airlines':
337338
... [
338-
... ['X', 'Y', 'Z'],
339-
... [1.0, 2.0, 3.0],
340-
... [4.0, 5.0, 6.0]
339+
... ['Name', 'Country', 'Revenue'],
340+
... ['Delta Air Lines', 'US', 61.6],
341+
... ['American Airlines Holdings', 'US', 57.1],
342+
... ['American Airlines Group', 'US', 54.2]
341343
... ],
342-
... 'Sheet 3':
344+
... 'Biggest 3 Airoplanes':
343345
... [
344-
... ['O', 'P', 'Q'],
345-
... [3.0, 2.0, 1.0],
346-
... [4.0, 3.0, 2.0]
346+
... ['Model', 'Passenger limt'],
347+
... ['Airbus A380-800', 853],
348+
... ['Boeing 747-400', 660],
349+
... ['Boeing 747-8', 605]
347350
... ]
348351
... }
349352
@@ -362,9 +365,9 @@ pass on an ordered dictionary to the function itself. For example:
362365
.. code-block:: python
363366
364367
>>> data = OrderedDict()
365-
>>> data.update({"Sheet 2": a_dictionary_of_two_dimensional_arrays['Sheet 2']})
366-
>>> data.update({"Sheet 1": a_dictionary_of_two_dimensional_arrays['Sheet 1']})
367-
>>> data.update({"Sheet 3": a_dictionary_of_two_dimensional_arrays['Sheet 3']})
368+
>>> data.update({"Sheet 2": a_dictionary_of_two_dimensional_arrays['Top 3 Airlines']})
369+
>>> data.update({"Sheet 1": a_dictionary_of_two_dimensional_arrays['Top 3 Aircraft Manufacturers']})
370+
>>> data.update({"Sheet 3": a_dictionary_of_two_dimensional_arrays['Biggest 3 Airoplanes']})
368371
>>> p.save_book_as(bookdict=data, dest_file_name="book.xls")
369372
370373
Let's verify its order:
@@ -375,7 +378,7 @@ Let's verify its order:
375378
>>> for key, item in book_dict.items():
376379
... print(json.dumps({key: item}))
377380
{"Sheet 2": [["X", "Y", "Z"], [1, 2, 3], [4, 5, 6]]}
378-
{"Sheet 1": [[1, 2, 3], [4, 5, 6], [7, 8, 9]]}
381+
{"Sheet 1": [["Name", "Revenue"], ["Lockheed Martin", "65.4 billion USD"], ["Airbus", "78.9 billion USD"], ["Boeing", "58.16 billion USD"]]}
379382
{"Sheet 3": [["O", "P", "Q"], [3, 2, 1], [4, 3, 2]]}
380383
381384
Please notice that "Sheet 2" is the first item in the *book_dict*, meaning the order of sheets are preserved.

0 commit comments

Comments
 (0)
0