IPython saves its history in a history. sqlite file in ~/. ipython/profile_default/ . In there you'll find the tables: sessions (with timestamps), history and output_history .
IPython stores its files—config, command history and extensions—in the directory ~/. ipython/ by default. If set, this environment variable should be the path to a directory, which IPython will use for user data.
History is store on $(ipython locate)/profile_default/history. sqlite by default. You can remove the file, and or do any operation you want on it (secure erase, etc..). It's an sqlite file so you can load it with any sqlite program and do query on it.
Documentation: Jupyter Notebook can show that documentation of the function you are calling. Press Shift+Tab to view the documentation. This is very helpful as you don't need to open the documentation website every single time. This feature also works for the local custom functions.
In ipython enter:
%history -g
It does not print time codes but it does print session/line number.
First use %hist -o -g -f ipython_history.md to output the history (input and output) to a text file. (http://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-history)
Then you can use the the get_session_info function to retreive the date and time for the session you are interested in.(http://ipython.readthedocs.io/en/stable/api/generated/IPython.core.history.html?highlight=hist#IPython.core.history.HistoryAccessor.get_session_info)
profile_hist=IPython.core.history.HistoryAccessor(profile='default')
profile_hist.get_session_info(100)
This will print out something like
(100, datetime.datetime(2018, 2, 13, 19, 8, 30, 40691), None, None, '')
This means that the session 100 started on the 13th of Feb 2018 19:08:30.
Here's the Firefox extension that @larssend found: SQLite Manager
It has a GUI for opening a database file and issuing various sqlite commands from a menu. You get the added bonus of seeing the SQL commands that generated the output. Here's mine for my ipython %history in ~/.ipython/profile_default/history.sqlite:

And it even has a menu for generating plots (scatter, line, bar, etc) from your data!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With