Repository: pandas-dev/pandas

Issue:
Expose ExcelWriter as part of the Generated API
It has a docstring already (though it could use some examples) and would cover usage questions like the below:

https://stackoverflow.com/questions/46173710/where-can-i-find-the-excelwriter-documentation



Discussion:
Hey WillAyd, I am trying to star contributing to pandas, I think this ticket could be a good start point for me, could you assign it to me?
We don't use the assignment feature in GitHub but feel free to work on it
@WillAyd : I use it from time to time as a way to get pinged should PR's or issues fall to the way side (@jreback at times will do a cleaning of stale issues / PR's).  But in this case, @gorbondiga , no need to assign it to you.  It's clear from the conversation history that you wanted to work on this first 🙂 
Is this still needing work?
@illegalnumbers : Indeed, it does!  Go for it, if you want.
I'll see if I can find some time in the next couple days!

Resolving patch:
diff --git a/pandas/core/generic.py b/pandas/core/generic.py
--- a/pandas/core/generic.py
+++ b/pandas/core/generic.py
@@ -1924,11 +1924,17 @@ def _repr_latex_(self):
     If you wish to write to more than one sheet in the workbook, it is
     necessary to specify an ExcelWriter object:
 
-    >>> writer = pd.ExcelWriter('output2.xlsx', engine='xlsxwriter')
-    >>> df1.to_excel(writer, sheet_name='Sheet1')
     >>> df2 = df1.copy()
-    >>> df2.to_excel(writer, sheet_name='Sheet2')
-    >>> writer.save()
+    >>> with pd.ExcelWriter('output.xlsx') as writer:
+    ...     df1.to_excel(writer, sheet_name='Sheet_name_1')
+    ...     df2.to_excel(writer, sheet_name='Sheet_name_2')
+
+    To set the library that is used to write the Excel file,
+    you can pass the `engine` keyword (the default engine is
+    automatically chosen depending on the file extension):
+
+    >>> df1.to_excel('output1.xlsx', engine='xlsxwriter')
+
     """
 
     def to_json(self, path_or_buf=None, orient=None, date_format=None,
diff --git a/pandas/io/excel.py b/pandas/io/excel.py
--- a/pandas/io/excel.py
+++ b/pandas/io/excel.py
@@ -824,8 +824,43 @@ class ExcelWriter(object):
 
     Notes
     -----
+    None of the methods and properties are considered public.
+
     For compatibility with CSV writers, ExcelWriter serializes lists
     and dicts to strings before writing.
+
+    Examples
+    --------
+    Default usage:
+
+    >>> with ExcelWriter('path_to_file.xlsx') as writer:
+    ...     df.to_excel(writer)
+
+    To write to separate sheets in a single file:
+
+    >>> with ExcelWriter('path_to_file.xlsx') as writer:
+    ...     df1.to_excel(writer, sheet_name='Sheet1')
+    ...     df2.to_excel(writer, sheet_name='Sheet2')
+
+    You can set the date format or datetime format:
+
+    >>> with ExcelWriter('path_to_file.xlsx',
+                          date_format='YYYY-MM-DD',
+                          datetime_format='YYYY-MM-DD HH:MM:SS') as writer:
+    ...     df.to_excel(writer)
+
+    You can also append to an existing Excel file:
+
+    >>> with ExcelWriter('path_to_file.xlsx', mode='a') as writer:
+    ...     df.to_excel(writer, sheet_name='Sheet3')
+
+    Attributes
+    ----------
+    None
+
+    Methods
+    -------
+    None
     """
     # Defining an ExcelWriter implementation (see abstract methods for more...)
 


Test patch: