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="*******",
    )
)

# 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="***************",
    )
)

# 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neris_api_client-1.5.5.tar.gz (103.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neris_api_client-1.5.5-py3-none-any.whl (102.7 kB view details)

Uploaded Python 3

File details

Details for the file neris_api_client-1.5.5.tar.gz.

File metadata

  • Download URL: neris_api_client-1.5.5.tar.gz
  • Upload date:
  • Size: 103.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for neris_api_client-1.5.5.tar.gz
Algorithm Hash digest
SHA256 291c2fdb12261989cc971b4ec614a9d007a2ba3f90ebc92e609bbb560bf43e9b
MD5 22e8b7236adf5266e29bb8e48a64db9a
BLAKE2b-256 8a0612aa0eccc88cf68e6e36fe4de42a6bf3a9024fa3a3d8bb3c780178af530d

See more details on using hashes here.

File details

Details for the file neris_api_client-1.5.5-py3-none-any.whl.

File metadata

File hashes

Hashes for neris_api_client-1.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ed1e94822d72624324c02aeb33df1b3f6c7866b39ef0be2eb1ebb32c5af42455
MD5 1aa1d4565d69c642ed89ee80d191a5b0
BLAKE2b-256 570f3ae4de530f2047491e6d7b066327d25d3cf21d33542c4b533f9c045fd23c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.5.5 This release

2 files

1.5.4

2 files

1.5.3

2 files

1.5.2

2 files

1.5.1

2 files

1.5.0

2 files

1.4.0

2 files

1.3.6

2 files

1.3.5

2 files

1.3.4

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.1.post0

2 files

1.2.0.post0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.1

2 files

1.0.0

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5.post0

2 files

0.1.5

2 files

0.1.4.post0

2 files

0.1.4

2 files

0.1.3.post0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

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