{"library":"neptune-query","title":"Neptune Query","description":"Neptune Query is a Python library (current version 1.14.1) for retrieving logged metadata from the Neptune MLOps platform. It provides a read-only API to programmatically fetch experiments, runs, and their associated attributes, often as Pandas DataFrames. The library is actively maintained with frequent minor and patch releases, offering a stable interface for data retrieval and analysis.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install neptune-query"],"cli":null},"imports":["import neptune_query as nq","import neptune_query.runs as nq_runs"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nimport neptune_query as nq\nimport pandas as pd\n\n# Set your Neptune API token and project name as environment variables.\n# Example: export NEPTUNE_API_TOKEN=\"YOUR_API_TOKEN\"\n# Example: export NEPTUNE_PROJECT=\"workspace-name/project-name\"\n\n# Ensure environment variables are set or pass them explicitly\nneptune_api_token = os.environ.get('NEPTUNE_API_TOKEN', 'YOUR_API_TOKEN_HERE')\nneptune_project = os.environ.get('NEPTUNE_PROJECT', 'your_workspace/your_project')\n\nif neptune_api_token == 'YOUR_API_TOKEN_HERE' or neptune_project == 'your_workspace/your_project':\n    print(\"Warning: Please set NEPTUNE_API_TOKEN and NEPTUNE_PROJECT environment variables or provide them explicitly.\")\n    # For demonstration, we'll skip further execution if credentials aren't set.\n    # In a real application, handle this appropriately (e.g., raise an error, prompt user).\n    exit()\n\n# Set the API token for the session (optional if NEPTUNE_API_TOKEN env var is set)\nnq.set_api_token(api_token=neptune_api_token)\n\n# List experiments in a project\nprint(f\"Listing experiments in project: {neptune_project}\")\nexperiment_names = nq.list_experiments(project=neptune_project)\nprint(f\"Found {len(experiment_names)} experiments: {experiment_names[:5]}...\")\n\n# Fetch a table of experiments with specific attributes\n# Fetch runs as rows and attributes as columns\ntable_df: pd.DataFrame = nq.fetch_experiments_table(\n    project=neptune_project,\n    columns=['sys/name', 'sys/creation_time', 'params/*', 'metrics/loss']\n)\n\nprint(\"\\nFetched experiments table (first 5 rows):\\n\")\nprint(table_df.head())\n\n# Fetch a specific metric series for an experiment\nif not table_df.empty:\n    first_experiment_name = table_df.iloc[0]['sys/name']\n    print(f\"\\nFetching 'metrics/loss' for experiment: {first_experiment_name}\")\n    metric_series_df = nq.fetch_metrics(\n        experiments=[first_experiment_name],\n        attributes=['metrics/loss']\n    )\n    print(\"\\nFetched metric series (first 5 rows):\\n\")\n    print(metric_series_df.head())","lang":"python","description":"This quickstart demonstrates how to authenticate with Neptune.ai, list experiments within a specified project, fetch experiment metadata as a DataFrame using `fetch_experiments_table`, and retrieve a specific metric series using `fetch_metrics`. It highlights the use of environment variables for credentials and explicit `project` arguments. Make sure to replace placeholder values or set your `NEPTUNE_API_TOKEN` and `NEPTUNE_PROJECT` environment variables before running.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"1.0.0b1","pypi_latest":"1.14.1","is_stale":true,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":10.8,"avg_import_s":2.43,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"neptune-query","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":2.47,"mem_mb":49.4,"disk_size":"200.8M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"neptune-query","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":10.8,"import_time_s":1.64,"mem_mb":47.5,"disk_size":"194M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"neptune-query","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":3.28,"mem_mb":56,"disk_size":"216.6M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"neptune-query","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":10.3,"import_time_s":2.49,"mem_mb":54.3,"disk_size":"209M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"neptune-query","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":3.12,"mem_mb":55,"disk_size":"201.2M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"neptune-query","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":9.9,"import_time_s":2.93,"mem_mb":53.3,"disk_size":"193M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"neptune-query","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":3.09,"mem_mb":56.1,"disk_size":"200.1M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"neptune-query","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":9.9,"import_time_s":2.69,"mem_mb":54.4,"disk_size":"192M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"neptune-query","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.36,"mem_mb":39.2,"disk_size":"209.2M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"neptune-query","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":13,"import_time_s":1.26,"mem_mb":37.7,"disk_size":"204M"}]}}