Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions arkouda/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,42 @@
Classes
-------
HistoryRetriever
Abstract base class defining the `retrieve` method and a helper for filtering commands.
Abstract base class defining the ``retrieve`` method and a helper
for filtering commands.

ShellHistoryRetriever
Retrieves command history from a Python REPL shell using `readline`.
Retrieves command history from a Python REPL shell using ``readline``.

NotebookHistoryRetriever
Retrieves command history from a Jupyter notebook or IPython shell via IPython's history database.
Retrieves command history from a Jupyter notebook or IPython shell
via IPython's history database.

Usage
-----
Used internally by `arkouda.generate_history()` to provide a user-friendly interface
for querying and filtering past commands based on optional string filters and count limits.
Used internally by ``arkouda.generate_history()`` to provide a
user-friendly interface for querying and filtering past commands based
on optional string filters and count limits.

Examples
--------
>>> from arkouda.history import ShellHistoryRetriever, NotebookHistoryRetriever

# REPL mode
REPL mode:

>>> h = ShellHistoryRetriever()
>>> h.retrieve(command_filter="ak.", num_commands=5) # doctest: +SKIP
>>> h.retrieve(command_filter="ak.", num_commands=5) # doctest: +SKIP
['ak.array([1,2,3])', 'ak.sum(...)', ...]

# Notebook mode
Notebook mode:

>>> h = NotebookHistoryRetriever() # doctest: +SKIP
>>> h.retrieve(num_commands=3) # doctest: +SKIP
['ak.connect()', 'df = ak.DataFrame(...)', 'ak.argsort(...)']

See Also
--------
arkouda.generate_history : High-level function for retrieving command history.

arkouda.generate_history
High-level function for retrieving command history.
"""

import readline
Expand Down