diff --git a/README.md b/README.md index 05df13a..6d47ff7 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ RadixTarget is: - Used by: - [BBOT](https://github.com/blacklanternsecurity/bbot) - [cloudcheck](https://github.com/blacklanternsecurity/cloudcheck) -Written in pure python and capable of roughly 100,000 lookups per second regardless of database size, it's perfect for production . ### Installation ([PyPi](https://pypi.org/project/radixtarget/)) diff --git a/radixtarget/__init__.py b/radixtarget/__init__.py index fd9870c..89082ea 100644 --- a/radixtarget/__init__.py +++ b/radixtarget/__init__.py @@ -1,4 +1,5 @@ from .radixtarget import RadixTarget +from .helpers import host_size_key # noqa # alias for convenience Target = RadixTarget diff --git a/radixtarget/radixtarget.py b/radixtarget/radixtarget.py index ab764f3..b8cc884 100644 --- a/radixtarget/radixtarget.py +++ b/radixtarget/radixtarget.py @@ -70,13 +70,22 @@ def get(self, host, raise_error=False): return self.dns_tree.search(host, raise_error=raise_error) def search(self, host, raise_error=False): + """ + Alias for get + """ return self.get(host, raise_error=raise_error) def insert(self, t, data=None): - self.add(t, data=data) + """ + Alias for add + """ + return self.add(t, data=data) def put(self, t, data=None): - self.add(t, data=data) + """ + Alias for add + """ + return self.add(t, data=data) def add(self, t, data=None): """ @@ -114,6 +123,7 @@ def _add(self, host, data=None): return self._add_host(host, data=data) def _add_host(self, host, data=None): + host = make_ip(host) self._hash = None self._hosts.add(host) if is_ip(host):