{"id":13710730,"url":"https://github.com/netbox-community/Device-Type-Library-Import","last_synced_at":"2025-05-06T19:32:24.942Z","repository":{"id":41554897,"uuid":"241896606","full_name":"netbox-community/Device-Type-Library-Import","owner":"netbox-community","description":"This library is intended to assist with importing device and module types into NetBox from the NetBox Community DeviceType-Library","archived":false,"fork":false,"pushed_at":"2025-03-11T13:12:04.000Z","size":80,"stargazers_count":303,"open_issues_count":42,"forks_count":104,"subscribers_count":15,"default_branch":"develop","last_synced_at":"2025-04-27T01:33:16.992Z","etag":null,"topics":["netbox","netbox-devicetype-library"],"latest_commit_sha":null,"homepage":"https://github.com/netbox-community/devicetype-library","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/netbox-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2020-02-20T13:52:53.000Z","updated_at":"2025-04-22T09:27:59.000Z","dependencies_parsed_at":"2024-06-21T15:18:12.590Z","dependency_job_id":"a22a4bd0-680d-4ec4-b6a0-1c825e1a67c3","html_url":"https://github.com/netbox-community/Device-Type-Library-Import","commit_stats":null,"previous_names":["minitriga/netbox-device-type-library-import"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbox-community%2FDevice-Type-Library-Import","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbox-community%2FDevice-Type-Library-Import/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbox-community%2FDevice-Type-Library-Import/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbox-community%2FDevice-Type-Library-Import/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netbox-community","download_url":"https://codeload.github.com/netbox-community/Device-Type-Library-Import/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252753697,"owners_count":21798997,"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":["netbox","netbox-devicetype-library"],"created_at":"2024-08-02T23:01:00.290Z","updated_at":"2025-05-06T19:32:19.925Z","avatar_url":"https://github.com/netbox-community.png","language":"Python","funding_links":[],"categories":["Utilities","Python"],"sub_categories":[],"readme":"# Netbox Device Type Import\n\nThis library is intended to be your friend and help you import all the device-types defined within the the [NetBox Device Type Library Repository](https://github.com/netbox-community/devicetype-library).\n\n\u003e Tested working with 2.9.4, 2.10.4\n\n## 🪄 Description\n\nThis script will clone a copy of the `netbox-community/devicetype-library` repository to your machine to allow it to import the device types you would like without copy and pasting them into the Netbox UI.\n\n## 🚀 Getting Started\n\n1. This script is written in Python, so lets setup a virtual environment.\n\n```\ngit clone https://github.com/netbox-community/Device-Type-Library-Import.git\ncd Device-Type-Library-Import\npython3 -m venv venv\nsource venv/bin/activate\n```\n\n2. Now that we have the basics setup, we'll need to install the requirements.\n\n```\npip install -r requirements.txt\n```\n\n3. There are two variables that are required when using this script to import device types into your Netbox installation. (1) Your Netbox instance URL and (2) a token with **write rights**.\n\nCopy the existing `.env.example` to your own `.env` file, and fill in the variables.\n\n```\ncp .env.example .env\nvim .env\n```\n\nFinally, we are able to execute the script and import some device templates!\n\n## 🔌 Usage\n\nTo use the script, simply execute the script as follows. Make sure you're still in the activated virtual environment we created before.\n\n```\n./nb-dt-import.py\n```\n\nThis will clone the latest master branch from the `netbox-community/devicetype-library` from Github and install it into the `repo` subdirectory. If this directory already exists, it will perform a `git pull` to update the repository instead.\n\nNext, it will loop over every manufacturer and every device of every manufacturer and begin checking if your Netbox install already has them, and if not, creates them. It will skip preexisting manufacturers, devices, interfaces, etc. so as to not end up with duplicate entries in your Netbox instance.\n\n### 🧰 Arguments\n\nThis script currently accepts a list of vendors as an argument, so that you can selectively import devices.\n\nTo import only device by APC, for example:\n\n```\n./nb-dt-import.py --vendors apc\n```\n\n`--vendors` can also accept a comma separated list of vendors if you want to import multiple.\n\n```\n./nb-dt-import.py --vendors apc,juniper\n```\n\n## Docker build\n\nIt's possible to use this project as a docker container.\n\nTo build :\n\n```\ndocker build -t netbox-devicetype-import-library .\n```\n\nAlternatively you can pull a pre-built image from Github Container Registry (ghcr.io):\n\n```\ndocker pull ghcr.io/minitriga/netbox-device-type-library-import\n```\n\nThe container supports the following env var as configuration :\n\n- `REPO_URL`, the repo to look for device types (defaults to _https://github.com/netbox-community/devicetype-library.git_)\n- `REPO_BRANCH`, the branch to check out if appropriate, defaults to master.\n- `NETBOX_URL`, used to access netbox\n- `NETBOX_TOKEN`, token for accessing netbox\n- `VENDORS`, a comma-separated list of vendors to import (defaults to None)\n\nTo run :\n\n```\ndocker run -e \"NETBOX_URL=http://netbox:8080/\" -e \"NETBOX_TOKEN=98765434567890\" ghcr.io/minitriga/netbox-device-type-library-import\n```\n\n## 🧑‍💻 Contributing\n\nWe're happy about any pull requests!\n\n## 📜 License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetbox-community%2FDevice-Type-Library-Import","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetbox-community%2FDevice-Type-Library-Import","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetbox-community%2FDevice-Type-Library-Import/lists"}