dnspython  1.16.0
About: dnspython is a DNS toolkit (for Python 2.x) that supports almost all record types.
  Fossies Dox: dnspython-1.16.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

dns.e164 Namespace Reference


def from_e164 (text, origin=public_enum_domain)
def to_e164 (name, origin=public_enum_domain, want_plus_prefix=True)
def query (number, domains, resolver=None)


 public_enum_domain = dns.name.from_text('e164.arpa.')

Function Documentation

◆ from_e164()

def dns.e164.from_e164 (   text,
  origin = public_enum_domain 
Convert an E.164 number in textual form into a Name object whose
value is the ENUM domain name for that number.

Non-digits in the text are ignored, i.e. "16505551212",
"+1.650.555.1212" and "1 (650) 555-1212" are all the same.

*text*, a ``text``, is an E.164 number in textual form.

*origin*, a ``dns.name.Name``, the domain in which the number
should be constructed.  The default is ``e164.arpa.``.

Returns a ``dns.name.Name``.

Definition at line 29 of file e164.py.

References dns.name.from_text().

Referenced by dns.e164.query().

◆ query()

def dns.e164.query (   number,
  resolver = None 
Look for NAPTR RRs for the specified number in the specified domains.

e.g. lookup('16505551212', ['e164.dnspython.org.', 'e164.arpa.'])

*number*, a ``text`` is the number to look for.

*domains* is an iterable containing ``dns.name.Name`` values.

*resolver*, a ``dns.resolver.Resolver``, is the resolver to use.  If
``None``, the default resolver is used.

Definition at line 81 of file e164.py.

References dns.e164.from_e164(), dns.name.from_text(), and dns.resolver.get_default_resolver().

◆ to_e164()

def dns.e164.to_e164 (   name,
  origin = public_enum_domain,
  want_plus_prefix = True 
Convert an ENUM domain name into an E.164 number.

Note that dnspython does not have any information about preferred
number formats within national numbering plans, so all numbers are
emitted as a simple string of digits, prefixed by a '+' (unless
*want_plus_prefix* is ``False``).

*name* is a ``dns.name.Name``, the ENUM domain name.

*origin* is a ``dns.name.Name``, a domain containing the ENUM
domain name.  The name is relativized to this domain before being
converted to text.  If ``None``, no relativization is done.

*want_plus_prefix* is a ``bool``.  If True, add a '+' to the beginning of
the returned number.

Returns a ``text``.

Definition at line 49 of file e164.py.

References dns._compat.maybe_decode().

Variable Documentation

◆ public_enum_domain

dns.e164.public_enum_domain = dns.name.from_text('e164.arpa.')

Definition at line 26 of file e164.py.