omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Google Earth KML: best module? (simplekml installation issues)

    Pythonista
    2
    3
    2963
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Wizardofozzie
      Wizardofozzie last edited by

      I'm trying to edit and create Google Earth KML (keyhole markup language, based on XML); on Windows with iPython I usually use simplekml, however I'm having a tough time trying to install this, as the tar.gz doesn't want to open when using downloadista.pypi("simplekml", "1.2.8").

      Any suggestions for using Pythonista with KML files would be greatly appreciated

      1 Reply Last reply Reply Quote 0
      • omz
        omz last edited by

        The simplekml package is distributed as a Zip file (not tar.gz), maybe pypista can't handle that?

        Anyway, you could try this simple installer script:

        import urllib
        import zipfile
        import os
        import shutil
        
        urllib.urlretrieve('https://pypi.python.org/packages/source/s/simplekml/simplekml-1.2.8.zip', 'simplekml.zip')
        with zipfile.ZipFile('simplekml.zip') as z:
        	z.extractall()
        shutil.copytree('simplekml-1.2.8/simplekml', os.path.expanduser('~/Documents/site-packages/simplekml'))
        shutil.rmtree('simplekml-1.2.8')
        

        The module seems to work, but I haven't tested it extensively.

        1 Reply Last reply Reply Quote 0
        • Wizardofozzie
          Wizardofozzie last edited by

          I forgot to report back; the script does work, but there are a few issues with simplekml (mainly because or recursion limit and it doesn't like the unwieldy default directory length, I'm told, though these are iOS limitations, not Pythonista😉)

          Thanks for the input, much appreciated

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors