We will... | Using module |
---|---|
Download a .ZIP file | urllib |
Extract the .CSV files | zipfile |
Load a .CSV file | csv |
By country, continent or subcontinent. Area harvested, production, yield. Years 1961 to 2021
Source: Food and Agriculture Organization of the United Nations Organization
Link: https://fenixservices.fao.org/faostat/static/bulkdownloads/Production_Crops_Livestock_E_All_Data.zip 22MB
Reference: https://www.fao.org -> Statistics -> Data Dissemination -> Agrifood systems -> Main database FAOSTAT -> Explore Data -> Production -> Crops and livestock products -> Bulk Downloads -> All Data
from urllib.request import urlopen
response = urlopen('https://rebex.net')
charset = response.headers.get_content_charset()
print('charset:', charset)
html = response.read().decode(charset)
print(html[:40])
print(response.status, response.reason)
charset: utf-8 <!DOCTYPE html> <html lang="en"> 200 OK
data = response.read()
out = open('data.zip', 'wb')
out.write(data)
0
Create a percent-encoded string, encode it to bytes
import urllib.parse
string = urllib.parse.urlencode({'model number': 1, 'qty': 2})
print(string)
data = string.encode('ascii')
data
model+number=1&qty=2
b'model+number=1&qty=2'
And use the data parameter
response = urlopen(url, data=data)
from urllib.request import urlopen
url = (
"https://fenixservices.fao.org/faostat/static/bulkdownloads/"
"Production_Crops_Livestock_E_All_Data.zip"
)
response = urllopen(url)
response = urlopen(url)
--------------------------------------------------------------------------- HTTPError Traceback (most recent call last) Cell In[3], line 1 ----> 1 response = urlopen(url) File /usr/lib/python3.11/urllib/request.py:216, in urlopen(url, data, timeout, cafile, capath, cadefault, context) 214 else: 215 opener = _opener --> 216 return opener.open(url, data, timeout) File /usr/lib/python3.11/urllib/request.py:525, in OpenerDirector.open(self, fullurl, data, timeout) 523 for processor in self.process_response.get(protocol, []): 524 meth = getattr(processor, meth_name) --> 525 response = meth(req, response) 527 return response File /usr/lib/python3.11/urllib/request.py:634, in HTTPErrorProcessor.http_response(self, request, response) 631 # According to RFC 2616, "2xx" code indicates that the client's 632 # request was successfully received, understood, and accepted. 633 if not (200 <= code < 300): --> 634 response = self.parent.error( 635 'http', request, response, code, msg, hdrs) 637 return response File /usr/lib/python3.11/urllib/request.py:563, in OpenerDirector.error(self, proto, *args) 561 if http_err: 562 args = (dict, 'default', 'http_error_default') + orig_args --> 563 return self._call_chain(*args) File /usr/lib/python3.11/urllib/request.py:496, in OpenerDirector._call_chain(self, chain, kind, meth_name, *args) 494 for handler in handlers: 495 func = getattr(handler, meth_name) --> 496 result = func(*args) 497 if result is not None: 498 return result File /usr/lib/python3.11/urllib/request.py:643, in HTTPDefaultErrorHandler.http_error_default(self, req, fp, code, msg, hdrs) 642 def http_error_default(self, req, fp, code, msg, hdrs): --> 643 raise HTTPError(req.full_url, code, msg, hdrs, fp) HTTPError: HTTP Error 403: Forbidden
from urllib.request import urlopen
from urllib.error import HTTPError
try:
response = urlopen(url)
except HTTPError as e:
print(e)
HTTP Error 403: Forbidden
import sys
try:
response = urlopen(url)
except HTTPError as e:
print(e)
print('Exiting')
sys.exit(1)
%%bash
URL=https://fenixservices.fao.org/faostat/static/bulkdownloads/\
Production_Crops_Livestock_E_All_Data.zip
wget --quiet $URL
echo Exit code: $?
ls *.zip
Exit code: 0 Production_Crops_Livestock_E_All_Data.zip
import requests
response = requests.get(url)
response.status_code, response.reason
(200, 'OK')
Wget normally identifies as Wget/version, version being the current version number of Wget.
— man wget
urllib’s default user agent string is "Python-urllib/2.6" (on Python 2.6).
— urllib.request reference documentation
def default_user_agent(name="python-requests"):
"""
Return a string representing the default user agent.
:rtype: str
"""
return f"{name}/{__version__}"
— Source code of requests/utils.py
:
%%script bash
URL=https://fenixservices.fao.org/faostat/static/bulkdownloads/\
Production_Crops_Livestock_E_All_Data.zip
wget --quiet -U 'Python-urllib' -S $URL
echo Exit code: $?
HTTP/1.1 403 Forbidden Date: Sun, 16 Jul 2023 14:42:32 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 5416 Connection: keep-alive X-Frame-Options: SAMEORIGIN Referrer-Policy: same-origin Cache-Control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Expires: Thu, 01 Jan 1970 00:00:01 GMT Vary: Accept-Encoding Server: cloudflare CF-RAY: 7e7b0328ca46b6df-QRO
Exit code: 8
response = requests.get(url, headers={'User-Agent': 'Python-urllib'})
response.status_code, response.reason
(403, 'Forbidden')
User-Agent | FAO web site |
---|---|
Python-urllib | Rejects |
python-requests | Accepts |
python-urllib | Accepts |
response = requests.get(url, headers={'User-Agent': 'python-urllib'})
response.status_code, response.reason
(200, 'OK')
from urllib.request import urlopen, Request
from urllib.error import HTTPError
request = Request(url)
request.add_header('User-Agent', 'python-urllib')
try:
response = urlopen(request)
except HTTPError as e:
print(e)
response.code, response.reason
(200, 'OK')
from zipfile import ZipFile
zip = ZipFile('Production_Crops_Livestock_E_All_Data.zip')
zip.namelist()
['Production_Crops_Livestock_E_All_Data.csv', 'Production_Crops_Livestock_E_All_Data_NOFLAG.csv', 'Production_Crops_Livestock_E_AreaCodes.csv', 'Production_Crops_Livestock_E_Flags.csv', 'Production_Crops_Livestock_E_ItemCodes.csv']
zip.printdir()
File Name Modified Size Production_Crops_Livestock_E_All_Data.csv 2023-03-22 16:47:44 80477191 Production_Crops_Livestock_E_All_Data_NOFLAG.csv 2023-03-22 16:47:54 64356143 Production_Crops_Livestock_E_AreaCodes.csv 2023-03-22 16:48:38 5349 Production_Crops_Livestock_E_Flags.csv 2023-03-22 16:48:30 147 Production_Crops_Livestock_E_ItemCodes.csv 2023-03-22 16:48:46 10709
zip.extractall(path="csv")
zip.extract('Production_Crops_Livestock_E_Flags.csv', path="csv")
'csv/Production_Crops_Livestock_E_Flags.csv'
Drive/UNC and leading (back)slashes are stripped, all ".." components are removed from filenames.
with ZipFile('New.zip', mode='w') as myzip:
myzip.write('filename.txt')
myzip.printdir()
File Name Modified Size filename.txt 2023-01-27 12:27:29 314
%%bash
python3 -m zipfile --help
usage: zipfile.py [-h] (-l <zipfile> | -e <zipfile> <output_dir> | -c <name> [<file> ...] | -t <zipfile>) [--metadata-encoding <encoding>] A simple command-line interface for zipfile module. options: -h, --help show this help message and exit -l <zipfile>, --list <zipfile> Show listing of a zipfile -e <zipfile> <output_dir>, --extract <zipfile> <output_dir> Extract zipfile into target dir -c <name> [<file> ...], --create <name> [<file> ...] Create zipfile from sources -t <zipfile>, --test <zipfile> Test if a zipfile is valid --metadata-encoding <encoding> Specify encoding of member names for -l, -e and -t
name,lastname,age
"John, II",Smith,30
Charles,Jones,40
import csv
csv_file = open('file.csv', newline='')
reader = csv.reader(csv_file)
for row in reader:
print(row)
['name', 'lastname', 'age'] ['John, II', 'Smith', '30'] ['Charles', 'Jones', '40']
name,lastname,age
"John, II",Smith,30
Charles,Jones,40
import csv
csv_file = open('file.csv', newline='')
reader = csv.DictReader(csv_file)
for row in reader:
print(row)
{'name': 'John, II', 'lastname': 'Smith', 'age': '30'} {'name': 'Charles', 'lastname': 'Jones', 'age': '40'}
print(reader.fieldnames)
['name', 'lastname', 'age']
import csv
csv_file = open('output.csv', 'w', newline='')
writer = csv.writer(csv_file, delimiter='|')
writer.writerow(['John, II', 'Smith'])
csv_file.close()
%%bash
cat output.csv
John, II|Smith
import csv
csv_file = open('output2.csv', 'w', newline='')
writer = csv.DictWriter(csv_file, fieldnames=['Name', 'Last Name'])
writer.writeheader()
writer.writerow({'Name': 'John, II', 'Last Name': 'Smith'})
csv_file.close()
%%script bash
cat output2.csv
Name,Last Name "John, II",Smith
csv_file_name = 'csv/Production_Crops_Livestock_E_All_Data.csv'
with open(csv_file_name, newline="") as csv_file:
reader = csv.DictReader(csv_file)
for row in reader:
pass
csv_file_name = 'csv/Production_Crops_Livestock_E_All_Data.csv'
with open(csv_file_name, newline="") as csv_file:
reader = csv.DictReader(csv_file)
for row in reader:
pass
--------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) Cell In[26], line 4 2 with open(csv_file_name, newline="") as csv_file: 3 reader = csv.DictReader(csv_file) ----> 4 for row in reader: 5 pass File /usr/lib/python3.11/csv.py:111, in DictReader.__next__(self) 108 if self.line_num == 0: 109 # Used only for its side effect. 110 self.fieldnames --> 111 row = next(self.reader) 112 self.line_num = self.reader.line_num 114 # unlike the basic reader, we prefer not to return blanks, 115 # because we will typically wind up with a dict full of None 116 # values File <frozen codecs>:322, in decode(self, input, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 3266: invalid continuation byte
csvfile = open(csv_file_name, newline="")
data = csvfile.read()
--------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) Cell In[3], line 2 1 csvfile = open(csv_file_name, newline="") ----> 2 data = csvfile.read() File <frozen codecs>:322, in decode(self, input, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 1617090: invalid continuation byte
b'\xe9\x80\x80'.decode()
'退'
b'\xe9\x00\x00'.decode()
--------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) Cell In[26], line 1 ----> 1 b'\xe9\x00\x00'.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 0: invalid continuation byte
b'\xe9'.decode()
--------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) Cell In[27], line 1 ----> 1 b'\xe9'.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 0: unexpected end of data
Optional errors argument:
Value | Description |
---|---|
'strict' | The default, raise UnicodeError |
'ignore' | Data may be lost |
'replace' | '?' |
'surrogateescape' | U+DC80 to U+DCFF |
'xmlcharrefreplace' | &#nnn; Only for writing |
'namereplace' | \N{...} Only for writing |
'backslashreplace' | '\xhh' |
csvfile = open(csv_file_name, newline="", errors='backslashreplace')
data = csvfile.read()
Note:
import re
re.findall(r'\\x..', data)
['\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xf4', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xe9', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', '\\xfc', ...]
import re
re.findall(r'\w*\\x\w*', data)
['Mat\\xe9', 'Mat\\xe9', 'Mat\\xe9', 'Mat\\xe9', 'Mat\\xe9', 'Mat\\xe9', 'Mat\\xe9', 'Mat\\xe9', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'C\\xf4te', 'Mat\\xe9', 'Mat\\xe9', 'Mat\\xe9', 'Mat\\xe9', 'Mat\\xe9', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'R\\xe9union', 'Mat\\xe9', 'Mat\\xe9', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', 'T\\xfcrkiye', ...]
import re
set(re.findall(r'\w*\\x\w*', data))
{'C\\xf4te', 'Mat\\xe9', 'R\\xe9union', 'T\\xfcrkiye'}
%%bash
man latin1
ISO_8859-1(7) Miscellaneous Information Manual ISO_8859-1(7) NAME iso_8859-1 - ISO 8859-1 character set encoded in octal, decimal, and hexadecimal DESCRIPTION The ISO 8859 standard includes several 8-bit extensions to the ASCII character set (also known as ISO 646-IRV). ISO 8859-1 encodes the characters used in many West European languages. ISO 8859 alphabets The full set of ISO 8859 alphabets includes: ISO 8859-1 West European languages (Latin-1) ISO 8859-2 Central and East European languages (Latin-2) ISO 8859-3 Southeast European and miscellaneous languages (Latin-3) ISO 8859-4 Scandinavian/Baltic languages (Latin-4) ISO 8859-5 Latin/Cyrillic ISO 8859-6 Latin/Arabic ISO 8859-7 Latin/Greek ISO 8859-8 Latin/Hebrew ISO 8859-9 Latin-1 modification for Turkish (Latin-5) ISO 8859-10 Lappish/Nordic/Eskimo languages (Latin-6) ISO 8859-11 Latin/Thai ISO 8859-13 Baltic Rim languages (Latin-7) ISO 8859-14 Celtic (Latin-8) ISO 8859-15 West European languages (Latin-9) ISO 8859-16 Romanian (Latin-10) ISO 8859-1 characters The following table displays the characters in ISO 8859-1 that are printable and unlisted in the ascii(7) manual page. Oct Dec Hex Char Description ──────────────────────────────────────────────────────────────────── 240 160 A0 NO-BREAK SPACE 241 161 A1 ¡ INVERTED EXCLAMATION MARK 242 162 A2 ¢ CENT SIGN 243 163 A3 £ POUND SIGN 244 164 A4 ¤ CURRENCY SIGN 245 165 A5 ¥ YEN SIGN 246 166 A6 ¦ BROKEN BAR 247 167 A7 § SECTION SIGN 250 168 A8 ¨ DIAERESIS 251 169 A9 © COPYRIGHT SIGN 252 170 AA ª FEMININE ORDINAL INDICATOR 253 171 AB « LEFT-POINTING DOUBLE ANGLE QUOTATION MARK 254 172 AC ¬ NOT SIGN 255 173 AD SOFT HYPHEN 256 174 AE ® REGISTERED SIGN 257 175 AF ¯ MACRON 260 176 B0 ° DEGREE SIGN 261 177 B1 ± PLUS-MINUS SIGN 262 178 B2 ² SUPERSCRIPT TWO 263 179 B3 ³ SUPERSCRIPT THREE 264 180 B4 ´ ACUTE ACCENT 265 181 B5 µ MICRO SIGN 266 182 B6 ¶ PILCROW SIGN 267 183 B7 · MIDDLE DOT 270 184 B8 ¸ CEDILLA 271 185 B9 ¹ SUPERSCRIPT ONE 272 186 BA º MASCULINE ORDINAL INDICATOR 273 187 BB » RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK 274 188 BC ¼ VULGAR FRACTION ONE QUARTER 275 189 BD ½ VULGAR FRACTION ONE HALF 276 190 BE ¾ VULGAR FRACTION THREE QUARTERS 277 191 BF ¿ INVERTED QUESTION MARK 300 192 C0 À LATIN CAPITAL LETTER A WITH GRAVE 301 193 C1 Á LATIN CAPITAL LETTER A WITH ACUTE 302 194 C2 Â LATIN CAPITAL LETTER A WITH CIRCUMFLEX 303 195 C3 Ã LATIN CAPITAL LETTER A WITH TILDE 304 196 C4 Ä LATIN CAPITAL LETTER A WITH DIAERESIS 305 197 C5 Å LATIN CAPITAL LETTER A WITH RING ABOVE 306 198 C6 Æ LATIN CAPITAL LETTER AE 307 199 C7 Ç LATIN CAPITAL LETTER C WITH CEDILLA 310 200 C8 È LATIN CAPITAL LETTER E WITH GRAVE 311 201 C9 É LATIN CAPITAL LETTER E WITH ACUTE 312 202 CA Ê LATIN CAPITAL LETTER E WITH CIRCUMFLEX 313 203 CB Ë LATIN CAPITAL LETTER E WITH DIAERESIS 314 204 CC Ì LATIN CAPITAL LETTER I WITH GRAVE 315 205 CD Í LATIN CAPITAL LETTER I WITH ACUTE 316 206 CE Î LATIN CAPITAL LETTER I WITH CIRCUMFLEX 317 207 CF Ï LATIN CAPITAL LETTER I WITH DIAERESIS 320 208 D0 Ð LATIN CAPITAL LETTER ETH 321 209 D1 Ñ LATIN CAPITAL LETTER N WITH TILDE 322 210 D2 Ò LATIN CAPITAL LETTER O WITH GRAVE 323 211 D3 Ó LATIN CAPITAL LETTER O WITH ACUTE 324 212 D4 Ô LATIN CAPITAL LETTER O WITH CIRCUMFLEX 325 213 D5 Õ LATIN CAPITAL LETTER O WITH TILDE 326 214 D6 Ö LATIN CAPITAL LETTER O WITH DIAERESIS 327 215 D7 × MULTIPLICATION SIGN 330 216 D8 Ø LATIN CAPITAL LETTER O WITH STROKE 331 217 D9 Ù LATIN CAPITAL LETTER U WITH GRAVE 332 218 DA Ú LATIN CAPITAL LETTER U WITH ACUTE 333 219 DB Û LATIN CAPITAL LETTER U WITH CIRCUMFLEX 334 220 DC Ü LATIN CAPITAL LETTER U WITH DIAERESIS 335 221 DD Ý LATIN CAPITAL LETTER Y WITH ACUTE 336 222 DE Þ LATIN CAPITAL LETTER THORN 337 223 DF ß LATIN SMALL LETTER SHARP S 340 224 E0 à LATIN SMALL LETTER A WITH GRAVE 341 225 E1 á LATIN SMALL LETTER A WITH ACUTE 342 226 E2 â LATIN SMALL LETTER A WITH CIRCUMFLEX 343 227 E3 ã LATIN SMALL LETTER A WITH TILDE 344 228 E4 ä LATIN SMALL LETTER A WITH DIAERESIS 345 229 E5 å LATIN SMALL LETTER A WITH RING ABOVE 346 230 E6 æ LATIN SMALL LETTER AE 347 231 E7 ç LATIN SMALL LETTER C WITH CEDILLA 350 232 E8 è LATIN SMALL LETTER E WITH GRAVE 351 233 E9 é LATIN SMALL LETTER E WITH ACUTE 352 234 EA ê LATIN SMALL LETTER E WITH CIRCUMFLEX 353 235 EB ë LATIN SMALL LETTER E WITH DIAERESIS 354 236 EC ì LATIN SMALL LETTER I WITH GRAVE 355 237 ED í LATIN SMALL LETTER I WITH ACUTE 356 238 EE î LATIN SMALL LETTER I WITH CIRCUMFLEX 357 239 EF ï LATIN SMALL LETTER I WITH DIAERESIS 360 240 F0 ð LATIN SMALL LETTER ETH 361 241 F1 ñ LATIN SMALL LETTER N WITH TILDE 362 242 F2 ò LATIN SMALL LETTER O WITH GRAVE 363 243 F3 ó LATIN SMALL LETTER O WITH ACUTE 364 244 F4 ô LATIN SMALL LETTER O WITH CIRCUMFLEX 365 245 F5 õ LATIN SMALL LETTER O WITH TILDE 366 246 F6 ö LATIN SMALL LETTER O WITH DIAERESIS 367 247 F7 ÷ DIVISION SIGN 370 248 F8 ø LATIN SMALL LETTER O WITH STROKE 371 249 F9 ù LATIN SMALL LETTER U WITH GRAVE 372 250 FA ú LATIN SMALL LETTER U WITH ACUTE 373 251 FB û LATIN SMALL LETTER U WITH CIRCUMFLEX 374 252 FC ü LATIN SMALL LETTER U WITH DIAERESIS 375 253 FD ý LATIN SMALL LETTER Y WITH ACUTE 376 254 FE þ LATIN SMALL LETTER THORN 377 255 FF ÿ LATIN SMALL LETTER Y WITH DIAERESIS NOTES ISO 8859-1 is also known as Latin-1. SEE ALSO ascii(7), charsets(7), cp1252(7), iso_8859-15(7), utf-8(7) Linux man-pages 6.03 2022-12-15 ISO_8859-1(7)
The UCS characters 0x0000 to 0x007f are identical to those of the classic US-ASCII character set and the characters in the range 0x0000 to 0x00ff are identical to those in ISO 8859-1 (Latin-1).
— man unicode
print('é is code point', hex(ord('é')), 'in Unicode')
print('é is encoded in ISO-8851-1 as', 'é'.encode('latin1'))
é is code point 0xe9 in Unicode é is encoded in ISO-8851-1 as b'\xe9'
csvfile = open(csv_file_name, newline="", encoding='latin1')
data = csvfile.read()
csv_file_name = 'csv/Production_Crops_Livestock_E_All_Data.csv'
with open(csv_file_name, newline="", encoding='latin1') as csv_file:
reader = csv.DictReader(csv_file)
for row in reader:
pass
csv_file_name = 'csv/Production_Crops_Livestock_E_All_Data.csv'
with open(csv_file_name, newline="", encoding="latin1") as csv_file:
reader = csv.DictReader(csv_file)
print(len(reader.fieldnames), 'fields')
print(f'{len(list(reader)):,} rows')
131 fields 79,297 rows
csv_file_name = 'csv/Production_Crops_Livestock_E_All_Data.csv'
with open(csv_file_name, newline="", encoding="latin1") as csv_file:
reader = csv.DictReader(csv_file)
fieldnames = reader.fieldnames
alist = list(reader)
from itertools import groupby
areas = [(e['Area'], e['Area Code']) for e in alist]
for (area, area_code), group in groupby(areas):
print(f'{area_code:>4} {area}')
2 Afghanistan 3 Albania 4 Algeria 7 Angola 8 Antigua and Barbuda 9 Argentina 1 Armenia 10 Australia 11 Austria 52 Azerbaijan 12 Bahamas 13 Bahrain 16 Bangladesh 14 Barbados 57 Belarus 255 Belgium 15 Belgium-Luxembourg 23 Belize 53 Benin 18 Bhutan 19 Bolivia (Plurinational State of) 80 Bosnia and Herzegovina 20 Botswana 21 Brazil 26 Brunei Darussalam 27 Bulgaria 233 Burkina Faso 29 Burundi 35 Cabo Verde 115 Cambodia 32 Cameroon 33 Canada 37 Central African Republic 39 Chad 40 Chile 351 China 96 China, Hong Kong SAR 128 China, Macao SAR 41 China, mainland 214 China, Taiwan Province of 44 Colombia 45 Comoros 46 Congo 47 Cook Islands 48 Costa Rica 107 Côte d'Ivoire 98 Croatia 49 Cuba 50 Cyprus 167 Czechia 51 Czechoslovakia 116 Democratic People's Republic of Korea 250 Democratic Republic of the Congo 54 Denmark 72 Djibouti 55 Dominica 56 Dominican Republic 58 Ecuador 59 Egypt 60 El Salvador 61 Equatorial Guinea 178 Eritrea 63 Estonia 209 Eswatini 238 Ethiopia 62 Ethiopia PDR 64 Faroe Islands 66 Fiji 67 Finland 68 France 69 French Guiana 70 French Polynesia 74 Gabon 75 Gambia 73 Georgia 79 Germany 81 Ghana 84 Greece 86 Grenada 87 Guadeloupe 89 Guatemala 90 Guinea 175 Guinea-Bissau 91 Guyana 93 Haiti 95 Honduras 97 Hungary 99 Iceland 100 India 101 Indonesia 102 Iran (Islamic Republic of) 103 Iraq 104 Ireland 105 Israel 106 Italy 109 Jamaica 110 Japan 112 Jordan 108 Kazakhstan 114 Kenya 83 Kiribati 118 Kuwait 113 Kyrgyzstan 120 Lao People's Democratic Republic 119 Latvia 121 Lebanon 122 Lesotho 123 Liberia 124 Libya 126 Lithuania 256 Luxembourg 129 Madagascar 130 Malawi 131 Malaysia 132 Maldives 133 Mali 134 Malta 127 Marshall Islands 135 Martinique 136 Mauritania 137 Mauritius 138 Mexico 145 Micronesia (Federated States of) 141 Mongolia 273 Montenegro 143 Morocco 144 Mozambique 28 Myanmar 147 Namibia 148 Nauru 149 Nepal 150 Netherlands 153 New Caledonia 156 New Zealand 157 Nicaragua 158 Niger 159 Nigeria 160 Niue 154 North Macedonia 162 Norway 221 Oman 165 Pakistan 299 Palestine 166 Panama 168 Papua New Guinea 169 Paraguay 170 Peru 171 Philippines 173 Poland 174 Portugal 177 Puerto Rico 179 Qatar 117 Republic of Korea 146 Republic of Moldova 182 Réunion 183 Romania 185 Russian Federation 184 Rwanda 188 Saint Kitts and Nevis 189 Saint Lucia 191 Saint Vincent and the Grenadines 244 Samoa 193 Sao Tome and Principe 194 Saudi Arabia 195 Senegal 272 Serbia 186 Serbia and Montenegro 196 Seychelles 197 Sierra Leone 200 Singapore 199 Slovakia 198 Slovenia 25 Solomon Islands 201 Somalia 202 South Africa 277 South Sudan 203 Spain 38 Sri Lanka 276 Sudan 206 Sudan (former) 207 Suriname 210 Sweden 211 Switzerland 212 Syrian Arab Republic 208 Tajikistan 216 Thailand 176 Timor-Leste 217 Togo 218 Tokelau 219 Tonga 220 Trinidad and Tobago 222 Tunisia 223 Türkiye 213 Turkmenistan 227 Tuvalu 226 Uganda 230 Ukraine 225 United Arab Emirates 229 United Kingdom of Great Britain and Northern Ireland 215 United Republic of Tanzania 231 United States of America 234 Uruguay 228 USSR 235 Uzbekistan 155 Vanuatu 236 Venezuela (Bolivarian Republic of) 237 Viet Nam 249 Yemen 248 Yugoslav SFR 251 Zambia 181 Zimbabwe 5000 World 5100 Africa 5101 Eastern Africa 5102 Middle Africa 5103 Northern Africa 5104 Southern Africa 5105 Western Africa 5200 Americas 5203 Northern America 5204 Central America 5206 Caribbean 5207 South America 5300 Asia 5301 Central Asia 5302 Eastern Asia 5303 Southern Asia 5304 South-eastern Asia 5305 Western Asia 5400 Europe 5401 Eastern Europe 5402 Northern Europe 5403 Southern Europe 5404 Western Europe 5500 Oceania 5501 Australia and New Zealand 5502 Melanesia 5503 Micronesia 5504 Polynesia 5707 European Union (27) 5801 Least Developed Countries 5802 Land Locked Developing Countries 5803 Small Island Developing States 5815 Low Income Food Deficit Countries 5817 Net Food Importing Developing Countries
items = [e['Item'] for e in alist]
for item, group in groupby(sorted(items)):
print(item)
Abaca, manila hemp, raw Agave fibres, raw, n.e.c. Almonds, in shell Anise, badian, coriander, cumin, caraway, fennel and juniper berries, raw Apples Apricots Areca nuts Artichokes Asparagus Asses Avocados Balata, gutta-percha, guayule, chicle and similar natural gums in primary forms or in plates, sheets or strip Bambara beans, dry Bananas Barley Beans, dry Beef and Buffalo Meat, primary Beer of barley, malted Bees Beeswax Blueberries Brazil nuts, in shell Broad beans and horse beans, dry Broad beans and horse beans, green Buckwheat Buffalo Buffalo fat, unrendered Butter and Ghee Butter and ghee of sheep milk Butter of buffalo milk Butter of cow milk Butter of goat milk Buttermilk, dry Cabbages Camels Canary seed Cantaloupes and other melons Carrots and turnips Cashew nuts, in shell Cashewapple Cassava leaves Cassava, fresh Castor oil seeds Cattle Cattle and Buffaloes Cattle fat, unrendered Cauliflowers and broccoli Cereals n.e.c. Cereals, primary Cheese (All Kinds) Cheese from milk of buffalo, fresh or processed Cheese from milk of goats, fresh or processed Cheese from milk of sheep, fresh or processed Cheese from skimmed cow milk Cheese from whole cow milk Cherries Chestnuts, in shell Chick peas, dry Chickens Chicory roots Chillies and peppers, dry (Capsicum spp., Pimenta spp.), raw Chillies and peppers, green (Capsicum spp. and Pimenta spp.) Cinnamon and cinnamon-tree flowers, raw Citrus Fruit, Total Cloves (whole stems), raw Cocoa beans Coconut oil Coconuts, in shell Coffee, green Coir, raw Cotton lint, ginned Cotton seed Cottonseed oil Cow peas, dry Cranberries Cream, fresh Cucumbers and gherkins Currants Dates Ducks Edible offal of buffalo, fresh, chilled or frozen Edible offal of cattle, fresh, chilled or frozen Edible offal of goat, fresh, chilled or frozen Edible offal of pigs, fresh, chilled or frozen Edible offal of sheep, fresh, chilled or frozen Edible offals of camels and other camelids, fresh, chilled or frozen Edible offals of horses and other equines, fresh, chilled or frozen Edible roots and tubers with high starch or inulin content, n.e.c., fresh Eggplants (aubergines) Eggs Primary Eggs from other birds in shell, fresh, n.e.c. Evaporated & Condensed Milk Fat of camels Fat of pigs Fibre Crops, Fibre Equivalent Figs Flax, processed but not spun Fonio Fruit Primary Game meat, fresh, chilled or frozen Geese Ghee from buffalo milk Ghee from cow milk Ginger, raw Goat fat, unrendered Goats Gooseberries Grapes Green corn (maize) Green garlic Green tea (not fermented), black tea (fermented) and partly fermented tea Groundnut oil Groundnuts, excluding shelled Hazelnuts, in shell Hempseed Hen eggs in shell, fresh Hop cones Horse meat, fresh or chilled Horses Jojoba seeds Jute, raw or retted Kapok fibre, raw Kapok fruit Kapokseed in shell Karite nuts (sheanuts) Kenaf, and other textile bast fibres, raw or retted Kiwi fruit Kola nuts Leeks and other alliaceous vegetables Lemons and limes Lentils, dry Lettuce and chicory Linseed Locust beans (carobs) Lupins Maize (corn) Mangoes, guavas and mangosteens Margarine and shortening Maté leaves Meat of asses, fresh or chilled Meat of buffalo, fresh or chilled Meat of camels, fresh or chilled Meat of cattle with the bone, fresh or chilled Meat of chickens, fresh or chilled Meat of ducks, fresh or chilled Meat of geese, fresh or chilled Meat of goat, fresh or chilled Meat of mules, fresh or chilled Meat of other domestic camelids, fresh or chilled Meat of other domestic rodents, fresh or chilled Meat of pig with the bone, fresh or chilled Meat of pigeons and other birds n.e.c., fresh, chilled or frozen Meat of rabbits and hares, fresh or chilled Meat of sheep, fresh or chilled Meat of turkeys, fresh or chilled Meat, Poultry Meat, Total Melonseed Milk, Total Millet Mixed grain Molasses Mules and hinnies Mushrooms and truffles Mustard seed Natural honey Natural rubber in primary forms Nutmeg, mace, cardamoms, raw Oats Oil of linseed Oil of maize Oil of palm kernel Oil of sesame seed Oil palm fruit Oilcrops, Cake Equivalent Oilcrops, Oil Equivalent Okra Olive oil Olives Onions and shallots, dry (excluding dehydrated) Onions and shallots, green Oranges Other beans, green Other berries and fruits of the genus vaccinium n.e.c. Other camelids Other citrus fruit, n.e.c. Other fibre crops, raw, n.e.c. Other fruits, n.e.c. Other meat n.e.c. (excluding mammals), fresh, chilled or frozen Other nuts (excluding wild edible nuts and groundnuts), in shell, n.e.c. Other oil seeds, n.e.c. Other pome fruits Other pulses n.e.c. Other rodents Other stimulant, spice and aromatic crops, n.e.c. Other stone fruits Other sugar crops n.e.c. Other tropical fruits, n.e.c. Other vegetables, fresh n.e.c. Palm kernels Palm oil Papayas Peaches and nectarines Pears Peas, dry Peas, green Pepper (Piper spp.), raw Peppermint, spearmint Persimmons Pig fat, rendered Pigeon peas, dry Pineapples Pistachios, in shell Plantains and cooking bananas Plums and sloes Pomelos and grapefruits Poppy seed Potatoes Poultry Birds Pulses, Total Pumpkins, squash and gourds Pyrethrum, dried flowers Quinces Quinoa Rabbits and hares Ramie, raw or retted Rape or colza seed Rapeseed or canola oil, crude Raspberries Raw cane or beet sugar (centrifugal only) Raw hides and skins of buffaloes Raw hides and skins of cattle Raw hides and skins of goats or kids Raw hides and skins of sheep or lambs Raw milk of buffalo Raw milk of camel Raw milk of cattle Raw milk of goats Raw milk of sheep Raw silk (not thrown) Rice Roots and Tubers, Total Rye Safflower seed Safflower-seed oil, crude Seed cotton, unginned Sesame seed Sheep Sheep and Goat Meat Sheep and Goats Sheep fat, unrendered Shorn wool, greasy, including fleece-washed shorn wool Silk-worm cocoons suitable for reeling Sisal, raw Skim Milk & Buttermilk, Dry Skim milk and whey powder Skim milk of cows Skim milk, condensed Skim milk, evaporated Snails, fresh, chilled, frozen, dried, salted or in brine, except sea snails Sorghum Sour cherries Soya bean oil Soya beans Spinach Strawberries String beans Sugar Crops Primary Sugar beet Sugar cane Sunflower seed Sunflower-seed oil, crude Sweet potatoes Swine / pigs Tallow Tallowtree seeds Tangerines, mandarins, clementines Taro Tea leaves Tomatoes Treenuts, Total Triticale True hemp, raw or retted Tung nuts Turkeys Unmanufactured tobacco Vanilla, raw Vegetables Primary Vetches Walnuts, in shell Watermelons Wheat Whey, condensed Whey, dry Whole milk powder Whole milk, condensed Whole milk, evaporated Wine Yams Yautia Yoghurt
for e in alist:
if e['Item'] == 'Wheat':
print(f"{e['Area']:35} {e['Element']}")
Afghanistan Area harvested Afghanistan Yield Afghanistan Production Albania Area harvested Albania Yield Albania Production Algeria Area harvested Algeria Yield Algeria Production Angola Area harvested Angola Yield Angola Production Argentina Area harvested Argentina Yield Argentina Production Armenia Area harvested Armenia Yield Armenia Production Australia Area harvested Australia Yield Australia Production Austria Area harvested Austria Yield Austria Production Azerbaijan Area harvested Azerbaijan Yield Azerbaijan Production Bangladesh Area harvested Bangladesh Yield Bangladesh Production Belarus Area harvested Belarus Yield Belarus Production Belgium Area harvested Belgium Yield Belgium Production Belgium-Luxembourg Area harvested Belgium-Luxembourg Yield Belgium-Luxembourg Production Bhutan Area harvested Bhutan Yield Bhutan Production Bolivia (Plurinational State of) Area harvested Bolivia (Plurinational State of) Yield Bolivia (Plurinational State of) Production Bosnia and Herzegovina Area harvested Bosnia and Herzegovina Yield Bosnia and Herzegovina Production Botswana Area harvested Botswana Yield Botswana Production Brazil Area harvested Brazil Yield Brazil Production Bulgaria Area harvested Bulgaria Yield Bulgaria Production Burundi Area harvested Burundi Yield Burundi Production Cameroon Area harvested Cameroon Yield Cameroon Production Canada Area harvested Canada Yield Canada Production Chad Area harvested Chad Yield Chad Production Chile Area harvested Chile Yield Chile Production China Area harvested China Yield China Production China, mainland Area harvested China, mainland Yield China, mainland Production China, Taiwan Province of Area harvested China, Taiwan Province of Yield China, Taiwan Province of Production Colombia Area harvested Colombia Yield Colombia Production Croatia Area harvested Croatia Yield Croatia Production Cyprus Area harvested Cyprus Yield Cyprus Production Czechia Area harvested Czechia Yield Czechia Production Czechoslovakia Area harvested Czechoslovakia Yield Czechoslovakia Production Democratic People's Republic of Korea Area harvested Democratic People's Republic of Korea Yield Democratic People's Republic of Korea Production Democratic Republic of the Congo Area harvested Democratic Republic of the Congo Yield Democratic Republic of the Congo Production Denmark Area harvested Denmark Yield Denmark Production Ecuador Area harvested Ecuador Yield Ecuador Production Egypt Area harvested Egypt Yield Egypt Production Eritrea Area harvested Eritrea Yield Eritrea Production Estonia Area harvested Estonia Yield Estonia Production Eswatini Area harvested Eswatini Yield Eswatini Production Ethiopia Area harvested Ethiopia Yield Ethiopia Production Ethiopia PDR Area harvested Ethiopia PDR Yield Ethiopia PDR Production Finland Area harvested Finland Yield Finland Production France Area harvested France Yield France Production Georgia Area harvested Georgia Yield Georgia Production Germany Area harvested Germany Yield Germany Production Greece Area harvested Greece Yield Greece Production Guatemala Area harvested Guatemala Yield Guatemala Production Honduras Area harvested Honduras Yield Honduras Production Hungary Area harvested Hungary Yield Hungary Production India Area harvested India Yield India Production Iran (Islamic Republic of) Area harvested Iran (Islamic Republic of) Yield Iran (Islamic Republic of) Production Iraq Area harvested Iraq Yield Iraq Production Ireland Area harvested Ireland Yield Ireland Production Israel Area harvested Israel Yield Israel Production Italy Area harvested Italy Yield Italy Production Japan Area harvested Japan Yield Japan Production Jordan Area harvested Jordan Yield Jordan Production Kazakhstan Area harvested Kazakhstan Yield Kazakhstan Production Kenya Area harvested Kenya Yield Kenya Production Kuwait Area harvested Kuwait Yield Kuwait Production Kyrgyzstan Area harvested Kyrgyzstan Yield Kyrgyzstan Production Latvia Area harvested Latvia Yield Latvia Production Lebanon Area harvested Lebanon Yield Lebanon Production Lesotho Area harvested Lesotho Yield Lesotho Production Libya Area harvested Libya Yield Libya Production Lithuania Area harvested Lithuania Yield Lithuania Production Luxembourg Area harvested Luxembourg Yield Luxembourg Production Madagascar Area harvested Madagascar Yield Madagascar Production Malawi Area harvested Malawi Yield Malawi Production Mali Area harvested Mali Yield Mali Production Malta Area harvested Malta Yield Malta Production Mauritania Area harvested Mauritania Yield Mauritania Production Mexico Area harvested Mexico Yield Mexico Production Mongolia Area harvested Mongolia Yield Mongolia Production Montenegro Area harvested Montenegro Yield Montenegro Production Morocco Area harvested Morocco Yield Morocco Production Mozambique Area harvested Mozambique Yield Mozambique Production Myanmar Area harvested Myanmar Yield Myanmar Production Namibia Area harvested Namibia Yield Namibia Production Nepal Area harvested Nepal Yield Nepal Production Netherlands Area harvested Netherlands Yield Netherlands Production New Caledonia Area harvested New Caledonia Yield New Caledonia Production New Zealand Area harvested New Zealand Yield New Zealand Production Niger Area harvested Niger Yield Niger Production Nigeria Area harvested Nigeria Yield Nigeria Production North Macedonia Area harvested North Macedonia Yield North Macedonia Production Norway Area harvested Norway Yield Norway Production Oman Area harvested Oman Yield Oman Production Pakistan Area harvested Pakistan Yield Pakistan Production Palestine Area harvested Palestine Yield Palestine Production Paraguay Area harvested Paraguay Yield Paraguay Production Peru Area harvested Peru Yield Peru Production Poland Area harvested Poland Yield Poland Production Portugal Area harvested Portugal Yield Portugal Production Qatar Area harvested Qatar Yield Qatar Production Republic of Korea Area harvested Republic of Korea Yield Republic of Korea Production Republic of Moldova Area harvested Republic of Moldova Yield Republic of Moldova Production Romania Area harvested Romania Yield Romania Production Russian Federation Area harvested Russian Federation Yield Russian Federation Production Rwanda Area harvested Rwanda Yield Rwanda Production Saudi Arabia Area harvested Saudi Arabia Yield Saudi Arabia Production Serbia Area harvested Serbia Yield Serbia Production Serbia and Montenegro Area harvested Serbia and Montenegro Yield Serbia and Montenegro Production Slovakia Area harvested Slovakia Yield Slovakia Production Slovenia Area harvested Slovenia Yield Slovenia Production Somalia Area harvested Somalia Yield Somalia Production South Africa Area harvested South Africa Yield South Africa Production South Sudan Area harvested South Sudan Production Spain Area harvested Spain Yield Spain Production Sudan Area harvested Sudan Yield Sudan Production Sudan (former) Area harvested Sudan (former) Yield Sudan (former) Production Sweden Area harvested Sweden Yield Sweden Production Switzerland Area harvested Switzerland Yield Switzerland Production Syrian Arab Republic Area harvested Syrian Arab Republic Yield Syrian Arab Republic Production Tajikistan Area harvested Tajikistan Yield Tajikistan Production Thailand Area harvested Thailand Yield Thailand Production Tunisia Area harvested Tunisia Yield Tunisia Production Türkiye Area harvested Türkiye Yield Türkiye Production Turkmenistan Area harvested Turkmenistan Yield Turkmenistan Production Uganda Area harvested Uganda Yield Uganda Production Ukraine Area harvested Ukraine Yield Ukraine Production United Arab Emirates Area harvested United Arab Emirates Yield United Arab Emirates Production United Kingdom of Great Britain and Northern Ireland Area harvested United Kingdom of Great Britain and Northern Ireland Yield United Kingdom of Great Britain and Northern Ireland Production United Republic of Tanzania Area harvested United Republic of Tanzania Yield United Republic of Tanzania Production United States of America Area harvested United States of America Yield United States of America Production Uruguay Area harvested Uruguay Yield Uruguay Production USSR Area harvested USSR Yield USSR Production Uzbekistan Area harvested Uzbekistan Yield Uzbekistan Production Venezuela (Bolivarian Republic of) Area harvested Venezuela (Bolivarian Republic of) Yield Venezuela (Bolivarian Republic of) Production Yemen Area harvested Yemen Yield Yemen Production Yugoslav SFR Area harvested Yugoslav SFR Yield Yugoslav SFR Production Zambia Area harvested Zambia Yield Zambia Production Zimbabwe Area harvested Zimbabwe Yield Zimbabwe Production World Area harvested World Yield World Production Africa Area harvested Africa Yield Africa Production Eastern Africa Area harvested Eastern Africa Yield Eastern Africa Production Middle Africa Area harvested Middle Africa Yield Middle Africa Production Northern Africa Area harvested Northern Africa Yield Northern Africa Production Southern Africa Area harvested Southern Africa Yield Southern Africa Production Western Africa Area harvested Western Africa Yield Western Africa Production Americas Area harvested Americas Yield Americas Production Northern America Area harvested Northern America Yield Northern America Production Central America Area harvested Central America Yield Central America Production South America Area harvested South America Yield South America Production Asia Area harvested Asia Yield Asia Production Central Asia Area harvested Central Asia Yield Central Asia Production Eastern Asia Area harvested Eastern Asia Yield Eastern Asia Production Southern Asia Area harvested Southern Asia Yield Southern Asia Production South-eastern Asia Area harvested South-eastern Asia Yield South-eastern Asia Production Western Asia Area harvested Western Asia Yield Western Asia Production Europe Area harvested Europe Yield Europe Production Eastern Europe Area harvested Eastern Europe Yield Eastern Europe Production Northern Europe Area harvested Northern Europe Yield Northern Europe Production Southern Europe Area harvested Southern Europe Yield Southern Europe Production Western Europe Area harvested Western Europe Yield Western Europe Production Oceania Area harvested Oceania Yield Oceania Production Australia and New Zealand Area harvested Australia and New Zealand Yield Australia and New Zealand Production Melanesia Area harvested Melanesia Yield Melanesia Production European Union (27) Area harvested European Union (27) Yield European Union (27) Production Least Developed Countries Area harvested Least Developed Countries Yield Least Developed Countries Production Land Locked Developing Countries Area harvested Land Locked Developing Countries Yield Land Locked Developing Countries Production Small Island Developing States Area harvested Small Island Developing States Yield Small Island Developing States Production Low Income Food Deficit Countries Area harvested Low Income Food Deficit Countries Yield Low Income Food Deficit Countries Production Net Food Importing Developing Countries Area harvested Net Food Importing Developing Countries Yield Net Food Importing Developing Countries Production
results = []
for e in alist:
if e['Item'] == 'Apples' and e['Element'] == 'Production':
production = 0
if e['Y2021']:
production = float(e['Y2021'])
results.append((production, e['Area Code'], e['Area']))
for production, area_code, item in sorted(results, reverse=True):
if len(area_code)==4 and production>0:
print(f'{production:17,.0f} {area_code:>4} {item}')
93,144,358 5000 World 61,269,155 5300 Asia 48,041,015 5302 Eastern Asia 18,367,513 5400 Europe 12,399,850 5707 European Union (27) 9,843,670 5401 Eastern Europe 9,113,051 5200 Americas 5,727,483 5305 Western Asia 5,557,096 5303 Southern Asia 5,377,097 5815 Low Income Food Deficit Countries 4,818,771 5203 Northern America 4,361,585 5403 Southern Europe 3,590,970 5207 South America 3,546,794 5404 Western Europe 3,542,442 5100 Africa 3,441,123 5802 Land Locked Developing Countries 3,119,007 5817 Net Food Importing Developing Countries 2,376,599 5103 Northern Africa 1,943,560 5301 Central Asia 1,148,771 5104 Southern Africa 852,197 5501 Australia and New Zealand 852,197 5500 Oceania 701,324 5204 Central America 615,464 5402 Northern Europe 373,915 5801 Least Developed Countries 17,072 5101 Eastern Africa 1,986 5803 Small Island Developing States 1,986 5206 Caribbean
def query(rows, item, element, area='....'):
"""Extract records from crops and livestock db"""
results = []
for e in rows:
if e['Item'] == item and e['Element'] == element:
production = 0
if e['Y2021']:
production = float(e['Y2021'])
results.append((production, e['Area Code'], e['Area']))
for production, area_code, item in sorted(results, reverse=True):
if re.fullmatch(area, area_code) and production>0:
print(f'{production:17,.0f} {area_code:>4} {item}')
query(alist, 'Wheat', 'Production', area='..00')
770,877,073 5000 World 340,462,347 5300 Asia 269,184,238 5400 Europe 99,665,569 5200 Americas 32,345,470 5500 Oceania 29,219,448 5100 Africa
query(alist, 'Wheat', 'Production', area=".{1,3}")
136,952,000 351 China 136,946,000 41 China, mainland 109,590,000 100 India 76,057,258 185 Russian Federation 44,790,360 231 United States of America 36,559,450 68 France 32,183,300 230 Ukraine 31,922,555 10 Australia 27,464,081 165 Pakistan 22,296,100 33 Canada 21,459,200 79 Germany 17,650,000 223 Türkiye 17,644,277 9 Argentina 13,988,000 229 United Kingdom of Great Britain and Northern Ireland 11,893,550 173 Poland 11,814,124 108 Kazakhstan 10,433,750 183 Romania 10,093,579 102 Iran (Islamic Republic of) 9,000,000 59 Egypt 8,564,630 203 Spain 7,874,525 21 Brazil 7,543,848 143 Morocco 7,342,990 27 Bulgaria 7,294,570 106 Italy 5,984,756 235 Uzbekistan 5,290,140 97 Hungary 5,214,000 238 Ethiopia 4,960,930 167 Czechia 4,248,850 126 Lithuania 4,233,714 103 Iraq 4,047,090 54 Denmark 3,900,000 2 Afghanistan 3,442,308 272 Serbia 3,283,614 138 Mexico 3,027,800 210 Sweden 2,441,000 57 Belarus 2,407,700 119 Latvia 2,257,205 202 South Africa 2,168,386 4 Algeria 2,127,276 149 Nepal 2,002,240 199 Slovakia 1,951,806 212 Syrian Arab Republic 1,837,188 52 Azerbaijan 1,629,180 255 Belgium 1,565,200 146 Republic of Moldova 1,547,600 11 Austria 1,367,092 213 Turkmenistan 1,353,608 40 Chile 1,193,000 222 Tunisia 1,097,000 110 Japan 1,085,368 16 Bangladesh 1,058,360 84 Greece 986,930 98 Croatia 947,250 150 Netherlands 936,400 234 Uruguay 927,776 169 Paraguay 852,000 208 Tajikistan 736,270 63 Estonia 687,160 67 Finland 628,080 104 Ireland 612,582 194 Saudi Arabia 600,000 276 Sudan 566,273 141 Mongolia 422,831 156 New Zealand 401,202 211 Switzerland 362,711 113 Kyrgyzstan 337,212 181 Zimbabwe 336,222 19 Bolivia (Plurinational State of) 314,382 80 Bosnia and Herzegovina 266,600 162 Norway 245,300 114 Kenya 243,676 154 North Macedonia 225,171 3 Albania 205,882 251 Zambia 202,725 170 Peru 154,450 198 Slovenia 150,000 105 Israel 135,900 73 Georgia 130,000 124 Libya 125,000 249 Yemen 100,000 28 Myanmar 100,000 121 Lebanon 97,000 1 Armenia 90,000 159 Nigeria 86,604 116 Democratic People's Republic of Korea 76,140 256 Luxembourg 70,000 215 United Republic of Tanzania 69,440 174 Portugal 34,396 299 Palestine 30,000 117 Republic of Korea 30,000 112 Jordan 25,580 50 Cyprus 25,000 226 Uganda 25,000 178 Eritrea 21,000 133 Mali 18,337 147 Namibia 15,000 144 Mozambique 13,684 184 Rwanda 10,898 58 Ecuador 9,000 250 Democratic Republic of the Congo 8,807 29 Burundi 7,000 136 Mauritania 6,965 44 Colombia 6,000 214 China, Taiwan Province of 6,000 122 Lesotho 4,629 158 Niger 3,542 221 Oman 2,946 7 Angola 2,392 273 Montenegro 2,000 129 Madagascar 1,540 39 Chad 1,318 216 Thailand 1,280 20 Botswana 1,256 95 Honduras 1,169 18 Bhutan 1,051 201 Somalia 1,000 130 Malawi 709 209 Eswatini 633 32 Cameroon 551 236 Venezuela (Bolivarian Republic of) 292 89 Guatemala 252 179 Qatar 84 153 New Caledonia 37 118 Kuwait
query(alist, 'Cattle', 'Stocks', area='..00')
1,529,295,983 5000 World 538,873,935 5200 Americas 467,504,826 5300 Asia 373,198,697 5100 Africa 114,708,582 5400 Europe 35,009,942 5500 Oceania
query(alist, 'Cattle', 'Stocks', area='.{1,3}')
224,602,112 21 Brazil 193,165,740 100 India 93,789,500 231 United States of America 65,718,708 238 Ethiopia 60,522,044 351 China 60,361,342 41 China, mainland 53,416,435 9 Argentina 51,495,000 165 Pakistan 35,998,615 138 Mexico 33,287,209 39 Chad 32,027,868 276 Sudan 30,716,518 215 United Republic of Tanzania 29,301,392 44 Colombia 24,545,000 16 Bangladesh 24,431,174 10 Australia 22,853,225 114 Kenya 21,162,929 159 Nigeria 18,053,710 101 Indonesia 18,027,172 185 Russian Federation 17,850,543 223 Türkiye 17,330,080 68 France 17,107,271 158 Niger 16,221,020 236 Venezuela (Bolivarian Republic of) 14,624,111 226 Uganda 13,919,507 169 Paraguay 13,612,784 277 South Sudan 13,544,400 235 Uzbekistan 12,848,696 133 Mali 12,232,115 202 South Africa 11,914,643 234 Uruguay 11,057,929 33 Canada 11,039,660 79 Germany 10,400,038 233 Burkina Faso 10,385,482 19 Bolivia (Plurinational State of) 10,300,000 28 Myanmar 10,150,246 156 New Zealand 9,603,000 229 United Kingdom of Great Britain and Northern Ireland 8,838,476 129 Madagascar 8,826,796 90 Guinea 8,192,415 108 Kazakhstan 7,466,841 149 Nepal 6,649,310 104 Ireland 6,576,300 203 Spain 6,378,700 173 Poland 6,365,300 237 Viet Nam 6,280,280 106 Italy 6,229,800 32 Cameroon 5,853,660 170 Peru 5,656,625 157 Nicaragua 5,343,674 102 Iran (Islamic Republic of) 5,342,704 181 Zimbabwe 5,189,749 7 Angola 5,122,077 2 Afghanistan 5,022,225 141 Mongolia 4,760,635 37 Central African Republic 4,627,914 216 Thailand 4,435,943 201 Somalia 4,235,900 57 Belarus 4,103,324 89 Guatemala 4,066,930 58 Ecuador 3,990,257 117 Republic of Korea 3,961,000 110 Japan 3,818,846 251 Zambia 3,705,000 150 Netherlands 3,678,029 195 Senegal 3,657,300 49 Cuba 3,178,876 143 Morocco 3,058,952 56 Dominican Republic 3,038,122 40 Chile 2,950,546 147 Namibia 2,911,284 95 Honduras 2,874,000 230 Ukraine 2,819,413 59 Egypt 2,695,963 115 Cambodia 2,623,290 53 Benin 2,605,262 171 Philippines 2,545,403 213 Turkmenistan 2,519,692 52 Azerbaijan 2,363,149 208 Tajikistan 2,310,440 255 Belgium 2,258,176 120 Lao People's Democratic Republic 2,219,635 144 Mozambique 2,128,383 178 Eritrea 2,061,427 103 Iraq 2,036,980 130 Malawi 1,943,940 136 Mauritania 1,929,000 81 Ghana 1,870,100 11 Austria 1,826,800 183 Romania 1,786,267 107 Côte d'Ivoire 1,750,467 113 Kyrgyzstan 1,734,476 4 Algeria 1,678,110 184 Rwanda 1,661,997 249 Yemen 1,640,650 174 Portugal 1,518,147 93 Haiti 1,513,872 211 Switzerland 1,509,900 166 Panama 1,490,234 250 Democratic Republic of the Congo 1,480,000 54 Denmark 1,389,890 210 Sweden 1,359,420 167 Czechia 1,306,504 48 Costa Rica 1,131,080 38 Sri Lanka 1,026,589 20 Botswana 951,177 29 Burundi 925,800 73 Georgia 909,900 97 Hungary 901,026 162 Norway 872,307 212 Syrian Arab Republic 859,514 272 Serbia 829,980 67 Finland 738,846 60 El Salvador 733,029 197 Sierra Leone 725,226 175 Guinea-Bissau 701,117 131 Malaysia 700,000 194 Saudi Arabia 630,409 222 Tunisia 628,700 126 Lithuania 614,338 209 Eswatini 611,200 27 Bulgaria 581,161 116 Democratic People's Republic of Korea 580,567 1 Armenia 564,000 84 Greece 530,000 105 Israel 482,620 198 Slovenia 462,099 75 Gambia 455,756 217 Togo 434,090 199 Slovakia 428,000 98 Croatia 421,950 221 Oman 393,470 119 Latvia 362,916 177 Puerto Rico 353,746 122 Lesotho 341,898 80 Bosnia and Herzegovina 336,834 46 Congo 336,784 3 Albania 302,116 72 Djibouti 295,444 18 Bhutan 250,800 63 Estonia 222,894 176 Timor-Leste 199,605 124 Libya 187,200 256 Luxembourg 177,622 154 North Macedonia 159,122 214 China, Taiwan Province of 158,357 109 Jamaica 108,900 146 Republic of Moldova 104,648 225 United Arab Emirates 104,318 23 Belize 99,785 91 Guyana 96,818 155 Vanuatu 91,675 168 Papua New Guinea 86,820 121 Lebanon 84,610 50 Cyprus 82,015 153 New Caledonia 80,563 99 Iceland 78,477 112 Jordan 75,912 273 Montenegro 67,760 299 Palestine 59,905 66 Fiji 51,077 45 Comoros 50,721 179 Qatar 45,340 123 Liberia 44,474 244 Samoa 38,877 74 Gabon 35,845 220 Trinidad and Tobago 35,602 207 Suriname 31,769 118 Kuwait 29,173 35 Cabo Verde 18,408 145 Micronesia (Federated States of) 15,285 25 Solomon Islands 14,294 55 Dominica 14,020 134 Malta 12,185 219 Tonga 11,873 14 Barbados 10,692 189 Saint Lucia 7,535 70 French Polynesia 7,500 13 Bahrain 5,467 61 Equatorial Guinea 4,569 137 Mauritius 4,565 86 Grenada 3,583 8 Antigua and Barbuda 3,125 191 Saint Vincent and the Grenadines 1,978 188 Saint Kitts and Nevis 1,809 64 Faroe Islands 1,579 96 China, Hong Kong SAR 1,392 193 Sao Tome and Principe 772 12 Bahamas 353 26 Brunei Darussalam 279 196 Seychelles 174 200 Singapore 113 160 Niue 108 47 Cook Islands
query(alist, 'Avocados', 'Production', area='..00')
8,685,672 5000 World 6,096,596 5200 Americas 1,241,567 5300 Asia 1,069,854 5100 Africa 151,836 5400 Europe 125,820 5500 Oceania
query(alist, 'Avocados', 'Production', area='.{1,3}')
2,442,945 138 Mexico 979,618 44 Colombia 777,096 170 Peru 669,260 101 Indonesia 634,368 56 Dominican Republic 416,803 114 Kenya 300,894 21 Brazil 248,135 93 Haiti 212,977 237 Viet Nam 169,031 40 Chile 165,000 105 Israel 152,505 238 Ethiopia 136,750 231 United States of America 136,476 89 Guatemala 131,531 236 Venezuela (Bolivarian Republic of) 124,780 41 China, mainland 124,780 351 China 116,770 203 Spain 93,872 130 Malawi 85,986 10 Australia 82,677 202 South Africa 82,369 143 Morocco 75,116 32 Cameroon 63,372 250 Democratic Republic of the Congo 42,492 58 Ecuador 38,321 156 New Zealand 35,993 107 Côte d'Ivoire 27,310 129 Madagascar 20,170 174 Portugal 19,945 60 El Salvador 19,875 171 Philippines 18,955 121 Lebanon 15,855 169 Paraguay 15,316 48 Costa Rica 14,941 38 Sri Lanka 13,045 166 Panama 12,760 84 Greece 12,443 19 Bolivia (Plurinational State of) 9,143 81 Ghana 9,118 46 Congo 9,081 223 Türkiye 8,225 37 Central African Republic 6,184 181 Zimbabwe 5,950 184 Rwanda 4,324 176 Timor-Leste 4,174 9 Argentina 3,531 49 Cuba 3,245 91 Guyana 2,500 109 Jamaica 2,183 95 Honduras 1,552 86 Grenada 1,376 244 Samoa 1,372 12 Bahamas 1,210 50 Cyprus 1,100 68 France 1,036 80 Bosnia and Herzegovina 879 209 Eswatini 821 299 Palestine 728 14 Barbados 537 177 Puerto Rico 375 55 Dominica 325 222 Tunisia 304 189 Saint Lucia 269 131 Malaysia 116 70 French Polynesia 100 207 Suriname 73 18 Bhutan 55 220 Trinidad and Tobago 22 47 Cook Islands 13 196 Seychelles