Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: allows word / PPT / outlook formatting as output of to_clipboard #57303

Closed
1 of 3 tasks
lcrmorin opened this issue Feb 8, 2024 · 3 comments
Closed
1 of 3 tasks
Labels
Closing Candidate May be closeable, needs more eyeballs Enhancement IO Data IO issues that don't fit into a more specific label Needs Discussion Requires discussion from core team before further action Styler conditional formatting using DataFrame.style

Comments

@lcrmorin
Copy link

lcrmorin commented Feb 8, 2024

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

The function to_clipboard allow to copy a dataframe, then paste it. It has an option to format the data such as it is pastable directly into Excel. However it doesn't allow to paste the data into MS Word / Powerpoint / Outlook. Also - it might be a different issue - but it would be very nice to be able to copy style, as currently to_clipboard throws an error on a styler object.

Best,
Lucas

Feature Description

  • allows to clipboard to works on styler objects
  • allows and option in to_clipboard to copy_paste to MS word / outlook / ppt

Alternative Solutions

current solution is to use pyperclip then copy paste into excel then into MS word / outlook / ppt

Additional Context

No response

@lcrmorin lcrmorin added Enhancement Needs Triage Issue that has not been reviewed by a pandas team member labels Feb 8, 2024
@simonjayhawkins simonjayhawkins added Styler conditional formatting using DataFrame.style IO Data IO issues that don't fit into a more specific label labels Feb 8, 2024
@rhshadrach
Copy link
Member

rhshadrach commented Feb 9, 2024

Thanks for the request. Is there a suggested implementation? Here is the implementation for excel=True

if sep is None:
    sep = "\t"
buf = StringIO()

# clipboard_set (pyperclip) expects unicode
obj.to_csv(buf, sep=sep, encoding="utf-8", **kwargs)
text = buf.getvalue()

clipboard_set(text)

It seems to me an implementation for Word, PowerPoint, Outlook, and other applications would be much more effort and outside the scope of pandas.

@rhshadrach rhshadrach added the Closing Candidate May be closeable, needs more eyeballs label Feb 9, 2024
@lcrmorin
Copy link
Author

I am trying to understand what would be needed. I am asking here and there and will propose something when I figure out what would word need.

@rhshadrach rhshadrach added Needs Discussion Requires discussion from core team before further action and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Feb 25, 2024
@phofl
Copy link
Member

phofl commented Mar 18, 2024

I don't think that we want to take on the burden of maintaining compatibility with these formats, this would need a 3rd party package that we could dispatch to

@phofl phofl closed this as completed Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closing Candidate May be closeable, needs more eyeballs Enhancement IO Data IO issues that don't fit into a more specific label Needs Discussion Requires discussion from core team before further action Styler conditional formatting using DataFrame.style
Projects
None yet
Development

No branches or pull requests

4 participants