omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. hmartin

    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.


    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 8
    • Best 3
    • Controversial 0
    • Groups 0

    hmartin

    @hmartin

    6
    Reputation
    585
    Profile views
    8
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    hmartin Unfollow Follow

    Best posts made by hmartin

    • Typed Python interface stubs for editing Pythonista code on the desktop

      I sometimes prefer working on larger Pythonista projects in my desktop IDE. However, imports of Pythonista iOS APIs look broken, autocomplete can't work, and static checking is useless. To solve these problems, I've started working a set of typed Python interface stubs. Please check it out and let me know problems and suggestions!
      https://github.com/hbmartin/pythonista-stubs

      posted in Pythonista
      hmartin
      hmartin
    • RE: Typed Python interface stubs for editing Pythonista code on the desktop

      After some discussion with the author, pygenstub now supports generic module interface generation. (Unlike the more well known stubgen, no C compilation required.)

      This means that in StaSh we can run something like python3 pygenstub.py -p appex -o out --generic to get a stub for appex. It needs cleanup (like replacing all the Anys and removing private things) but it's a great running start.

      posted in Pythonista
      hmartin
      hmartin
    • Script for extracting podcast information from Overcast

      I've been slightly annoyed that there's no way to save podcasts that I like in Overcast. Pythonista to the rescue 😀OvercastParser takes an overcast URL and returns the iTunes id, audio stream url, Overcast ID, and episode title. Check it out here: https://github.com/hbmartin/overcast_parser

      posted in Pythonista
      hmartin
      hmartin

    Latest posts made by hmartin

    • RE: Typed Python interface stubs for editing Pythonista code on the desktop

      @Olaf I'd recommend copying over the pygenstub.py file from the repo instead of installing with pip

      posted in Pythonista
      hmartin
      hmartin
    • RE: Typed Python interface stubs for editing Pythonista code on the desktop

      After some discussion with the author, pygenstub now supports generic module interface generation. (Unlike the more well known stubgen, no C compilation required.)

      This means that in StaSh we can run something like python3 pygenstub.py -p appex -o out --generic to get a stub for appex. It needs cleanup (like replacing all the Anys and removing private things) but it's a great running start.

      posted in Pythonista
      hmartin
      hmartin
    • RE: Typed Python interface stubs for editing Pythonista code on the desktop

      @Olaf Union[] generally indicates an anti-pattern because a method should be relied on to return a single type. That said, given that we don't control the underlying API it may be necessary at some point.

      To answer your specific question, I definitely encourage using Optional[] where the method has documentation stating it might. For example, in the reminders interface there is def get_calendar(calendar_id: str) -> Optional[Calendar]: ... since we're not guaranteed to find a given ID.

      It would be great to get some help and I'm happy to collaborate on typing syntax. I just hesitate to write interfaces for APIs that I haven't personally used, seems like an easy way to get things wrong :)

      (For background reading on Union issues see here: https://github.com/python/mypy/issues/1693 )

      posted in Pythonista
      hmartin
      hmartin
    • RE: Feature request - machine learning

      @JonB said:

      https://github.com/danielsabinasz/TensorSlow

      An alternative might be to create a webview and run TF.js there. Theoretically this will allow the ML to still run on GPU. I have not tested this though...

      posted in Pythonista
      hmartin
      hmartin
    • RE: Can you develop apps for Pythonista iPad on a Mac then port across?

      I'm working on a project to enable exactly this! See https://github.com/hbmartin/pythonista-stubs
      However, I haven't implemented ui or scene yet, but would be happy to collaborate on those.

      posted in Pythonista
      hmartin
      hmartin
    • Script for extracting podcast information from Overcast

      I've been slightly annoyed that there's no way to save podcasts that I like in Overcast. Pythonista to the rescue 😀OvercastParser takes an overcast URL and returns the iTunes id, audio stream url, Overcast ID, and episode title. Check it out here: https://github.com/hbmartin/overcast_parser

      posted in Pythonista
      hmartin
      hmartin
    • RE: how To import modules such as pygame etc

      The i is lowercase...

      import pygame
      
      posted in Pythonista
      hmartin
      hmartin
    • Typed Python interface stubs for editing Pythonista code on the desktop

      I sometimes prefer working on larger Pythonista projects in my desktop IDE. However, imports of Pythonista iOS APIs look broken, autocomplete can't work, and static checking is useless. To solve these problems, I've started working a set of typed Python interface stubs. Please check it out and let me know problems and suggestions!
      https://github.com/hbmartin/pythonista-stubs

      posted in Pythonista
      hmartin
      hmartin