Skip to main content
App version: 3.20250811

Migrate from Fetcher Alpha to Query API

To update your code from neptune_fetcher.alpha to neptune_query:

  1. Instead of neptune-fetcher, install:

    pip install "neptune-query>=1.0.0,<2.0.0"
  2. Change the import statements to the following:

    import neptune_query as nq
    import neptune_query.runs as nq_runs
    from neptune_query.filters import Filter, Attribute, AttributeFilter
  3. To override the Neptune project or API token set by environment variables, use the following instead of the Context class:

    • To set the API token for the session, call nq.set_api_token("SomeNeptuneApiToken").
    • To set the project, pass the project path to the project argument of any fetching method.
  4. The aggregation argument of Attribute and AttributeFilter is removed. Change your script to no longer use this parameter.

  5. Because the extended syntax is supported for regular expressions, some filter options have been streamlined.

    • The following Filter methods have been replaced:

      • matches_all(), matches_none()matches()
      • name_in(), name_eqname()
    • The following AttributeFilter parameters have been replaced:

      • name_eq, name_in, name_matches_all, name_matches_nonename
      • type_intype
  6. The Filter.any() and Filter.all() methods are removed. To join filters, use the operators | and & instead.