Urllib2 Json

x supports two types of strings for working with text data. It lets you stuff a bunch of JSON documents into a file database and then query them. Thanks so much. json import json_norm. We also use these cookies to improve our products and services, support our marketing campaigns, and advertise to you on our website and other websites. For bonus points, here's a bit of client-side code that will produce a request that has a body suitable for reading via request. ''' This jython script calls an external API to get exchange rates, and then generates a file which is picked up by the EPM Integration Agent ''' import json import urllib2 ''' Turn off SQL processing by AGENT ''' agentAPI. Last Updated: January 10, 2014. domains service is meant to be for educational purposes only. To improve our website, to personalize content and adverts, to provide social media features, and to analyze our traffic, we use cookies. Get started here, or scroll down for documentation broken out by type and subject. y (x和y 是Python 主. You can vote up the examples you like or vote down the ones you don't like. An introduction to data serialization and Python Requests This is a hybrid primer that covers: Basic usage of the Python Requests package to download files from the web and, in the case of JSON text files, decode them into Python data structures. We can use Python urllib to get website content in python program. JSON is a more robust response format, and Python has support for it in its standard library since version 2. Request('http:9. By clicking on the "Download" button the data can be obtained in multiple formats: HTML, CSV, JSON or XML. We will use ODBC PowerPack to connect and query a JSON file. Hi Sridevi, Thank you for the reply. load(u)以文件方法来读取. • Extensively used python modules such as requests, urllib, urllib2 for web crawling. The JSON "interface" to VoltDB is actually a web interface that the VoltDB database server makes available for processing requests and returning data in JSON format. The parser is defined using an XML syntax. Install Now The Sublime Text package manager that makes it exceedingly simple to find, install and keep packages up-to-date. Request(query, postData) response = urllib2. Step 2: Click the blue "+ Free" button to add Blockspring for Google Sheets to your account. When I try to open it I get the following error. The way a browser identifies itself is through the User-Agent header. In our test script, we make the api call using urllib2 library and do assertion that the city name should exist in the response json string. It provides a more convenient and idiomatic way to write and manipulate queries. The International Space Station is moving at close to 28,000 km/h so its location changes really fast! Where is it right now?. In my example, I will use the Twitter API. The JSON API gives access to Royal Mail PAF data and Geocoding. The urllib module provides a simple interface for network resource access. XML is heavier than JSON and so, most developers prefer the latter in their applications. We can make GET and POST http requests. *?)"\)', } video_info = {} for piece in data. conf stanza specifying INDEXED_EXTRACTIONS and all parsing options should live on the originating Splunk instance instead of the usual parsing Splunk instance. action tells the API what we want to do. (I've tried both a place search and detail search, and have. An operation that allows the Merchant to capture the authorized amount to his account. urllib2和json. urllib provides a URLopener base class, and FancyURLopener with default handling for the supported protocols. json will contain a JSON object with the details of the action that we want the User API to perform. dumps(body)) 以为这么写就可以 但是实际在server处理时一直读不到body数据,后来调试发现数据依然在postform里。. If you don't want to muck around with headers (or the 2 managers you need to create to achieve this in [code]urllib2[/code]), the excellent [code]requests[/code] library comes with support for all kinds of authentication schemes out of the box. You can use use the json. 使用urlopen方法打开网址后, 使用json. They are extracted from open source Python projects. class urllib2. As you may know, Azure Machine Learning can execute R scripts. After parsing the command line arguments with the Python argparse module, the script uses Python urllib2 to obtain the JIRA session cookie with an HTTP POST request, containing a username and password, packed into a JSON message, to endpoint rest/auth/1/session. urllib in Python 3 is slightly different than urllib2 in Python 2, but they are mostly the same. Installation Simple. We can also use it to call REST web services. Continuing my search for 15 APIs in 15 Days (also on GitHub), today I'm writing about the ISS Notify API (or is it the Open Notify API?). Introduction. json exposes an API familiar to users of the standard library marshal and pickle modules. This code depends on the RestSharp NuGet package (just discovered it; made accessing the endpoint simple) and some classes I had to defined but didn't want to paste below - you can find everything on GitHub. 'Requests ' is an Apache 2 HTTP library written in Python. import json import requests These import statements load Python code that allow us to work with the JSON data format and the HTTP protocol. OK, I Understand. The html is of type str and I am expecting a JSON. The screen name in Twitter, is the screen name of the user for whom to return results for. This function caches results for up to 60 seconds automatically to prevent spamming other peoples' servers. If it was actually JSON text there would be a lot more double quotes at least. JSON (stands for “JavaScript Object Notation”) is a text-based format which facilitates data interchange between diverse applications. I use the Fixer. JSON-LD is a popular serialization for use in web development and is also gaining traction as a serialization that search engines can consume. Let's Wrap an API in C#. Question asked by modybsystematics-co-il-esridist on Jun 22, 2017 import urllib, urllib2, json, sys,. For some articles, the access to the full text paper is also open. You can interactively see the output console. urlopen No JSON object could be decoded) but that was because I was using the URL. read()でデータ読み込みしファイルへ書き込み f. pip install urllib2 pip install requests pip. There are two common ways to get data in web apps: data from servers using an API (usually JSON) and data from databases. the set of operations supported by the web service using HTTP methods (e. Learn Using Python to Access Web Data from University of Michigan. To help you get started with building your own integrations, we’ll include basic code samples in this area. Last Updated: Apr 16, 2012. There exists a much better and easier to use HTTP client interface called Python Requests. While the URL can be directly passed to urllib2. Request Library. You can vote up the examples you like or vote down the ones you don't like. On the server, JWTs are generated by signing user information via a secret key, which are then securely stored on the client. If you are asking the question because of some 'blank page' writers block trauma and you don't know at all how to start writing this, here's a guide with a crappy 'stream of consciousness' code…. You will pass ScoreData, which contains a FeatureVector, an n-dimensional vector of numerical features that represents the ScoreData. The return value of urllib. This indicates that it's unable to look up whatever host it's trying to access (the Review Board host, specifically). Using an HTTP GET using Content-Type”: “application/json” we can retrieve values from our “control” table. To complete the data set, it is necessary to parse each newspaper’s JSON record into individual columns. read attribute on the object that you gave it, and you gave it an object of type str (i. Based on your plan, you will be allowed an API request rate of X requests per minute. Criteria Usage; Questions with keyword1 or keyword2: keyword1 keyword2: Questions with a mandatory word, e. excuse my kindergartenesque computer knowledge but I have a podcast and I am trying to understand my statistics. A Python RESTful API client is provided along with a REST test library to aid in test development of RESTful services. One of the most liked feature of the newly launched HackerEarth profile is the accounts connections through which you can boast about your coding activity in various platforms. If you’re using an earlier version of Python, the simplejson library is available via PyPI. Myriad python utilities. Here an example from the urllib2 docs - Use of Basic HTTP Authentication: import urllib2 # Create an OpenerDirector with support for Basic HTTP Authentication auth_handler = How to provide authentication using urllib2. urlopen() you can get the contents of the page. Per the API spec and REST best practices, we know the task is created because of the 201 response code. The “results” variable will be a dictionary loaded from the JSON response. The example that I am going to show you next is a simple screen with a button at the bottom, by pressing the button we will get the data from a REST service and we parsed the JSON to a custom. She then shows you how to use the JSON module to decode this content and get what you need from it. Python has a built in library called urllib2, it is bit complex and old style when compared to Requests. 0 documentation 動機 Web API使ってるとでてくる使い回しをメモ。. GitHub Gist: instantly share code, notes, and snippets. aria2 can download a file from multiple sources/protocols and tries to utilize your maximum download bandwidth. Calling the API Your API call can be made in any language and will include a JSON object communicating the data you want. Here an example from the urllib2 docs - Use of Basic HTTP Authentication: import urllib2 # Create an OpenerDirector with support for Basic HTTP Authentication auth_handler = How to provide authentication using urllib2. Here is my code: import pandas as pd import json from pandas. json_body using Python's urllib2 instead of a JavaScript AJAX request: import urllib2 import json json_payload = json. utf-8 -*-import webapp2 import urllib2 import json class. Python urllib. From an editing standpoint, the most notable change is support for tabs to quickly switch between multiple scripts. Creating the "Command Line Search Tool" I think we have all the API information we need, so let's get to it. She then shows you how to use the JSON module to decode this content and get what you need from it. Welcome to the Wufoo API! You can use our API to access your forms, entries, reports, submit new entries, and add or remove Webhooks. The following are code examples for showing how to use urllib. Many APIs work with this format to provide and receive data, as we had seen in the post about the Cisco NX-API on Nexus 5500. While the URL can be directly passed to urllib2. Python 3: urllib. Knowing how to parse JSON objects is useful when you want to access an API from various web services that gives the response in JSON. For each message that is sent (‘created’), the data that hits your server is in a JSON format, so parsing them is easy, thanks to the built-in ‘json’ python library. There exists a much better and easier to use HTTP client interface called Python Requests. pdf # import httplib, json, urllib, urllib2 Read more. Note that, like in the rjstat project, not all features are supported (i. encode("utf-8")). So the format of JSON is nearly identical to a combination of Python lists and dictionaries. request and json. Hence forth we will move along with Python Requests library to learn and develop RESTful API. However, I could not replicate what the html form was doing. def GetCsspToken(): data = json. You need to have json and urllib2 modules for this. We can also use it to call REST web services. How To: Create and download a file geodatabase replica from a hosted feature service using Python Summary. OpenerDirector¶ The OpenerDirector class opens URLs via BaseHandler s chained together. If you are unfamiliar with JSON, see this article. rename at the end. Users can freely search for biomedical references. We use cookies for various purposes including analytics. Reason of choosing python was that ultimate goal is a binary. urlopen() for simple requests, you need to create an instance of the urllib2. 4 JavaScript Object Notation - JSON The JSON format was inspired by the object and array format used in the JavaScript language. Let's Wrap an API in C#. Let's demonstrate the power of PyPI packages by taking look at how to retrieve and parse JSON results from a RESTful API using four different Python HTTP libraries. (In most environments, this means. import json aa = "String with\ttab and newline" print "1. I want to use python urllib2 to simulate a login action, I use Fiddler to catch the packets and got that the login action is just an ajax request and the username and password is sent as json data, but I have no idea how to use urllib2 to send json data, help. load(u)以文件方法来读取. How to Learn Anything Fast - Josh Kaufman - Duration: 23:20. urllib2 を利用するスクリプトを実行したところModuleがないと言われました。 特に何かをしたわけではなかったのでないなら入れればいいのですが 検索してもurllib2の具体的な導入方法が出てきません。. class urllib2. To ensure client and server software from various sources will work well together, the web services are built on the REpresentational State Transfer (REST) open standard. International Space Station Current Location. urlopen(url) data = json. This article also covers creating Excel from SOAP XML Web Service so read full article to learn about SOAP API Export. utf-8 -*-import webapp2 import urllib2 import json class. When you create a Request object you can pass a dictionary of. I am trying to figure out how to do a POST request using urllib2 with the data being in JSON format. Python and The ISS Posted on May 10, 2014 by damianmooney • Tagged coderdojo , ISS , open-notify. To improve our website, to personalize content and adverts, to provide social media features, and to analyze our traffic, we use cookies. 2010/3/12 lasizoillo. loads(response. As /u/davidj911 said, use requests, it's way more human friendly than urllib2. Replace all assert with self. This is my code: !/usr/bin/python3 import http. Analytics Report Filters. JSON must be encoded using a UTF codec, and the above works for UTF-8, UTF-16 and UTF-32, provided a BOM codepoint is included for the latter two codecs. dumps({"userName":"wenbin", "password":"passwd"}) try: req = urllib2. Now, since we are using JSON as our data format, we were able to take a nice shortcut here: the json argument to post. excuse my kindergartenesque computer knowledge but I have a podcast and I am trying to understand my statistics. close() Messa의 대답은 서버가 컨텐트 유형 헤더를 확인하는 것을 괴롭히지 않는 경우에만 작동합니다. I wrapped all three examples from the ISS Notify API post. 0 documentation 動機 Web API使ってるとでてくる使い回しをメモ。. Beautiful Soup 3 was the official release line of Beautiful Soup from May 2006 to March 2012. This plugin allows Trac plugins to export select parts of their interface via XML-RPC and JSON-RPC (if json or simplejson is available). I use the Fixer. It looks like the script gets information about the input Server on line 54: protocol, serverName, serverPort, context = splitSiteURL (agsServerSite). urllib2 を利用するスクリプトを実行したところModuleがないと言われました。 特に何かをしたわけではなかったのでないなら入れればいいのですが 検索してもurllib2の具体的な導入方法が出てきません。. urllib2和json. If you are unfamiliar with JSON, see this article. Our API can be used by making requests with any HTTP service/client/library. While the requests project looks interesting, it seems a little disingenuous for the project's author to compare usage snippets with appears to be a purposely inflated LoC count in the urllib2 case. We use cookies for various purposes including analytics. 0 (compatible; MSIE 8. def GetCsspToken(): data = json. Manage web services using API Management - Azure Machine Learning Studio | Microsoft Docs. json_body using Python's urllib2 instead of a JavaScript AJAX request: import urllib2 import json json_payload = json. aria2 can download a file from multiple sources/protocols and tries to utilize your maximum download bandwidth. donorschoose. (In most environments, this means. Python's standard urllib2 module provides most of the HTTP capabilities you need, but the API is thoroughly broken. I wrapped all three examples from the ISS Notify API post. Start the server in one terminal. Introduction. Python module to work the Zenoss API. I don't know what the heck Python-urllib is, means, etc. This chapter covers how to encode and decode JSON objects using Python programming language. dumps([1, 2, 3]) f = urllib2. Python includes a built-in HTTP client, urllib2, but its interface is clunky and hard to use. 5 and lower, install and use simplejson. This article also covers creating Excel from SOAP XML Web Service so read full article to learn about SOAP API Export. Please include additional details, a link to any tutorials you are following, e. 파이썬(python) 오픈api json파일 가져오기 요즘 많은 공공데이터들을 json파일로 공개를 하고 있습니다. In contrast, unicode strings are managed internally as a sequence of Unicode code points. io JSON API to get some financial data, but any JSON API should do. The mission of the Python Software Foundation is to promote, protect, and advance the Python programming language, and to support and facilitate the growth of a diverse and international community of Python programmers. import json import urllib2 url = "string to url" response = urllib2. dumps(values) req = urllib2. It’s Thursday and I’ve never actually done one of those “Throw Back Thursday” things and if I understand right it’s typically about photos but since according to the Urban dictionary that has changed I decided why not do my own. load() expects to read a bytestring. 6 or higher # for 2. class urllib2. def GetCsspToken(): data = json. I am currently getting JSON data from the discogs API (mp3 tag data) and wish to sort the results by the key's value. working with Json data correctly. urlopen (url[, data[, timeout[, cafile[, capath[, cadefault[, context]]]]]) ¶ Open the URL url , which can be either a string or a Request object. conf stanza specifying INDEXED_EXTRACTIONS and all parsing options should live on the originating Splunk instance instead of the usual parsing Splunk instance. This 40 character string is your API key. close() Messa의 대답은 서버가 컨텐트 유형 헤더를 확인하는 것을 괴롭히지 않는 경우에만 작동합니다. How to Use Facebook Dialog OAuth and make API calls at server side using PHP/Java/Python/Ruby. I have the following piece of code, which. dumps ({ 'a' : 1 }) headers = { 'Content-Type' : 'application/json; charset=utf-8' } req = urllib2. JSON data structures map directly to Python data types, which makes this a powerful tool for directly accessing data without having to write any XML parsing code. If you are unfamiliar with JSON, see this article. Using urllib2 in Python: In Python 2. We use our own and third-party cookies to provide you with a great online experience. Create a simple REST web service with Python. Collections. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. This is my code: !/usr/bin/python3 import http. Get a JSON from a remote URL and parse it. NEW The DynaMine predictor is also available as a command line tool (Beta – python 2) or a JSON API that you can use to integrate DynaMine in your application. You might also like to check out our SDKs. Here's my code (`theIssue` variable is JSON, omitted for brevity):. loads(response. FreeboxV6 JSON Api with Python. 现在的网站大多使用瀑布流的json方法来加载,因此在爬取这些信息时,要先对网页进行动态分析,找出对应的json连接后,读取对应的网页内容使用开发者工具对浏览器页面分析的过程就先略过,以后有时间再讲,今 博文 来自: weixin_43999929的博客. Recall the references to the abbreviations, or keys, above, e. Python's standard urllib2 module provides most of the HTTP capabilities you need, but the API is thoroughly broken. Let's Wrap an API in C#. > questions as whether it's json at all, whether the lines each contain a > > single json record, or what. We'll use the Spotify API because it allows requests without authentication. Thanks so much. Finally, we extract the required information by parsing down the JSON type object. Convert curl syntax to Python, Ansible URI, Node. of likes and other page data of a facebook page using Graph API. - We will need to install the "simplejson" python module on our system. We can get the number of tweets using the length function. dumps ({ 'a' : 1 }) headers = { 'Content-Type' : 'application/json; charset=utf-8' } req = urllib2. Beautiful Soup 3 was the official release line of Beautiful Soup from May 2006 to March 2012. read attribute on the object that you gave it, and you gave it an object of type str (i. The source code of urllib2 has a hard coded date header which prevents. This example creates a report showing all service request statistics collected by ArcGIS Server. urlopen(url, data) response = f. Make Yahoo! Web Service REST calls with Python. After parsing the command line arguments with the Python argparse module, the script uses Python urllib2 to obtain the JIRA session cookie with an HTTP POST request, containing a username and password, packed into a JSON message, to endpoint rest/auth/1/session. XIVAPI provides a massive amount of FINAL FANTASY XIV game data in a JSON format via a REST API. dumps([1, 2, 3]) f = urllib2. org Mailing Lists: Welcome! Below is a listing of all the public Mailman 2 mailing lists on mail. Neutrino API examples - Python. Brief Introduction We provide programmatic access to various data resources and analysis tools via our web service APIs. With urllib2 you can add your own headers with urllib2. urlopen from the standard library urllib modules. They are extracted from open source Python projects. urllib2 import json from pprint import pprint # install an urlopener which handle cookies cookiejar = cookielib. pip install urllib2 pip install requests pip. In my case we’re going to check. Putting it all together and examples. urlopen(url) data = json. Posts about openweathermap written by damianmooney. load(u)以文件方法来读取. Request(url, jdata) # 生成页面请求的完整数据 response = urllib2. Python 3: urllib. dumps([1, 2, 3]) f = urllib2. They are extracted from open source Python projects. dumps() 메서드를 써서 Python Object를 문자열로 변환하면 된다. Delve deeper into the topic and learn how it can be installed, and how Python Requests can be used to your advantage. Most the parameters used are the defaults, but you can see a list of the most up-to-date default values here. Web services ¶ Most data in GPCRdb is available pragrammatically via a REST API. To complete the data set, it is necessary to parse each newspaper’s JSON record into individual columns. It would look like:. For more examples, see the JSONField and BinaryJSONField API documents below. Very simple. Join GitHub today. They are extracted from open source Python projects. Honza Král Hello Josep, you need to send the data as json, not as urlencoded, so: values = { "doc" : "{ Parametros : PruebaParametros }" } postData = json. py to create a server and it will have two URLs, one for accessing all users and one for accessing individual users:. Uploads are listed in the order they were started, with the oldest one first. pip install urllib2 pip install requests pip. Get all geolocation information about an IP address in JSON, JSONP and CSV format through our API. The data used in the demo contained only three observations, but the source of the data actually contained many more! Another way of parsing JSON is to use JsonReader, which I’ll leave for another post (see Parsing JSON with JsonReader). 21 Aug 2014. I already checked this official doc, it deals with webservices to get data from Odoo server. I want to use python urllib2 to simulate a login action, I use Fiddler to catch the packets and got that the login action is just an ajax request and the username and password is sent as json data, but I have no idea how to use urllib2 to send json data, help. It would look like:. Using normal JSON. org looks like an excellent candidate for inclusion in the whitelist. SQL Server is a robust and fully-featured database, and it performs very well. dumps([1, 2, 3]) f = urllib2. You can vote up the examples you like or vote down the ones you don't like. read()将不起作用。 在这种情况下,通过Doamin应提供协议 http 带有两个提交button和两个"目标"属性的HTML表单. Example: Create a report of all service requests. Making a POST request. This module allows us to make HTTP as well as HTTPS requests. io JSON API to get some financial data, but any JSON API should do. In order to make the integration process as easy and comfortable as possible, we provide various code examples showing how to access the RapidParser web service for different programming languages. loads にエディタで一斉置換しておく。 さて、json. Python utility classes (should work in either Python 2 or 3). urlopen(req) # 发送页面请求. I am studying mongoDB with python, I met this problem. You need to have json and urllib2 modules for this. Http POST requests can be made using the package urllib and urllib2. For bonus points, here's a bit of client-side code that will produce a request that has a body suitable for reading via request. dumps({"userName":"wenbin", "password":"passwd"}) try: req = urllib2. urlopen(url, data) response = f. Here is a simple. In the standard Python library, the sgmllib module contains an appropriate parser class called SGMLParser. The following are code examples for showing how to use urllib2. Now, since we are using JSON as our data format, we were able to take a nice shortcut here: the json argument to post. " Along with that, you are also introduced to the JSON module in Python. loads() as shown in the previous example. read() ,因此urllib2. How to Learn Anything Fast - Josh Kaufman - Duration: 23:20. 사이트의 dns 레코드는 파이썬이 dns 룩업을 특이한 방식으로 실패하는 것과 같습니다 : 엔트리를 찾았지만 연관된 ip 주소는 0입니다. Making a query is nearly the same as before. How To: How to extract data from a map service using Python Summary. It’s Thursday and I’ve never actually done one of those “Throw Back Thursday” things and if I understand right it’s typically about photos but since according to the Urban dictionary that has changed I decided why not do my own. HTTPError(). gevent For the Working Python Developer Written by the Gevent Community gevent is a concurrency library based around libev. This is going to be an introduction post of urllib2, where we are going to focus on Getting URLs, Requests, Posts, User Agents and Error handling. This function lets you encode form fields and files in multipart/form-data format for uploading files via HTTP POST. In my example, I will use the Twitter API. org/internal. nl The scripts uploads the gas usage as: today - 1 day. To help you get started with building your own integrations, we’ll include basic code samples in this area. urlopen('https://api. Suitable for both beginner and professional developers. json — JSON エンコーダおよびデコーダ — Python 3. 59> Minute of the hour after midnight when you post your usage to mindergas. Using an HTTP GET using Content-Type”: “application/json” we can retrieve values from our “control” table. Over the past 10 days, I've written about some APIs from corporations, and others from government agencies, but this one is smaller. Generating form data from python I wanted to understand how the html form was constructing the data to send to my flask server, so I attempted to send the form data directly from python. urlopen('https://api. The BLS site provided some assitance but I'm using the WebClient in VS2010 and can't find the equivilent to this part of their Apache HTTP Commons Client example:. I use the Fixer. It provides a more convenient and idiomatic way to write and manipulate queries. Corey Schafer 256,756 views. This is to make sure the operation is atomic. Use of the new introduced import way for flask extensions. It stays close to the Elasticsearch JSON DSL, mirroring its. I call the page using urllib2, like so:. In this post, we will learn how to import JSON to Excel. Maintenance Operations are operations exist on the authorized amount ONLY. Putting it all together and examples. The fact-checkers, whose work is more and more important for those who prefer facts over lies, police the line between fact and falsehood on a day-to-day basis, and do a great job. Today, my small contribution is to pass along a very good overview that reflects on one of Trump’s favorite overarching falsehoods. Namely: Trump describes an America in which everything was going down the tubes under  Obama, which is why we needed Trump to make America great again. And he claims that this project has come to fruition, with America setting records for prosperity under his leadership and guidance. “Obama bad; Trump good” is pretty much his analysis in all areas and measurement of U.S. activity, especially economically. Even if this were true, it would reflect poorly on Trump’s character, but it has the added problem of being false, a big lie made up of many small ones. Personally, I don’t assume that all economic measurements directly reflect the leadership of whoever occupies the Oval Office, nor am I smart enough to figure out what causes what in the economy. But the idea that presidents get the credit or the blame for the economy during their tenure is a political fact of life. Trump, in his adorable, immodest mendacity, not only claims credit for everything good that happens in the economy, but tells people, literally and specifically, that they have to vote for him even if they hate him, because without his guidance, their 401(k) accounts “will go down the tubes.” That would be offensive even if it were true, but it is utterly false. The stock market has been on a 10-year run of steady gains that began in 2009, the year Barack Obama was inaugurated. But why would anyone care about that? It’s only an unarguable, stubborn fact. Still, speaking of facts, there are so many measurements and indicators of how the economy is doing, that those not committed to an honest investigation can find evidence for whatever they want to believe. Trump and his most committed followers want to believe that everything was terrible under Barack Obama and great under Trump. That’s baloney. Anyone who believes that believes something false. And a series of charts and graphs published Monday in the Washington Post and explained by Economics Correspondent Heather Long provides the data that tells the tale. The details are complicated. Click through to the link above and you’ll learn much. But the overview is pretty simply this: The U.S. economy had a major meltdown in the last year of the George W. Bush presidency. Again, I’m not smart enough to know how much of this was Bush’s “fault.” But he had been in office for six years when the trouble started. So, if it’s ever reasonable to hold a president accountable for the performance of the economy, the timeline is bad for Bush. GDP growth went negative. Job growth fell sharply and then went negative. Median household income shrank. The Dow Jones Industrial Average dropped by more than 5,000 points! U.S. manufacturing output plunged, as did average home values, as did average hourly wages, as did measures of consumer confidence and most other indicators of economic health. (Backup for that is contained in the Post piece I linked to above.) Barack Obama inherited that mess of falling numbers, which continued during his first year in office, 2009, as he put in place policies designed to turn it around. By 2010, Obama’s second year, pretty much all of the negative numbers had turned positive. By the time Obama was up for reelection in 2012, all of them were headed in the right direction, which is certainly among the reasons voters gave him a second term by a solid (not landslide) margin. Basically, all of those good numbers continued throughout the second Obama term. The U.S. GDP, probably the single best measure of how the economy is doing, grew by 2.9 percent in 2015, which was Obama’s seventh year in office and was the best GDP growth number since before the crash of the late Bush years. GDP growth slowed to 1.6 percent in 2016, which may have been among the indicators that supported Trump’s campaign-year argument that everything was going to hell and only he could fix it. During the first year of Trump, GDP growth grew to 2.4 percent, which is decent but not great and anyway, a reasonable person would acknowledge that — to the degree that economic performance is to the credit or blame of the president — the performance in the first year of a new president is a mixture of the old and new policies. In Trump’s second year, 2018, the GDP grew 2.9 percent, equaling Obama’s best year, and so far in 2019, the growth rate has fallen to 2.1 percent, a mediocre number and a decline for which Trump presumably accepts no responsibility and blames either Nancy Pelosi, Ilhan Omar or, if he can swing it, Barack Obama. I suppose it’s natural for a president to want to take credit for everything good that happens on his (or someday her) watch, but not the blame for anything bad. Trump is more blatant about this than most. If we judge by his bad but remarkably steady approval ratings (today, according to the average maintained by 538.com, it’s 41.9 approval/ 53.7 disapproval) the pretty-good economy is not winning him new supporters, nor is his constant exaggeration of his accomplishments costing him many old ones). I already offered it above, but the full Washington Post workup of these numbers, and commentary/explanation by economics correspondent Heather Long, are here. On a related matter, if you care about what used to be called fiscal conservatism, which is the belief that federal debt and deficit matter, here’s a New York Times analysis, based on Congressional Budget Office data, suggesting that the annual budget deficit (that’s the amount the government borrows every year reflecting that amount by which federal spending exceeds revenues) which fell steadily during the Obama years, from a peak of $1.4 trillion at the beginning of the Obama administration, to $585 billion in 2016 (Obama’s last year in office), will be back up to $960 billion this fiscal year, and back over $1 trillion in 2020. (Here’s the New York Times piece detailing those numbers.) Trump is currently floating various tax cuts for the rich and the poor that will presumably worsen those projections, if passed. As the Times piece reported: