A Python library for all things RoutedBits.
Install this library via Git:
pip install https://github.com/routedbits/routedbits-python.git
Install after cloning this repository:
git clone https://github.com/routedbits/routedbits-python.git
cd routedbits-python
pip install .
Use in requirements.txt
routedbits @ git+https://github.com/routedbits/routedbits-python.git
- Retrieve the current list of nodes:
from routedbits import RoutedBits
a = RoutedBits()
a.nodes() # Returns a list of dicts
- Retrieve a router by its friendly name:
from routedbits import RoutedBits
a.RoutedBits()
a.node(name="dal1")
print(a)
"""
namespace(city='Dallas, TX, US', region='US Central', flag='🇺🇸', fqdn='router.dal1.routedbits.com', hostname='router.dal1', latitude='32.818072', longitude='-97.061721', tunnel_ipv4_address='172.20.19.68', tunnel_ipv6_address={'link_local': 'fe80::207', 'ula': 'fdb1:e72a:343d::5'}, type='dual-stack', wireguard_public_key='8clbJPxK5ylOhFDNGdn/CL5zRWQdf7rXbLeF7j8czFI=', name='dal1')
"""
print(a.fqdn)
"""
'router.dal1.routedbits.com'
"""
If you update any dependencies required outside of development, be sure to update the requirements in pyproject.toml
This project is Linted via workflow by black
and flake8
. To install them
and lint before pushing to GitHub:
$ pip install black flake8
$ black .
$ flake8