CLN: Preliminary formatter refactor
State: closed

- [x] based on discussion here: https://github.com/pandas-dev/pandas/pull/20032#pullrequestreview-101917292
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

This PR splits the various formatters into different files so that it's easier to refactor a specific formatter. 

Labels:
name: Output-Formatting
description: __repr__ of pandas objects, to_string
name: IO CSV
description: read_csv, to_csv
name: IO HTML
description: read_html, to_html, Styler.apply, Styler.applymap
name: Clean
name: IO LaTeX
description: to_latex

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/20051?src=pr&el=h1) Report
> Merging [#20051](https://codecov.io/gh/pandas-dev/pandas/pull/20051?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/7c14e4f14aff216be558bf5d4d2d00b4838c2360?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `93.75%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/20051/graphs/tree.svg?height=150&width=650&src=pr&token=eZ4WkYLtcO)](https://codecov.io/gh/pandas-dev/pandas/pull/20051?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #20051      +/-   ##
==========================================
+ Coverage   91.72%   91.73%   +<.01%     
==========================================
  Files         150      152       +2     
  Lines       49122    49180      +58     
==========================================
+ Hits        45057    45114      +57     
- Misses       4065     4066       +1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.11% <93.75%> (ø)` | :arrow_up: |
| #single | `41.79% <18.59%> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/20051?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/formats/latex.py](https://codecov.io/gh/pandas-dev/pandas/pull/20051/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvbGF0ZXgucHk=) | `100% <100%> (ø)` | |
| [pandas/io/formats/excel.py](https://codecov.io/gh/pandas-dev/pandas/pull/20051/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvZXhjZWwucHk=) | `97.36% <100%> (ø)` | :arrow_up: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/20051/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.18% <100%> (ø)` | :arrow_up: |
| [pandas/io/formats/html.py](https://codecov.io/gh/pandas-dev/pandas/pull/20051/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvaHRtbC5weQ==) | `88.85% <88.85%> (ø)` | |
| [pandas/io/formats/format.py](https://codecov.io/gh/pandas-dev/pandas/pull/20051/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvZm9ybWF0LnB5) | `98.24% <96.15%> (+1.98%)` | :arrow_up: |
| [pandas/io/formats/csvs.py](https://codecov.io/gh/pandas-dev/pandas/pull/20051/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvY3N2cy5weQ==) | `98.05% <98.05%> (ø)` | |
| [pandas/core/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/20051/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYmFzZS5weQ==) | `96.78% <0%> (-0.02%)` | :arrow_down: |
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/20051/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `95.64% <0%> (-0.01%)` | :arrow_down: |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/20051/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `93.85% <0%> (-0.01%)` | :arrow_down: |
| [pandas/core/groupby.py](https://codecov.io/gh/pandas-dev/pandas/pull/20051/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ3JvdXBieS5weQ==) | `92.14% <0%> (-0.01%)` | :arrow_down: |
| ... and [12 more](https://codecov.io/gh/pandas-dev/pandas/pull/20051/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/20051?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/20051?src=pr&el=footer). Last update [7c14e4f...c9b4504](https://codecov.io/gh/pandas-dev/pandas/pull/20051?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Hmm. Not sure why Travis failed and AppVeyor succeeded.

you have a lint error
```
inside ci/lint.sh
Linting *.py
pandas/io/formats/format.py:33:1: F401 'pandas.io.formats.csv_format.CSVFormatter' imported but unused
Linting *.py DONE
```
ok I fixed up the imports a bit to make them more idiomatic. I think its possible to completely remove pandas.io.formats.common and just move these 2 functions back to .formats. No real reason to have an extra file here. see if you can do that.
thanks @shangyian 

will merge a bit later (after doc sprint)
@jreback - cool. I also moved the two functions in io.formats.common to formats.format
can you rebase on master. ping on green.