New Relic SB SDK
Automate your SRE tasks with ease using the New Relic SB SDK.
This library provides a robust, typed Python client for the New Relic NerdGraph
API, built on top of sgqlc. It simplifies the process of querying and
mutating New Relic data, making it easier to build automation tools, monitoring
scripts, and custom dashboards.
✨ Features
- Typed Interactions: Leveraging
sgqlcfor type-safe GraphQL queries. - Easy Configuration: Simple setup with environment variables or direct initialization.
- Comprehensive Coverage: Designed to support key SRE workflows.
- Modern Stack: Built with Python 3.10+ and modern tooling.
📋 Requirements
- Python 3.10.0 or higher
📦 Installation
Using pip
pip install newrelic-sb-sdk
Using uv
uv add newrelic-sb-sdk
🚀 Usage
Here is a simple example of how to use the NewRelicGqlClient to query the
current user's information from New Relic.
import os
from newrelic_sb_sdk.client import NewRelicGqlClient
from sgqlc.operation import Operation
# Initialize the client
# Ensure NEW_RELIC_USER_KEY is set in your environment or pass it directly
client = NewRelicGqlClient(new_relic_user_key=os.getenv("NEW_RELIC_USER_KEY"))
# Create an operation based on the New Relic schema
op = Operation(client.schema.query_type)
# Select fields to query
op.actor.user.__fields__(
"name",
"email",
"id"
)
# Execute the query
response = client.execute(op)
# Access the data as native Python objects
data = op + response.json()
user = data.actor.user
print(f"User: {user.name} <{user.email}> (ID: {user.id})")
For more advanced usage and examples, check out our Documentation and Playground.
🛠️ Development
We welcome contributions! Please see our Contribution Guide for details on setting up your development environment, running tests, and submitting pull requests.
The project uses uv for dependency management and ruff for linting.
📜 Changelog
See the CHANGELOG.md for a history of changes.
👥 Contributors
See our list of contributors.
📄 License
This project is licensed under the Apache License 2.0. See the LICENSE.txt file for details.
Metadata
Release files for newrelic-sb-sdk 0.47.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| newrelic_sb_sdk-0.47.0.tar.gz | 271.7 kB | Without provenance | Details for newrelic_sb_sdk-0.47.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| newrelic_sb_sdk-0.47.0-py3-none-any.whl | Python 3 | none | any | Details for newrelic_sb_sdk-0.47.0-py3-none-any.whl |
Total release size: 531.1 kB
Release files / newrelic_sb_sdk-0.47.0.tar.gz
| Download URL | newrelic_sb_sdk-0.47.0.tar.gz |
|---|---|
| Size | 271.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fbbe525584b760dfc897db35b43591761648fd9d3754cf8962cf614b4a9b8569
|
|
BLAKE2b-256 checksum How to use checksums |
87b806084851b673d0b281bc2c157a5e0854a68eab850aa83c2c1027e240e80b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / newrelic_sb_sdk-0.47.0-py3-none-any.whl
| Download URL | newrelic_sb_sdk-0.47.0-py3-none-any.whl |
|---|---|
| Size | 259.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f617f55e92fc8a1e818c3eb8fe82fba0f59f412a98ecd0cacd92c12f12e859a7
|
|
BLAKE2b-256 checksum How to use checksums |
7a90bc73c447bbad213da05f8fde74d4aa7df3d5735b564e04de23bdad6b4e26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for newrelic-sb-sdk 0.47.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.