I am trying to count the number of Unicode characters in the JSON data. I am using requests to get the data from the feed.
import requests
r = requests.get('https://venmo.com/api/v5/public?since=1438578858&until=1438578958')'
j_data = r.text
Now, I need to convert the j_data into a dictionary to get the message items alone. If I just use json.loads(j_data), I get UnicodeEncodeError: 'charmap' codec can't encode character.
Therefore, I am encoding the j_data and then trying to convert to dict using loads. I am getting this error
TypeError: the JSON object must be str, not 'bytes'
How to approach this problem?
Code:
import requests
import json
r = requests.get('https://venmo.com/api/v5/public?since=1438578858&until=1438578958')
j_data = r.text
encoded = j_data.encode()
b = json.loads(encoded)
print(b)
It seems to work fine in Python 2.7.6
import requests
import json
req = requests.get('https://venmo.com/api/v5/public?since=1438578858&until=1438578958')
contentJ = json.loads(req.content)
and I get a dict named contentJ
As I see it, you try to encode something, that does not need to be encoded. Stripping of the line with the encoding and all works fine in Python3.4.
import requests
import json
r = requests.get('https://venmo.com/api/v5/public?since=1438578858&until=1438578958')
j_data = r.text
b = json.loads(j_data)
print(type(b))
To get json, use r.json():
import requests # $ pip install requests
r = requests.get(url)
data = r.json()
Your error: UnicodeEncodeError: 'charmap' codec can't encode character. is unrelated to the json parsing. Most likely it happens when you are trying to print Unicode to Windows console. Configure the console font that can display the desired characters and install win-unicode-console package:
T:\> py -mpip install win-unicode-console
T:\> py -mrun your_script_that_prints_unicode.py
See What's the deal with Python 3.4, Unicode, different languages and Windows?
Related
I have an encoded string, payload, of a request that I want to uncompress.
payload = 'H4sIAAAAAAAAA+19bXMcN5LmX2Fw76NIIZFAAvA3e+yddax3rPDobmPiYkJBiS2LNzKpoCh7dHP+7/dkVXX1C6pNAtWu6oqwpdFIbBIFoIAnM598+9f5q1cPnz+sbq9+Wp1/cf7Xd3cPX68erm7efzx/dn598/HD+6vPL/E5Pvvyu+/wtZtr/PUHaywbwxfM5OjC4esPd5/udZDbh2+3vwOf6BCr++arzbfjS/d3n27xb/fs/P3N7epPd+/v7vHpvxkT3b//Oz7/afXx49WP+lD8493d+9XH8y/+978OTfU/8A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g0UVjwdL/XwnbXL9ij5dv7m9sfV8/OOD4tvOIo8VmUOwUfj7Kg5eYFFEJcFYpGo03+vCVHOH8bKttKtDH5YPGL3GwRrWUYV0dlZ0ttn0FJWw+6EH1kNdMXAKTlIFenwBPMUG3q6aVNum6NpMYRlzwxtjKmuUpkloJcVXZ1ttR2B3wMSbuRkuM2S/+QPpr6ugy7xW4mCa3IddH90Iphl2CTurBMIC1EuSokLeNVJ3cKFqJcHZQW0r2njKSFKFfnFCzin6emgspArooLKyTFqxyCTh2Cf29g8eF/3Vyv7rL5tV99dn5zjX9AdGpdPcdE1FQEvnl4r9/0n6vVj1e3Z1/dX12/X30++39nSsWe/fd/nb14d7e6vfnn2fcYD1/+4e7T7fWZw9/o40MzNfy1U38x2jtA7u3VzfstWniADf7w41VDFH+4v7vuqOG3q4c3756/e/U//vVupRfg12e/4O+/3Fw/vPv1mRLGD8/XA755e9H8zMfLTx8vVlcfHy7oUke6fH33/uH69uPl7erh+c/0XL2YN2+ei5bhV1zUggHPNUTg9Wt6ffEWmHnhOL25uDLOXWBTrlc+XL9xNj2n69eJ+SpcvBa7unDxtb24krS6eBOu+bUk//at8xjJ/DOZ5z9d6cSbCXXs9Ie7jw+Nh3XJO+CiuzLx+sKu3sYLd8Wri/TG8IW8jVfmTbwWdu45wNX8k6C/D23Cp9fXuAta2VpLZRgv3hjTuJbvHz5++ZB98OZ+he+/zr+Or/54d6/3ARv3YYUDe3Oncnr9wdetb/sv7WH/0873vL2HhH9383G1+9P/pj9w8frzhf7/9rftjqV37eyrz2cv2u/SF/anu+vmkz9/+fL7/6m+8etP91fNw77QitP6w6v75sK13onmzjFDMOtjbu4/PnRjt/dNQf+q/1p3+Vod577/znO93p9X6qk/11vZTUVv9+3Dt/oA07Sivder2bv33V4YQKsX4aL2X1B7dQMbA96UP4DjD+D4Azj+AI4B4Pj7r/8fN2LZVzH7AQA='
My process / goal is explained here. However, I want to stay with Python.
First, I believe I need to decompose the data. With the help of this answer I write:
import base64
payload_in_bytes = base64.b64decode(payload)
Next, I assume that the end-result is a dictionary so I use json.loads() as the documentation states it accepts bytes.
import json
data = json.loads(payload_in_bytes)
However, this results in a UnicodeDecodeError:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position
1: invalid start byte
What am I doing wrong?
Here is a possible solution using gzip()
import base64
import gzip
import json
payload = 'H4sIAAAAAAAAA+19bXMcN5LmX2Fw76NIIZFAAvA3e+yddax3rPDobmPiYkJBiS2LNzKpoCh7dHP+7/dkVXX1C6pNAtWu6oqwpdFIbBIFoIAnM598+9f5q1cPnz+sbq9+Wp1/cf7Xd3cPX68erm7efzx/dn598/HD+6vPL/E5Pvvyu+/wtZtr/PUHaywbwxfM5OjC4esPd5/udZDbh2+3vwOf6BCr++arzbfjS/d3n27xb/fs/P3N7epPd+/v7vHpvxkT3b//Oz7/afXx49WP+lD8493d+9XH8y/+978OTfU/8A3d9/3l00+vVxiL+sn/x9ZXz/XZH67umyd/vrq/bp7hLP718eHq4ROecv7Vtz98/e03+L6Pb+7u9Tm6hB/vV6vb8y8e7j+tMPmr23/oWF5XvVp9//Pq/ueb1S/nX+xN8MXdze3D92+/vX1Y3a8+Pvzp7u7+Wnf1/ertw8u7H25+fLf+2v5P/vXh/u4fq+bDm9urh5X+1D/PvzCXxjmJQZwVMoaSS1iGfj1a8hyYk5CQ9fjy/z3/4oJ+fXb++u7h4e6nl3cv7z6UPiwftHlW8p7Jsg8cU4rGr5/1a7Mbf2536vfeigt36YMzAROxSdjZ0M1OAiXsDot3JvpwlI3IxsSTfP78fhs+3NxOeSgSJhWdBDHBWOe42wlrTSI24qO3+E/8UfZiYNTmafiqw3GxnGwK3gfa3Y+JjgXelfUmiI1COKemvyBOv8iG8f/RG2PlKJsxMGrzNA4uWQ7EERc2+e29UJB6cfPmH+9XX22ei2e8e3j48PGL588//Hh1oVB6gQ25fPP+7pM+8v7z5Zu7n57f/AS8ev7pw/u7q+vnb169vXn//tnrV/c/vv7ibfPfs6tXNpjnDV6+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eJ+SpcvBa7unDxtb24krS6eBOu+bUk//at8xjJ/DOZ5z9d6cSbCXXs9Ie7jw+Nh3XJO+CiuzLx+sKu3sYLd8Wri/TG8IW8jVfmTbwWdu45wNX8k6C/D23Cp9fXuAta2VpLZRgv3hjTuJbvHz5++ZB98OZ+he+/zr+Or/54d6/3ARv3YYUDe3Oncnr9wdetb/sv7WH/0873vL2HhH9383G1+9P/pj9w8frzhf7/9rftjqV37eyrz2cv2u/SF/anu+vmkz9/+fL7/6m+8etP91fNw77QitP6w6v75sK13onmzjFDMOtjbu4/PnRjt/dNQf+q/1p3+Vod577/znO93p9X6qk/11vZTUVv9+3Dt/oA07Sivder2bv33V4YQKsX4aL2X1B7dQMbA96UP4DjD+D4Azj+AI4B4Pj7r/8fN2LZVzH7AQA='
binary_string = base64.b64decode(payload)
decomp_data = gzip.decompress(binary_string).decode()
data = json.loads(decomp_data)
print(data)
I'm working on a new project but I can't fix the error in the title.
Here's the code:
#!/usr/bin/env python3.5.2
import urllib.request , urllib.parse
def start(url):
source_code = urllib.request.urlopen(url).read()
info = urllib.parse.parse_qs(source_code)
print(info)
start('https://www.youtube.com/watch?v=YfRLJQlpMNw')
The error occurred because of .encode which works on a unicode object. So we need to convert the byte string to unicode string using
.decode('unicode_escape')
So the code will be:
#!/usr/bin/env python3.5.2
import urllib.request , urllib.parse
def start(url):
source_code = urllib.request.urlopen(url).read()
info = urllib.parse.parse_qs(source_code.decode('unicode_escape'))
print(info)
start('https://www.youtube.com/watch?v=YfRLJQlpMNw')
Try this
source_code = urllib.request.urlopen(url).read().decode('utf-8')
The error message is self explainatory: there is a byte 0xf0 in an input string that is expected to be an ascii string.
You should have given the exact error message and on what line it happened, but I can guess that is happened on info = urllib.parse.parse_qs(source_code), because parse_qs expects either a unicode string or an ascii byte string.
The first question is why you call parse_qs on data coming from youtube, because the doc for the Python Standart Library says:
Parse a query string given as a string argument (data of type application/x-www-form-urlencoded). Data are returned as a dictionary. The dictionary keys are the unique query variable names and the values are lists of values for each name.
So you are going to parse this on = and & character to interpret it as a query string in the form key1=value11&key2=value2&key1=value12 to give { 'key1': [ 'value11', 'value12'], 'key2': ['value2']}.
If you know why you want that, you should first decode the byte string into a unicode string, using the proper encoding, or if unsure Latin1 which is able to accept any byte:
def start(url):
source_code = urllib.request.urlopen(url).read().decode('latin1')
info = urllib.parse.parse_qs(source_code)
print(info)
This code is rather weird indeed. You are using query parser to parse contents of a web page.
So instead of using parse_qs you should be using something like this.
I was following a tutorial about how to use JSON objects (link: https://www.youtube.com/watch?v=Y5dU2aGHTZg). When they ran the code, they got no errors, but I did. Is it something to do with different Python versions or something?
from urllib.request import urlopen
import json
def printResults(data):
theJSON = json.loads(data)
print (theJSON)
def main():
urlData ="http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson"
webUrl = urlopen(urlData)
print(webUrl.getcode())
if (webUrl.getcode()==200):
data = webUrl.read()
printResults(data)
else:
print ("You failed")
main()
The HTTPResponse object returned from urlopen reads bytes data (raw binary data), not str data (textual data), while the json module works with str. You need to know (or inspect the headers to determine) the encoding used for the data received, and decode it appropriately before using json.loads.
Assuming it's UTF-8 (most websites are), you can just change:
data = webUrl.read()
to:
data = webUrl.read().decode('utf-8')
and it should fix your problem.
I think they were using a different version of the urllib
Try with urllib3 and do the import like this:
from urllib import urlopen
Hope this is the fix to your problem
While porting code from python2 to 3, I get this error when reading from a URL
TypeError: initial_value must be str or None, not bytes.
import urllib
import json
import gzip
from urllib.parse import urlencode
from urllib.request import Request
service_url = 'https://babelfy.io/v1/disambiguate'
text = 'BabelNet is both a multilingual encyclopedic dictionary and a semantic network'
lang = 'EN'
Key = 'KEY'
params = {
'text' : text,
'key' : Key,
'lang' :'EN'
}
url = service_url + '?' + urllib.urlencode(params)
request = Request(url)
request.add_header('Accept-encoding', 'gzip')
response = urllib.request.urlopen(request)
if response.info().get('Content-Encoding') == 'gzip':
buf = StringIO(response.read())
f = gzip.GzipFile(fileobj=buf)
data = json.loads(f.read())
The exception is thrown at this line
buf = StringIO(response.read())
If I use python2, it works fine.
response.read() returns an instance of bytes while StringIO is an in-memory stream for text only. Use BytesIO instead.
From What's new in Python 3.0 - Text Vs. Data Instead Of Unicode Vs. 8-bit
The StringIO and cStringIO modules are gone. Instead, import the io module and use io.StringIO or io.BytesIO for text and data respectively.
This looks like another python3 bytes vs. str problem. Your response is of type bytes (which is different in python 3 from str). You need to get it into a string first using response.read().decode('utf-8') say and then use StringIO on it. Or you may want to use BytesIO as someone said - but if you expect it to be str, preferred way is to decode into an str first.
Consider using six.StringIO instead of io.StringIO.
And if you are migrating code from python2 to python3 and using suds old version use "suds-py3" for python3
I need to fetch data from a URL with non-ascii characters but urllib2.urlopen refuses to open the resource and raises:
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0131' in position 26: ordinal not in range(128)
I know the URL is not standards compliant but I have no chance to change it.
What is the way to access a resource pointed by a URL containing non-ascii characters using Python?
edit: In other words, can / how urlopen open a URL like:
http://example.org/Ñöñ-ÅŞÇİİ/
Strictly speaking URIs can't contain non-ASCII characters; what you have there is an IRI.
To convert an IRI to a plain ASCII URI:
non-ASCII characters in the hostname part of the address have to be encoded using the Punycode-based IDNA algorithm;
non-ASCII characters in the path, and most of the other parts of the address have to be encoded using UTF-8 and %-encoding, as per Ignacio's answer.
So:
import re, urlparse
def urlEncodeNonAscii(b):
return re.sub('[\x80-\xFF]', lambda c: '%%%02x' % ord(c.group(0)), b)
def iriToUri(iri):
parts= urlparse.urlparse(iri)
return urlparse.urlunparse(
part.encode('idna') if parti==1 else urlEncodeNonAscii(part.encode('utf-8'))
for parti, part in enumerate(parts)
)
>>> iriToUri(u'http://www.a\u0131b.com/a\u0131b')
'http://www.xn--ab-hpa.com/a%c4%b1b'
(Technically this still isn't quite good enough in the general case because urlparse doesn't split away any user:pass# prefix or :port suffix on the hostname. Only the hostname part should be IDNA encoded. It's easier to encode using normal urllib.quote and .encode('idna') at the time you're constructing a URL than to have to pull an IRI apart.)
In python3, use the urllib.parse.quote function on the non-ascii string:
>>> from urllib.request import urlopen
>>> from urllib.parse import quote
>>> chinese_wikipedia = 'http://zh.wikipedia.org/wiki/Wikipedia:' + quote('首页')
>>> urlopen(chinese_wikipedia)
Python 3 has libraries to handle this situation. Use
urllib.parse.urlsplit to split the URL into its components, and
urllib.parse.quote to properly quote/escape the unicode characters
and urllib.parse.urlunsplit to join it back together.
>>> import urllib.parse
>>> url = 'http://example.com/unicodè'
>>> url = urllib.parse.urlsplit(url)
>>> url = list(url)
>>> url[2] = urllib.parse.quote(url[2])
>>> url = urllib.parse.urlunsplit(url)
>>> print(url)
http://example.com/unicod%C3%A8
It is more complex than the accepted #bobince's answer suggests:
netloc should be encoded using IDNA;
non-ascii URL path should be encoded to UTF-8 and then percent-escaped;
non-ascii query parameters should be encoded to the encoding of a page URL was extracted from (or to the encoding server uses), then percent-escaped.
This is how all browsers work; it is specified in https://url.spec.whatwg.org/ - see this example. A Python implementation can be found in w3lib (this is the library Scrapy is using); see w3lib.url.safe_url_string:
from w3lib.url import safe_url_string
url = safe_url_string(u'http://example.org/Ñöñ-ÅŞÇİİ/', encoding="<page encoding>")
An easy way to check if a URL escaping implementation is incorrect/incomplete is to check if it provides 'page encoding' argument or not.
Based on #darkfeline answer:
from urllib.parse import urlsplit, urlunsplit, quote
def iri2uri(iri):
"""
Convert an IRI to a URI (Python 3).
"""
uri = ''
if isinstance(iri, str):
(scheme, netloc, path, query, fragment) = urlsplit(iri)
scheme = quote(scheme)
netloc = netloc.encode('idna').decode('utf-8')
path = quote(path)
query = quote(query)
fragment = quote(fragment)
uri = urlunsplit((scheme, netloc, path, query, fragment))
return uri
For those not depending strictly on urllib, one practical alternative is requests, which handles IRIs "out of the box".
For example, with http://bücher.ch:
>>> import requests
>>> r = requests.get(u'http://b\u00DCcher.ch')
>>> r.status_code
200
Encode the unicode to UTF-8, then URL-encode.
Use iri2uri method of httplib2. It makes the same thing as by bobin (is he/she the author of that?)
Another option to convert an IRI to an ASCII URI is to use furl package:
gruns/furl: 🌐 URL parsing and manipulation made easy. - https://github.com/gruns/furl
Python's standard urllib and urlparse modules provide a number of URL
related functions, but using these functions to perform common URL
operations proves tedious. Furl makes parsing and manipulating URLs
easy.
Examples
Non-ASCII domain
http://国立極地研究所.jp/english/ (Japanese National Institute of Polar Research website)
import furl
url = 'http://国立極地研究所.jp/english/'
furl.furl(url).tostr()
'http://xn--vcsoey76a2hh0vtuid5qa.jp/english/'
Non-ASCII path
https://ja.wikipedia.org/wiki/日本語 ("Japanese" article in Wikipedia)
import furl
url = 'https://ja.wikipedia.org/wiki/日本語'
furl.furl(url).tostr()
'https://ja.wikipedia.org/wiki/%E6%97%A5%E6%9C%AC%E8%AA%9E'
works! finally
I could not avoid from this strange characters, but at the end I come through it.
import urllib.request
import os
url = "http://www.fourtourismblog.it/le-nuove-tendenze-del-marketing-tenere-docchio/"
with urllib.request.urlopen(url) as file:
html = file.read()
with open("marketingturismo.html", "w", encoding='utf-8') as file:
file.write(str(html.decode('utf-8')))
os.system("marketingturismo.html")