DOC/API: Move Styler import
State: closed

From the top-level to pandas.io.formats.style.Styler, which is a bit wordy
but I was having circular-import issues at pandas.io.formats.
I think that's ok since people won't really be using this interactively.

Closes https://github.com/pandas-dev/pandas/issues/16009

Labels:
name: Docs
name: API Design

Comments:
api.rst also needs an update
In this issue (https://github.com/pandas-dev/pandas/issues/16009), I also raised the question whether we should deprecate the old location. But is there currently a reason that a user would use the actual object instead of access it through `df.style` ? (if not, the deprecation is probably not needed?)
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16059?src=pr&el=h1) Report
> Merging [#16059](https://codecov.io/gh/pandas-dev/pandas/pull/16059?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/f114af045f68ed960cba02d234a959301ad97a79?src=pr&el=desc) will **increase** coverage by `0.02%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #16059      +/-   ##
==========================================
+ Coverage   90.79%   90.82%   +0.02%     
==========================================
  Files         156      155       -1     
  Lines       50534    50518      -16     
==========================================
- Hits        45883    45881       -2     
+ Misses       4651     4637      -14
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.59% <ø> (+0.02%)` | :arrow_up: |
| #single | `40.45% <ø> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16059?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/api.py](https://codecov.io/gh/pandas-dev/pandas/pull/16059?src=pr&el=tree#diff-cGFuZGFzL2lvL2FwaS5weQ==) | `100% <ø> (+28.57%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16059?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/16059?src=pr&el=footer). Last update [f114af0...5516aa4](https://codecov.io/gh/pandas-dev/pandas/pull/16059?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

I believe api.rst was already changed as part of the move.

```
Style
-----
.. currentmodule:: pandas.io.formats.style

``Styler`` objects are returned by :attr:`pandas.DataFrame.style`.
```

For the deprecation... I could go either way. 5516aa4 adds a compatibility shim pointing to the new location. I'll add it to the master list if we decide to include it.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16059?src=pr&el=h1) Report
> Merging [#16059](https://codecov.io/gh/pandas-dev/pandas/pull/16059?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/f114af045f68ed960cba02d234a959301ad97a79?src=pr&el=desc) will **increase** coverage by `0.02%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #16059      +/-   ##
==========================================
+ Coverage   90.79%   90.81%   +0.02%     
==========================================
  Files         156      156              
  Lines       50534    50521      -13     
==========================================
  Hits        45883    45883              
+ Misses       4651     4638      -13
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.58% <100%> (+0.02%)` | :arrow_up: |
| #single | `40.45% <0%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16059?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/api.py](https://codecov.io/gh/pandas-dev/pandas/pull/16059?src=pr&el=tree#diff-cGFuZGFzL2lvL2FwaS5weQ==) | `100% <ø> (+28.57%)` | :arrow_up: |
| [pandas/formats/style.py](https://codecov.io/gh/pandas-dev/pandas/pull/16059?src=pr&el=tree#diff-cGFuZGFzL2Zvcm1hdHMvc3R5bGUucHk=) | `100% <100%> (ø)` | |
| [pandas/core/common.py](https://codecov.io/gh/pandas-dev/pandas/pull/16059?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tbW9uLnB5) | `90.68% <0%> (-0.35%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16059?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/16059?src=pr&el=footer). Last update [f114af0...5516aa4](https://codecov.io/gh/pandas-dev/pandas/pull/16059?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

> I believe api.rst was already changed as part of the move.

Ah yes, my bad! (I actually even said it myself https://github.com/pandas-dev/pandas/issues/16009#issuecomment-294867514 :-))
@jorisvandenbossche all good for you? Is everyone OK with a deprecation warning from `pandas.formats.style`, to be removed in 0.21?