Registry / http-networking / python-nomad

python-nomad

JSON →
library2.1.0pypypi✓ verified 87d ago

Client library for Hashicorp Nomad, currently at version 2.1.0. Provides a Pythonic interface to the Nomad HTTP API. Release cadence is irregular with occasional major breaking changes.

pip install python-nomad
INSTALL
IMPORT
SIG · PYTHON-NOMAD
P
python-nomad
http-networkingpythonv2.1.0
Install
2.1s avg
Import
605ms
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.654s · 21.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.1s · import 0.556s · 22MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Nomad
from nomad import Nomad
from python_nomad import Nomad
Package name is 'nomad' not 'python_nomad'
NomadException
from nomad.api.exceptions import BaseNomadException
from nomad import NomadException
Exception classes are under nomad.api.exceptions

Initialise a Nomad client and list all jobs.

from nomad import Nomad client = Nomad( host='http://127.0.0.1:4646', token=os.environ.get('NOMAD_TOKEN', ''), ) jobs = client.jobs.get_jobs() print(jobs)
Debug
Known issues
breakingIn version 2.0.0, arguments named 'id' and 'type' were renamed to 'id_' and 'type_' to avoid shadowing built-ins. Code using keyword arguments 'id=' or 'type=' will break.
fix
Rename 'id' to 'id_' and 'type' to 'type_' in all API calls.
affects: >=2.0.0
breakingPython 2 and Python 3.6 support dropped in version 2.0.0. Also drop Python 3.5 in 1.5.0.
fix
Upgrade to Python 3.7+.
affects: >=2.0.0
gotchaThe environment variable NOMAD_ADDR is not read automatically; you must pass 'host' explicitly to Nomad constructor. Only NOMAD_TOKEN is read from environment by default.
fix
Always pass host='http://your-nomad-server:4646' or implement custom env var reading.
affects: all
deprecatedThe 'registry' endpoint methods (e.g., client.registry) may be deprecated in favor of 'vars' and 'var' endpoints. Check Nomad API documentation.
fix
Use client.vars and client.var for accessing variable endpoints.
affects: >=1.5.0
Errors
Common errors & fixes
ImportError: cannot import name 'Nomad' from 'nomad'
The package is not installed or import path is incorrect. Usually means 'python-nomad' is not installed.
fix
Run 'pip install python-nomad' and ensure you import using 'from nomad import Nomad'.
AttributeError: 'Nomad' object has no attribute 'jobs'
Initialization failed due to missing or invalid host/token, causing the client to not properly set up endpoints.
fix
Verify Nomad host is reachable and token is correct. Ensure host starts with http:// or https://.
TypeError: get_jobs() got an unexpected keyword argument 'id'
Passing keyword argument 'id' to an API method after version 2.0.0, where it was renamed to 'id_'.
fix
Replace 'id=...' with 'id_=...' in your call.
Upgrade
Version history
2.1.0latest on PyPI · released Feb 4, 2025
Audit
Dependencies
requestsrequiredHTTP library used for all API calls
Agent activity
7 hits · last 30 days
node
6
Resources
python-nomad — pip install python-nomad · libregistry