Jump to content

Alfred Python Module: What would you want?


Recommended Posts

So since a few other people are apparently using Python in their workflows, I'm wondering whether a module couldn't be written to automate some repetitive tasks. But the only repetitive and standard task I can think of is generating and printing the feedback XML. I'm thinking a scraper class might be helpful as well, but I can't really think of a way to simplify the already-straightforward BeautifulSoup. Can any of y'all think of something you'd like to see it do?

Link to comment

Not at my Mac right now so can't check, but one of our fellow pythonista a already put together a feedback.py for generating the results list. That could be a good starting point. As for other classes, I'll have to think a little about that.

Link to comment

I'm going to try and post my PHP one tonight on Github. You can look through it if you want but this is what I'll have in mine.

 

1. Functions to return useful data (path to users home folder, path to workflow folder, path to workflow data folder, path to workflow cache folder, return bundle id)

2. Shortcut functions for simplifying requesting remote data

3. Function to read/write plists

4. Functions to read/write data to other files (as a string, array, or json object)

5. Functions to interact with sqlite databases

6. Functions to easily create result items for feedback

7. Functions to create feedback xml from an associative array or json object.

Link to comment
I'm going to try and post my PHP one tonight on Github. You can look through it if you want but this is what I'll have in mine.

 

1. Functions to return useful data (path to users home folder, path to workflow folder, path to workflow data folder, path to workflow cache folder, return bundle id)

2. Shortcut functions for simplifying requesting remote data

3. Function to read/write plists

4. Functions to read/write data to other files (as a string, array, or json object)

5. Functions to interact with sqlite databases

6. Functions to easily create result items for feedback

7. Functions to create feedback xml from an associative array or json object.

 

I think that's great. I'd added #1 and had guessed at #6, but the rest is extremely well-thought-out. Thank you for the tips; I look forward to trying to kludge my way through your PHP!

 

 

I have a feedback class already,  you can find it here.  https://github.com/peteokma/alfred-workflows/tree/master/alfred_utils

 

I plan on adding more features once I get some free time.

 

Hah, serves me right for thinking I could reinvent the wheel. Thanks for sharing! I'm still trying to decide what the best way is to handle an add-feedback function, but I'll upload it to GitHub as soon as I stop waffling.

Link to comment

Well, after tinkering a bit on my own and looking over David's PHP library, here's the module I've put together: https://github.com/phyllisstein/PyAl

 

It comes bundled with requests, requests_cache, and BeautifulSoup, and contains a number of basic utilities for working with Alfred. I'll work on the documentation in a bit, but I thought I'd let the harder-core Pythonistas take a look and start trying to break it before I got too far into that.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...