@@ -53,7 +53,7 @@ pip install tabulate
5353Build status
5454------------
5555
56- [ ![ Build status ] ( https://circleci .com/gh/ astanin/python-tabulate. svg?style=svg )] ( https://circleci .com/gh/ astanin/python-tabulate/tree/master ) [ ![ Build status] ( https://ci.appveyor.com/api/projects/status/8745yksvvol7h3d7/branch/master?svg=true )] ( https://ci.appveyor.com/project/astanin/python-tabulate/branch/master )
56+ [ ![ python-tabulate ] ( https://github .com/astanin/python-tabulate/actions/workflows/github-actions-tox.yml/badge. svg )] ( https://github .com/astanin/python-tabulate/actions/workflows/github-actions-tox.yml ) [ ![ Build status] ( https://ci.appveyor.com/api/projects/status/8745yksvvol7h3d7/branch/master?svg=true )] ( https://ci.appveyor.com/project/astanin/python-tabulate/branch/master )
5757
5858Library usage
5959-------------
@@ -81,7 +81,7 @@ The following tabular data types are supported:
8181- list of lists or another iterable of iterables
8282- list or another iterable of dicts (keys as columns)
8383- dict of iterables (keys as columns)
84- - list of dataclasses (Python 3.7+ only, field names as columns)
84+ - list of dataclasses (field names as columns)
8585- two-dimensional NumPy array
8686- NumPy record arrays (names as columns)
8787- pandas.DataFrame
@@ -121,10 +121,22 @@ dictionaries or named tuples:
121121``` pycon
122122>>> print (tabulate({" Name" : [" Alice" , " Bob" ],
123123... " Age" : [24 , 19 ]}, headers= " keys" ))
124- Age Name
125- ----- ------
126- 24 Alice
127- 19 Bob
124+ Name Age
125+ ------ -----
126+ Alice 24
127+ Bob 19
128+ ```
129+
130+ When data is a list of dictionaries, a dictionary can be passed as ` headers `
131+ to replace the keys with other column labels:
132+
133+ ``` pycon
134+ >>> print (tabulate([{1 : " Alice" , 2 : 24 }, {1 : " Bob" , 2 : 19 }],
135+ ... headers= {1 : " Name" , 2 : " Age" }))
136+ Name Age
137+ ------ -----
138+ Alice 24
139+ Bob 19
128140```
129141
130142### Row Indices
@@ -1074,33 +1086,33 @@ To run tests on all supported Python versions, make sure all Python
10741086interpreters, ` pytest ` and ` tox ` are installed, then run ` tox ` in the root
10751087of the project source tree.
10761088
1077- On Linux ` tox ` expects to find executables like ` python3.7 ` , ` python3.8 ` etc.
1078- On Windows it looks for ` C:\Python37 \python.exe ` , ` C:\Python38 \python.exe ` etc. respectively.
1089+ On Linux ` tox ` expects to find executables like ` python3.11 ` , ` python3.12 ` etc.
1090+ On Windows it looks for ` C:\Python311 \python.exe ` , ` C:\Python312 \python.exe ` etc. respectively.
10791091
10801092One way to install all the required versions of the Python interpreter is to use [ pyenv] ( https://github.com/pyenv/pyenv ) .
10811093All versions can then be easily installed with something like:
10821094
1083- pyenv install 3.7.12
1084- pyenv install 3.8.12
1095+ pyenv install 3.11.7
1096+ pyenv install 3.12.1
10851097 ...
10861098
10871099Don't forget to change your ` PATH ` so that ` tox ` knows how to find all the installed versions. Something like
10881100
10891101 export PATH="${PATH}:${HOME}/.pyenv/shims"
10901102
10911103To test only some Python environments, use ` -e ` option. For example, to
1092- test only against Python 3.7 and Python 3.10 , run:
1104+ test only against Python 3.11 and Python 3.12 , run:
10931105
10941106``` shell
1095- tox -e py37,py310
1107+ tox -e py311,py312
10961108```
10971109
10981110in the root of the project source tree.
10991111
11001112To enable NumPy and Pandas tests, run:
11011113
11021114``` shell
1103- tox -e py37 -extra,py310 -extra
1115+ tox -e py311 -extra,py312 -extra
11041116```
11051117
11061118(this may take a long time the first time, because NumPy and Pandas will
0 commit comments