Skip to main content

NERIS API Client

A Python class to interact with the NERIS API programmatically.

NOTE: Due to the changes and transition to using Oauth 2.0 version 1.2 is now deprecated. Please upgrade to version 1.3. You can do that in a package manager with the following update: neris-api-client = ">=1.3" or in your requirements.txt you can do neris-api-client >=1.3. Or you can install with pip install neris_api_client>=1.3..

Versioning

This API client does not directly follow semver practices. In order to remove confusion between the NERIS API client and API, we have decided to align the major version of this client with the major version of the API release. The minor and patch versions of this client will differ from API release version, they will instead represent changes made to the API client itself.

Installation

To install:

pip install neris-api-client

Package published on PyPi: NERIS API Client

Usage

Auth with password auth flow

All config parameters can be specified as environment variables prefixed with NERIS_ e.g. NERIS_GRANT_TYPE=password.

from neris_api_client import NerisApiClient, Config

client = NerisApiClient(
    Config(
        base_url="https://api-test.neris.fsri.org/v1",
        grant_type="password",
        username="neris.user@email.co",
        password="*******",
        # Supply a custom user agent header value
        user_agent="MyApp/1.0",
    )
)

# Get an entity
entity = client.get_entity("FD24027240")

# If MFA enabled, prompt for auth challenge answer
Provide MFA code for email_otp: ******

Auth with client_credentials auth flow

All config parameters can be specified as environment variables prefixed with NERIS_ e.g. NERIS_GRANT_TYPE=client_credentials.

from neris_api_client import NerisApiClient, Config

client = NerisApiClient(
    Config(
        base_url="https://api-test.neris.fsri.org/v1",
        grant_type="client_credentials",
        client_id="********************",
        client_secret="***************",
        # Supply a custom user agent header value
        user_agent="FireFirst/1.0",
    )
)

# Get an entity
entity = client.get_entity("FD24027240")

Using environment varables to instantiate the library

Configuration should be stored in the environment. The following uses dotenv to load the configuration, but you can use whatever you like. In the cloud, you might load all of these values into the environment from an encrypted parameter store.

All variables prefixed are prefixed with NERIS_

  • See env.example for the parameter options.
  • Store the /env file in the current working directory.
from dotenv import load_dotenv
from neris_api_client import NerisApiClient, Config

 # Credentials must be defined in .env
load_dotenv()
client = NerisApiClient()

# Get an entity
entity = client.get_entity("FD24027240")

Additional config parameters

Parameter Description
debug Controls whether the application outputs debug information.
validate Controls whether the client performs model validations.

Disclaimer

The models in this package are generated using datamodel-code-generator and are not guaranteed to contain all of the information present in the full specification. The generated models are used to validate request payloads prior to API submission.

Additional Information

To ask a question, make a suggestion, or otherwise get help with the NERIS API Client, please visit the NERIS helpdesk.

Beta sandbox users:

  • Be sure to use the base URL https://api-test.neris.fsri.org/v1 with the NERIS API Client. You will not be able to authenticate requests in the other environments.
  • For the beta testing period, your user is only authorized to perform actions on behalf of the FSRI Fire Department FD24027214.

Metadata

Release files for neris-api-client 1.5.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for neris-api-client 1.5.7
File Size Uploaded Provenance Actions
neris_api_client-1.5.7.tar.gz 104.3 kB Without provenance Details for neris_api_client-1.5.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for neris-api-client 1.5.7
File Interpreter ABI Platform Actions
neris_api_client-1.5.7-py3-none-any.whl Python 3 none any Details for neris_api_client-1.5.7-py3-none-any.whl

Total release size: 207.7 kB

Release files / neris_api_client-1.5.7.tar.gz

Download URL neris_api_client-1.5.7.tar.gz
Size 104.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3b59a97b4ea586b7e0546f45c58c1a45723bd088796746691be5ca14cf7b2add
BLAKE2b-256 checksum
How to use checksums
0a1492893e9e265adbb7292e13b74b634df53ab104d2bf9f845ea8df2e723e5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.22

Release files / neris_api_client-1.5.7-py3-none-any.whl

Download URL neris_api_client-1.5.7-py3-none-any.whl
Size 103.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ec0e14890551a983d72f2dfb98e7ad815f88e7d15c035d3178484b776c5cce8
BLAKE2b-256 checksum
How to use checksums
8d0b57e8b12cb0713cc1100851f67182bee10f1465ed79bcfb37c8d959a08ca6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.22

Security for neris-api-client 1.5.7

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.

Release history Release notifications | RSS feed

This release

1.5.7 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page