Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
73 lines (46 sloc) 2.07 KB

Minimal example

Below is the smallest possible example that follows the theme: from zero to first Neptune experiment.


Go here: (registration is free of charge).

Copy API token

NEPTUNE_API_TOKEN is located under your User menu (top right side of the screen, like on the image below):


Assign it to the bash environment variable:


or append this line to your ~/.bashrc or ~/.bash_profile files (recommended).


Always keep your API token secret - it is like password to the application. It is recommended to append "export NEPTUNE_API_TOKEN='YOUR_LONG_API_TOKEN'" line to your ~/.bashrc or ~/.bash_profile files.

Install neptune-client

pip install neptune-client

Install psutil to see hardware monitoring charts:

pip3 install psutil

(please check psutil documentation in case of installation problems)

Run Python script

Save script below as and run it like any other Python file: python Will see link to the experiment printed to the standard output.

import neptune

# pick project, provide API token

# create experiment

# send some metrics
n = 117
for i in range(1, n):
    neptune.send_metric('iteration', i)
    neptune.send_metric('loss', 1/i**0.5)

neptune.set_property('n_iterations', n)

Congrats! You just ran your first Neptune experiment and checked results online.


What did you just learn? Few concepts:

  • how to run Neptune experiment
  • how to track it online
  • how to use basic Neptune client features, like create_experiment() and send_metric()
You can’t perform that action at this time.