{"id":13725084,"url":"https://github.com/jrxFive/python-nomad","last_synced_at":"2025-05-07T19:32:47.305Z","repository":{"id":8979437,"uuid":"58209578","full_name":"jrxFive/python-nomad","owner":"jrxFive","description":"Client library Hashicorp Nomad","archived":false,"fork":false,"pushed_at":"2024-04-23T21:03:39.000Z","size":351,"stargazers_count":133,"open_issues_count":20,"forks_count":71,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-05-01T23:53:53.078Z","etag":null,"topics":["api","client","hashicorp","nomad","python"],"latest_commit_sha":null,"homepage":"https://python-nomad.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jrxFive.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-06T13:34:56.000Z","updated_at":"2024-06-18T16:45:58.231Z","dependencies_parsed_at":"2024-01-08T01:44:56.929Z","dependency_job_id":"9cd463ea-af0b-45e2-9181-3212c7ccb11c","html_url":"https://github.com/jrxFive/python-nomad","commit_stats":{"total_commits":156,"total_committers":40,"mean_commits":3.9,"dds":0.7564102564102564,"last_synced_commit":"364f063a061d95a4ae4500580930bb0bb42ba134"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrxFive%2Fpython-nomad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrxFive%2Fpython-nomad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrxFive%2Fpython-nomad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrxFive%2Fpython-nomad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jrxFive","download_url":"https://codeload.github.com/jrxFive/python-nomad/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224645208,"owners_count":17346096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","client","hashicorp","nomad","python"],"created_at":"2024-08-03T01:02:12.523Z","updated_at":"2025-05-07T19:32:47.297Z","avatar_url":"https://github.com/jrxFive.png","language":"Python","funding_links":[],"categories":["Python","SDK"],"sub_categories":["User Interfaces and Dashboards"],"readme":"# python-nomad\n\n\n[![Python Nomad Test and Publish](https://github.com/jrxFive/python-nomad/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/jrxFive/python-nomad/actions/workflows/main.yml)\n[![codecov](https://codecov.io/gh/jrxFive/python-nomad/branch/master/graph/badge.svg)](https://codecov.io/gh/jrxFive/python-nomad)\n[![PyPI version](https://badge.fury.io/py/python-nomad.svg)](https://badge.fury.io/py/python-nomad)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/python-nomad.svg)](https://pypi.python.org/pypi/python-nomad/)\n[![Downloads](https://pepy.tech/badge/python-nomad/month)](https://pepy.tech/project/python-nomad)\n[![Downloads](https://static.pepy.tech/personalized-badge/python-nomad?period=total\u0026units=international_system\u0026left_color=black\u0026right_color=blue\u0026left_text=Downloads)](https://pepy.tech/project/python-nomad)\n[![PyPI license](https://img.shields.io/pypi/l/python-nomad.svg)](https://pypi.python.org/pypi/python-nomad/)\n\n\n## Installation\n```\npip install python-nomad\n```\n\n## Documentation\nhttps://python-nomad.readthedocs.io/en/latest/\n\n## Examples\n```python\n\n\nimport nomad\n# For HTTP Nomad instances\nn = nomad.Nomad(host=\"172.16.100.10\", timeout=5)\n\n# For HTTPS Nomad instances with non-self-signed SSL certificates\nn = nomad.Nomad(host=\"172.16.100.10\", secure=True, timeout=5, verify=True)\n\n# For HTTPS Nomad instances with self-signed SSL certificates and no validate the cert\nn = nomad.Nomad(host=\"172.16.100.10\", secure=True, timeout=5, verify=False)\n\n# For HTTPS Nomad instances with self-signed SSL certificates that must validate with cert\nn = nomad.Nomad(host=\"172.16.100.10\", secure=True, timeout=5, verify=True, cert=\"/path/to/certfile\") # See http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification\n\n# For HTTPS Nomad instances with cert file and key\nn = nomad.Nomad(host=\"https://172.16.100.10\", secure=True, timeout=5, verify=True, cert=(\"/path/to/certfile\", \"/path/to/key\")) # See http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification\n\n# For HTTPS Nomad instance with cert file and key and CA file\nn = nomad.Nomad(host=\"https://172.16.100.10\", secure=True, timeout=5, verify=\"/path/to/cacert\", cert=(\"/path/to/certfile\", \"/path/to/key\"))\n\n# For HTTPS Nomad instances with namespace and acl token\nn = nomad.Nomad(host=\"172.16.100.10\", secure=True, timeout=5, verify=False, namespace='Namespace-example',token='3f4a0fcd-7c42-773c-25db-2d31ba0c05fe')\n\n\"example\" in n.jobs\n\nj = n.jobs[\"example\"][\"ID\"]\n\nexample_allocation = n.job.get_allocations(j)\n\nn.job.deregister_job(j)\n```\n\n## Environment Variables\n\nThis library also supports environment variables: `NOMAD_ADDR`, `NOMAD_NAMESPACE`, `NOMAD_TOKEN`, `NOMAD_REGION`, `NOMAD_CLIENT_CERT`, and `NOMAD_CLIENT_KEY`\nfor ease of configuration and unifying with nomad cli tools and other libraries.\n\n```bash\nNOMAD_ADDR=http://127.0.0.1:4646\nNOMAD_NAMESPACE=default\nNOMAD_TOKEN=xxxx-xxxx-xxxx-xxxx\nNOMAD_REGION=us-east-1a\nNOMAD_CLIENT_CERT=/path/to/tls/client.crt\nNOMAD_CLIENT_KEY=/path/to/tls/client.key\n```\n\n## Class Dunders\n\n| Class | contains | len | getitem | iter |\n|---|---|---|---|---|\n|agent|N|N|N|N\n|allocation|Y|N|Y|N\n|allocations|N|Y|N|Y\n|client|N|N|N|N\n|evaluation|Y|N|Y|N\n|evaluations|Y|Y|Y|Y\n|event|N|N|N|N\n|job|Y|N|Y|N\n|jobs|Y|Y|Y|Y\n|node|Y|N|Y|N\n|nodes|Y|Y|Y|Y\n|regions|Y|Y|Y|Y\n|status.leader|Y|Y|N|N\n|status.peers|Y|Y|Y|Y\n|system|N|N|N|N\n|validate|N|N|N|N\n|deployments|Y|Y|Y|Y\n|deployment|Y|N|Y|N\n|namespace|Y|N|Y|N\n|namespaces|Y|Y|Y|Y\n|acl|Y|N|Y|N\n|sentinel|Y|N|Y|N\n\n## Development\n* create virtualenv and activate\n* install requirements-dev.txt\n* can either use the Vagrantfile for local integration testing or create environment variables `NOMAD_IP` and `NOMAD_PORT` that are assigned to a nomad binary that is running\n\n```\nvirtualenv .venv\nsource .venv/bin/activate\npip install -r requirements-dev.txt\n```\n\n## Testing with vagrant and virtualbox\n```\nvagrant up --provider virtualbox\npy.test --cov=nomad --cov-report=term-missing --runxfail tests/\n```\n\n## Testing with nomad binary\n```\n./nomad agent -dev -node pynomad1 --acl-enabled\nNOMAD_IP=127.0.0.1 NOMAD_VERSION=\u003cSEMNATIC_VERSION\u003e py.test --cov=nomad --cov-report=term-missing --runxfail tests/\n```\n\n- Examples\n    - [x] Acl [:link:](docs/api/acl.md)\n    - [x] Agent [:link:](docs/api/agent.md)\n    - [x] Allocation [:link:](docs/api/allocation.md)\n    - [x] Allocations [:link:](docs/api/allocations.md)\n    - [x] Deployment [:link:](docs/api/deployment.md)\n    - [x] Deployments [:link:](docs/api/deployments.md)\n    - [x] Client [:link:](docs/api/client.md)\n    - [x] Evaluation [:link:](docs/api/evaluation.md)\n    - [x] Evaluations [:link:](docs/api/evaluations.md)\n    - [x] Event [:link:](docs/api/event.md)\n    - [x] Job [:link:](docs/api/job.md)\n    - [x] Jobs [:link:](docs/api/jobs.md)\n    - [x] Namespace [:link:](docs/api/namespace.md)\n    - [x] Namespaces [:link:](docs/api/namespaces.md)\n    - [x] Node [:link:](docs/api/node.md)\n    - [x] Nodes [:link:](docs/api/nodes.md)\n    - [x] Regions [:link:](docs/api/regions.md)\n    - [x] Sentinel [:link:](docs/api/sentinel.md)\n    - [x] Search [:link:](docs/api/search.md)\n    - [x] Status [:link:](docs/api/status.md)\n    - [x] System [:link:](docs/api/system.md)\n    - [x] Validate [:link:](docs/api/validate.md)\n    - [x] Variable [:link:](docs/api/variable.md)\n    - [x] Variables [:link:](docs/api/variables.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FjrxFive%2Fpython-nomad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FjrxFive%2Fpython-nomad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FjrxFive%2Fpython-nomad/lists"}