docs: def make_mecard_data(name, reading=None, email=None, phone=None, videophone=None,
                       memo=None, nickname=None, birthday=None, url=None,
                       pobox=None, roomno=None, houseno=None, city=None,
                       prefecture=None, zipcode=None, country=None):
      """\
      Creates a string encoding the contact information as MeCard.
  
      :param str name: Name. If it contains a comma, the first part
              is treated as lastname and the second part is treated as forename.
      :param str|None reading: Designates a text string to be set as the
              kana name in the phonebook
      :param str|iterable email: E-mail address. Multiple values are
              allowed.
      :param str|iterable phone: Phone number. Multiple values are
              allowed.
      :param str|iterable videophone: Phone number for video calls.
              Multiple values are allowed.
      :param str memo: A notice for the contact.
      :param str nickname: Nickname.
      :param (str|int|date) birthday: Birthday. If a string is provided,
              it should encode the date as YYYYMMDD value.
      :param str|iterable url: Homepage. Multiple values are allowed.
      :param str|None pobox: P.O. box (address information).
      :param str|None roomno: Room number (address information).
      :param str|None houseno: House number (address information).
      :param str|None city: City (address information).
      :param str|None prefecture: Prefecture (address information).
      :param str|None zipcode: Zip code (address information).
      :param str|None country: Country (address information).
      :rtype: str
      """
      def make_multifield(name, val):
          if val is None:
              return ()
          if isinstance(val, str_type):
              val = (val,)
          return ['{0}:{1};'.format(name, escape(i)) for i in val]
  
      escape = _escape_mecard
      data = ['MECARD:N:{0};'.format(escape(name))]
      if reading:
          data.append('SOUND:{0};'.format(escape(reading)))
      data.extend(make_multifield('TEL', phone))
      data.extend(make_multifield('TELAV', videophone))
      data.extend(make_multifield('EMAIL', email))
      if nickname:
          data.append('NICKNAME:{0};'.format(escape(nickname)))
      if birthday:
          try:
              birthday = birthday.strftime('%Y%m%d')
          except AttributeError:
              pass
          data.append('BDAY:{0};'.format(birthday))
      data.extend(make_multifield('URL', url))
      adr_properties = (pobox, roomno, houseno, city, prefecture, zipcode, country)
      if any(adr_properties):
          adr_data = [escape(i or '') for i in adr_properties]
          data.append('ADR:{0},{1},{2},{3},{4},{5},{6};'.format(*adr_data))
      if memo:
          data.append('MEMO:{0};'.format(escape(memo)))
      data.append(';')
      return ''.join(data)