web-services

parse multipart/form-data, received from requests post

parse multipart/form-data, received from requests post Question: I am writing Web Service Client, using requests library. I am getting data in multipart/form-data that contains a file and text-json. I have no idea how to parse it. Is there a proper library to parse multipart/form-data format in python or should I write parser on my own? …

Total answers: 4

How can I get the named parameters from a URL using Flask?

How can I get the named parameters from a URL using Flask? Question: When the user accesses this URL running on my flask app, I want the web service to be able to handle the parameters specified after the question mark: http://10.1.1.1:5000/login?username=alex&password=pw1 #I just want to be able to manipulate the parameters @app.route(‘/login’, methods=[‘GET’, ‘POST’]) …

Total answers: 8

Split Python Flask app into multiple files

Split Python Flask app into multiple files Question: I’m having trouble understanding how to split a flask app into multiple files. I’m creating a web service and I want to split the api’s into different files (AccountAPI.py, UploadAPI.py, …), just so I don’t have one huge python file. I’ve read that you can do this …

Total answers: 4

Amazon Product Advertising API (ItemSearch with ItemPage)

Amazon Product Advertising API (ItemSearch with ItemPage) Question: I wrote the following code: from hashlib import sha256 from base64 import b64encode import hmac import urllib from time import strftime, gmtime url = ‘http://ecs.amazonaws.com/onca/xml’ AWSAccessKeyId = amazon_settings.amazon_access_key_id AssociateTag = amazon_settings.amazon_associate_tag Keywords = urllib.quote_plus(‘Potter’) Operation = ‘ItemSearch’ SearchIndex = ‘Books’ Service = ‘AWSECommerceService’ Timestamp = urllib.quote_plus(strftime(“%Y-%m-%dT%H:%M:%S.000Z”, gmtime())) …

Total answers: 2

How to check task status in Celery?

How to check task status in Celery? Question: How does one check whether a task is running in celery (specifically, I’m using celery-django)? I’ve read the documentation, and I’ve googled, but I can’t see a call like: my_example_task.state() == RUNNING My use-case is that I have an external (java) service for transcoding. When I send …

Total answers: 13

What Python framework for a REST/JSON web service with no front end?

What Python framework for a REST/JSON web service with no front end? Question: I need to create a Python REST/JSON web service for an iOS app to interact with. There will be no front end on the web. What will be the fastest, most lightweight framework to use for this? Learning curve to implement also …

Total answers: 6

Django REST browser interface

Django REST browser interface Question: I’m writing a set of REST services for a Django project. I’ve been using django-rest-framework for a while. Because of its limited functionality I had to switch to django-piston which I quite enjoy. However, django-rest-framework had one really nice feature – it was able to display an admin-like interface for …

Total answers: 3

Has anyone parsed Wiktionary?

Has anyone parsed Wiktionary? Question: Wiktionary is a wiki dictionary that covers many languages. It even has translations. I would be interested in parsing it and playing with the data, has anyone does anything like this before? Is there any library I can use? (Preferably Python.) Asked By: Amandasaurus || Source Answers: Wiktionary runs on …

Total answers: 11

Recommendations of Python REST (web services) framework?

Recommendations of Python REST (web services) framework? Question: Is there a list somewhere of recommendations of different Python-based REST frameworks for use on the serverside to write your own RESTful APIs? Preferably with pros and cons. Please feel free to add recommendations here. 🙂 Asked By: darius || Source Answers: I am not an expert …

Total answers: 16