Video Walkthrough

What will you get with this integration?

This integration lets you log any standalone HTML string object or file with Neptune API and have it displayed interactively in the Neptune UI.


This guide will show you how to:

Step 0: Before you start

Make sure you have the neptune-client installed.

pip install neptune-client

This integration is tested with neptune-client==0.9.19

Step 1: Import and initialize Neptune

import as neptune
run = neptune.init(api_token='<your_api_token>', project='<your_project_name>')

You can use the api_token='ANONYMOUS' and project='common/html-support' to explore without having to create a Neptune account

Executing this cell will give you a link looking like: with common/html-support replaced by your project, and HTMLSUP-13 replaced by your run.

Click on the link to open the run in Neptune. For now, it is empty but keep the tab with the run open to see what happens next.

Step 2: Log HTML objects to Neptune

Create a sample HTML string and file

html_str = "<button type='button', style='background-color:#005879; width:400px; height:400px; font-size:30px'> <a style='color: #ccc', href=''> Take me back to the docs!<a> </button>"
with open('sample.html', 'w') as f:

Log HTML string object

run['html_obj'].upload(neptune.types.File.from_content(html_str, extension='html'))

Log HTML file


Step 3: Stop logging

Once you are done logging, you should stop tracking the run using the stop() method. This is needed only while logging from a notebook environment. While logging through a script, Neptune automatically stops tracking once the script has completed execution.


Step 4: Explore the HTML object in Neptune

The object can be found in the All metadata section:


You’ve learned how to:

  • Initialize Neptune and create a run,

  • Log HTML string objects to Neptune,

  • Log HTML files to Neptune.

What's next

Now that you know how to log HTML objects to Neptune, you can learn: