{"id":14769,"library":"nr-util","title":"nr-util","description":"nr-util is a general-purpose Python utility library. It aims to provide common helper functions and tools for various programming tasks. The current version is 0.8.12, released on June 20, 2022. Its release cadence appears irregular, based on PyPI upload history.","status":"active","version":"0.8.12","language":"en","source_language":"en","source_url":"https://github.com/NiklasRosenstein/python-nr.util","tags":["utility","helpers","general-purpose","development"],"install":[{"cmd":"pip install nr-util","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"The library is modular; specific utilities are imported from submodules or directly from the top-level package, e.g., 'from nr.util.fs import Path' or 'from nr.util.digraph import Digraph'.","symbol":"anything","correct":"from nr.util import anything"}],"quickstart":{"code":"from nr.util.digraph import Digraph\n\ng = Digraph()\ng.add_node('A')\ng.add_node('B')\ng.add_node('C')\ng.add_edge('A', 'B')\ng.add_edge('B', 'C')\n\nprint(f\"Nodes: {g.nodes}\")\nprint(f\"Edges: {g.edges}\")\nprint(f\"Is DAG: {g.is_dag()}\")","lang":"python","description":"This quickstart demonstrates basic usage of the `Digraph` utility for working with directed graphs."},"warnings":[{"fix":"Always pin to a specific patch version (e.g., `nr-util==0.8.12`) and manually review the GitHub repository's change history or module-specific PyPI descriptions (e.g., `nr.utils.re`) before upgrading.","message":"The library uses 0.x.y versioning, meaning minor version increments (e.g., 0.8.x to 0.9.x) may introduce breaking API changes without a major version bump. Users should review changelogs carefully when upgrading.","severity":"breaking","affected_versions":"All 0.x.y versions"},{"fix":"Remember that `pip install nr-util` corresponds to `import nr.util` in your Python code.","message":"The package name on PyPI is 'nr-util', but imports typically use 'nr.util' (e.g., `from nr.util import ...`). This discrepancy is common but can be confusing for new users.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Consult the official GitHub repository for the correct module structure and available utilities. Verify the exact import path for the desired functionality. For example, some utilities might be under `nr.util.fs` or `nr.util.digraph`.","cause":"Attempting to import a submodule or utility that does not exist, or using an incorrect import path.","error":"ModuleNotFoundError: No module named 'nr.util.some_module'"},{"fix":"Ensure you are importing specific components from `nr.util` or its submodules. For example, instead of `import nr.util; nr.util.some_function()`, use `from nr.util.some_module import some_function; some_function()`.","cause":"The user is trying to call the top-level `nr.util` module directly as a function or object, rather than importing a specific utility function or class from it.","error":"TypeError: 'module' object is not callable (when trying to use a utility directly after `import nr.util`)"}],"ecosystem":"pypi"}