Neptune Client Experimental
Project description
Neptune Experimental Package
This package consists of experimental features that are not yet ready for production use. The API is subject to change without notice.
Neptune Fetcher
Neptune Fetcher is a Python package designed for efficient fetching and manipulation of data from Neptune projects and runs. It provides classes and methods for interacting with Neptune data in a read-only manner.
Installation
pip install --upgrade neptune neptune-experimental
Usage
Importing
from neptune_fetcher import ReadOnlyProject
Overview of Classes
-
ReadOnlyProject
: A lightweight, read-only class for handling basic project information.- Constructor Parameters:
project
: Optional string specifying the project name.workspace
: Optional string specifying the workspace.api_token
: Optional string for the API token.proxies
: Optional dictionary for proxy configuration.
- Methods:
list_runs()
: Yields dictionaries with basic information about each run, includingsys/id
andsys/name
.fetch_read_only_runs(with_ids: List[str])
: Returns a generator forReadOnlyRun
instances for specified run IDs.fetch_runs()
: Fetches runs as a DataFrame with default columns.fetch_runs_df(columns, with_ids, states, owners, tags, trashed)
: Fetches runs as a DataFrame based on specified filters.
- Constructor Parameters:
-
ReadOnlyProject.ReadOnlyRun
: Represents a single Neptune run with read-only access.- Methods:
__getitem__(item)
: Accesses a field by its path.__delitem__(key)
: Removes a field from the local cache.field_names
: Yields the names of all available fields in the run.prefetch(paths: List[str])
: Loads values of specified fields into local cache.
- Methods:
Examples
Fetching Project Metadata
from neptune_fetcher import ReadOnlyProject
project = ReadOnlyProject(workspace="some", project="project")
Listing Runs in a Project
from neptune_fetcher import ReadOnlyProject
project = ReadOnlyProject(workspace="some", project="project")
ids = list(map(lambda row: row["sys/id"], project.list_runs()))
Filtering and Processing Runs
from neptune_fetcher import ReadOnlyProject
project = ReadOnlyProject(workspace="some", project="project")
df = project.fetch_runs_df()
matches = df["sys/name"].str.match("metrics.*")
ids = df[matches]["sys/id"]
Iterating Over Runs
from neptune_fetcher import ReadOnlyProject
project = ReadOnlyProject(workspace="some", project="project")
for run in project.fetch_read_only_runs(with_ids=["PROJ-2"]):
for field in run.field_names:
if field.startswith("param"):
print(run[field].fetch())
if field.startswith("metric"):
print(run[field].fetch_values())
Prefetching Values
run.prefetch(["metric1", "metric2"])
print(run["metric1"].fetch(), run["metric2"].fetch()) # This will use the local cache
Purging Local Cache
del run["metric1"]
Example
A full example can be found in examples/fetch_api.py
.
License
This project is licensed under the Apache License Version 2.0. For more details, see Apache License Version 2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for neptune_experimental-0.3.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e78862ebae53036a455197cde3c1b4c08a6690f79102618ca02550a1355ef94 |
|
MD5 | a8b6dddcac4dad945db61b8663bad506 |
|
BLAKE2b-256 | c58e9bbe0c18f53f2c6d7f667db7a36005b86df11b244a978abbb1bee0769280 |
Hashes for neptune_experimental-0.3.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff48462064b3733e3c0d1a557d4355f66b1328a9c08a371ab6bb09f9b52a6240 |
|
MD5 | 91fa9a8d13aab0ea181a61010f13dae4 |
|
BLAKE2b-256 | 3c55b964885bcfe3f7130c97b40a80c5d2d8066afb05b9a12d1c222f343877bc |