Skip to content

interdotlink/pynetbox-stubs

Repository files navigation

pynetbox-stubs

Project that contains Python stub files for pynetbox in order to allow type checking code that uses pynetbox with mypy

This module also includes stubs for the following NetBox plugins:

Installation

pip install git+https://github.com/interdotlink/pynetbox-stubs.git#egg=pynetbox-stubs

Example

Enables autocompletion:

Development & Contributing

You'll need a local NetBox running on port 8080, then run the following to get the REST API schema:

make openapi.json
python -m venv venv
. venv/bin/activate 
pip install -r requirements.txt
tox -e gen,fixlint

Before raising a PR make sure that tox tests are passing:

pip install tox
tox -e gen,fixlint
tox -e lint,mypy

TODOs:

Right now, this project is still unfinished:

  • make stubs for pynetbox.models.*
  • make stubs for pynetbox.core.query
  • make stubs for pynetbox.core.app.PluginsApp
  • POST, POST, PATCH parameters
  • Detail routes like /ipam/ip-ranges/{id}/available-ips/
  • Custom fields

About

Python stubs for static type checking

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages