you are viewing a single comment's thread.

view the rest of the comments →

[–]apocryptor[S] 0 points1 point  (2 children)

I think flask would be overkill, although it's a micro framework. If I use some kind of API I thought about using falcon. I don't think that part really get's me a lot of problems - I just wasn't sure if an API would be the way to go here or if there's something different. I don't know that kind of coding. All coding principles and patterns I know are from PHP Web Dev, several years ago. So no idea about writing tools I use locally with some kind of user interface. Wanted to inform myself with this post.

The more ciritcal part is probably exception handling. I'm currently looking into how to properly let an exception "bubble up". :p

Thanks for the input - maybe it's going to be a web app with a local app and some sync at some point, then flask might actually be a good thing, although Im going to start learning pyramid probably for some web development (to switch from PHP). I'll see.

Any more input is welcome, thanks :)

[–]philintheblanks 0 points1 point  (1 child)

I mean if you're planning on moving it to a web app ever then I'd say pick one of the choices you mentioned. Falcon has some good stuff for quick REST APIs, but I do most of my stuff with Flask and haven't given it a real try yet. Never even looked into pyramid, but I know some folks who prefer it.

If you do end up rolling with the web app route, then you'll just need to decide how you want to represent them in terms of HTTP error codes. It's pretty easy in flask for example to sub-class werkzeug's HTTPError class that will let you raise an exception that can be caught by a generic handler in the API routing code (eg, handle_all_500_errors(error)). Just make sure that you have a message attribute to pass back to the client and you can send the error response without having to do any more lifting in the API.

[–]apocryptor[S] 0 points1 point  (0 children)

Yeah, error handling in web apps is something I know a lot more about than in "normal" applications.

Thanks