Treasury IO: A daily data feed for the U.S. Treasury

Web Name: Treasury IO: A daily data feed for the U.S. Treasury

WebSite: http://treasury.io

ID:119855

Keywords:

daily,IO,Treasury,

Description:

*Note: All dollar values are in millions e.g. 1000 equals $1 billion. Different browsers have limits to how much data they can crunch into a csv. If you're querying a lot of data, selecting "View JSON" or using one of our libraries might be better. $ About ⚠️ Under renovation ⚠️ Hey there! We're in the process of porting this website over to Engima's instance of this database and revamping our query builder, if possible. In the meantime, you can access the data directly via their query interface here: https://public.enigma.com/browse/1ee6ce88-f5f8-4a2c-8190-445739beea31 The data Every day at 4pm, the United States Treasury publishes data tables summarizing the cash spending, deposits, and borrowing of the Federal government. These files catalog all the money taken in that day from taxes, the programs, and how much debt the government took out to make it happen. It comes from a section of the U.S. Treasury called the Bureau of the Fiscal Service At a time of record fiscal deficits and continual debates over spending, taxation, and the debt, this daily accounting of our government's main checking account is an essential data point that the public should have ready access to. Original data format The Treasury told us in response to a Freedom of Information Act Request that it does not store this data in any format other than inconsistently structured text files that don't lend themselves to programmatic analysis. New data format We have created the first-ever electronically-searchable database of the Federal government's daily cash spending and borrowing. It updates daily and the data can be exported in various formats and loaded into a variety of systems. It is also 100% open source and free to use. We started the project at the Columbia and Stanford Bi-Coastal Datafest Hackathon and continued the it with support from a Knight-Mozilla OpenNews Code Sprint Grant. We want to make it easy for people to search, explore, and visualize how the government spends their tax dollars. $ Documentation We created a fully-documented data dictionary that details the structure of these tables as well as descriptions of many programs and classifications. If you're the kind to prefer your data dictionaries in hard-copies, here's the full documentation as a PDF. We also have an FAQ or any other questions you might have. The data is complicated, however, and we recommend that you reach out to the Bureau of the Fiscal Service at the U.S. Treasury directly via that page or at DTS.Questions@fms.treas.gov. Note that the units of the data are in millions e.g. 1000 equals $1 billion. Always query responsibly. This API provides eight tables. You can access them with the short names in parentheses. Click "preview" to download the first ten rows of the table as CSV, and click "full" to download the full table as CSV. I. Operating Cash Balance t1 (preview, full) II. Deposits and Withdrawals t2 (preview, full) IIIa. Public Debt Transactions t3a (preview, full) IIIb. Adjustment of Public Dept Transactions to Cash Basis t3b (preview, full) IIIc. Debt Subject to Limit t3c (preview, full) IV. Federal Tax Deposits t4 (preview, full) V. Short-term Cash Investments t5 (preview, full) VI. Income Tax Refunds Issued t6 (preview, full) You can also download the full SQLite3 database, with all of the tables. It's about 50mb in total. To see the table schema and column types, you can use this query: http://api.treasury.io/cc7znvq/47d80ae900e04f2/sql/?q=SELECT "name","sql" FROM sqlite_master $ Usage The eight tables are stored in one SQLite database and the API. To get the data back as JSON, query it from a URL like this: http://api.treasury.io/cc7znvq/47d80ae900e04f2/sql/?q=YOUR_QUERY where YOUR_QUERY is a URL-encoded SQL command. This query will show the ten most recent withdrawals. http://api.treasury.io/cc7znvq/47d80ae900e04f2/sql/?q=SELECT * FROM t2 WHERE transaction_type = 'withdrawal' ORDER BY date DESC LIMIT 10 Note: We're submitting a plain-text query string because the browser is doing the URL-encoding here. The libraries we've written either do that for you or expect it a URL-encoded query, as shown in the examples. Host it yourself If you want to install the database locally, follow the instructions on the GitHub page Citation You can cite this data as "U.S. Treasury data via Treasury.io." Or, with links: a href="http://www.fms.treas.gov/index.html" target="_blank" U.S. Treasury data /a via a href="http://treasury.io/" target="_blank" Treasury.io /a . Alternatively, copy the query function from here. Send SQL, and get a pandas DataFrame. import treasuryiotreasuryio.query('SELECT * FROM sqlite_master') This package lives here. Alternatively, copy the treasuryio function from here. Send SQL, and get a data.frame. treasuryio('SELECT * FROM sqlite_master') This package lives here. JavaScript There isn't a separate library for JavaScript (if you want one, let us know), you can just call it through jQuery's $.ajax(). Include jQuery : script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" /script Create a function treasuryIo() that holds the API endpoint and accepts a query string. Pass it a query and get the JSON response. function treasuryIo(query){ return $.ajax({ url: 'http://api.treasury.io/cc7znvq/47d80ae900e04f2/sql/?q='+querytreasuryIo('SELECT * FROM t1 LIMIT 10') .done(function(response){ console.log(response); }).fail(function(err){ console.log(err) }); If you want a CSV response instead of JSON, you can include the dsv.js library, which is the CSV parser and formatter from d3.js. script src="js/thirdparty/dsv.min.js" /script Send SQL, and get a csv or json representation of the data, depending on what string you pass as the second argument. var treasuryio = require('treasuryio')treasuryio('SELECT * FROM t1 LIMIT 10', 'csv', function(err, response){ if (err) console.log(err) console.log(response);}); This module lives here.puts (treasuryio 'SELECT * FROM t1 LIMIT 10') This module lives here. Paste this function into the script editor. (Or wait a bit; we've submitted it to the script gallery.) function treasuryio(sql) { var response = UrlFetchApp.fetch("http://api.treasury.io/cc7znvq/47d80ae900e04f2/sql/?q=" + encodeURIComponent(sql)); var data = JSON.parse(response.getContentText()); if (data.length == 0){ return []; } else { // Unfortunately, this is ordered arbitrarily and is not guaranteed to be consistant. var keys = Object.keys(data[0]); return [keys].concat(data.map(function(row){return keys.map(function(key){return row[key]})}))} Then use it like so =treasuryio("SELECT * FROM t1 limit 10") Here's an example. $ The Robot The twitter account @TreasuryIO is a python Twitter bot we made that tweets out daily analyses of the data. It runs SQL queries on the database and then turns the results into tweetable messages. You can make your own bot by using our PyTreasuryIO package on GitHub, which includes instructions on how to make your own bot based on a SQL query of your choosing. The example bot calculates the total outstanding federal debt. Some sample tweets the bot makes: The distance to the debt ceiling. Notifications of income from taxes. How much the money spent on different programs like: Food Stamps Veterans Affairs Benefits Programs Medicare $ Contact For help with accessing the API or running it yourself, contact us via any of these means. Subscribe and post to the Google Group Submit an issue on GitHub Tweet at us, we're @Treasuryio. You should also contact us if you've done something cool with the API because we'd love to hear about it. Well [this] is literally bad ass as fuck. I didn't even know that data was publicly available! TanyIshsar

TAGS:daily IO Treasury 

<<< Thank you for your visit >>>

Treasury.io is the first-ever electronically-searchable database of the Federal government's daily cash spending and borrowing. It updates daily and the data can be exported in a variety of formats.

Websites to related :
Synthtopia Synthesizer and elec

  Avid today introduced Pro Tools | Carbon, a new audio interface that they say is designed to combine the power of the your computer s native CPU with

Knitting Patterns Blog from Swea

  Laguna Ribbed Scarfby SweaterBabeA ribbed scarf knit up in a precious yarn is an instant classic. This one steps it up a few notches by combining thre

- The Plant Lady

  How to Grow Have a vegetable, fruit, or berry that you would like to grow, or interested to know more about? Here s where you will find information th

Hobo Mama

  My 9-year-old learns art techniques origami by practicing them over and over and over. When I was new to the world of homeschooling, and pedagogy in

Hotel Jobs Gastronomie Jobs bei

  Copyright 2020 ROLLING PIN Media GmbH.Alle Rechte vorbehalten. Gastrojobs & Hotel Jobs. Die neueste ROLLING PIN AusgabeWie Goldgastronom und TV-Star T

Bonne Ménagère - Home

  Information wegen Corona-Virus (COVID-19) Wir sind telefonisch bis auf weiteres Montag bis Freitag von 9.00 bis 14.00 Uhr erreichbar. Und sonst per M

Jobs, Arbeit, Stellenangebo

  Sie haben es fast geschafft!Bitte fügen Sie die Tätigkeit, die Branche oder den Firmennamen ein, um Ihre Suche zu verbessern.

360万个编程源码资料 联合开发网 -

  [雷达系统]STFT Jocelin47 在 2020-11-18 08:53:35 上传 说明:雷达原始信号,通过设计的汉宁窗滤波器+STFT得到瞬时频率以及滤波后的呼吸心跳的波形图显示 开发平台:m

Custom Playing Cards Printing

  Premium card stocks are now cheaper for mass production. We have reduced the prices of all our linen card stock options as well as our premium smooth

Pokedex :: PokeDream

  PokeDream's Pokedex features comprehensive information on each Pokemon,pictures and sprites, and detailed data on moves, attacks, locations, stats, an

ads

Hot Websites