オープンデータとプログラミング

毎日の API ラウンド: Google クラウド コンテナー ビルダー、Knoema、団結、ウーヤラ、カッコウのサンド ボックス|Daily API RoundUp: Google Cloud Container Builder, Knoema, Unity, Ooyala, Cuckoo Sandbox

オープンデータ関連のニュースです。

http://www.programmableweb.com/news/daily-api-roundup-google-cloud-container-builder-knoema-unity-ooyala-cuckoo-sandbox/brief/2016/12/13

日本語

TranslateApiException: Cannot find an active Azure Market Place Translator Subscription associated with the request credentials. : ID=1146.V2_Json.Translate.1C81305D
続きを読む…

English

Every day, the ProgrammableWeb team is busy, updating its three primary directories for APIs, clients (language-specific libraries or SDKs for consuming or providing APIs), and source code samples. If you have new APIs, clients, or source code examples to add to ProgrammableWeb’s directories, we offer forms (APIs, Clients, Source Code) for submitting them to our API research team. If there’s a listing in one of our directories that you’d like to claim as the owner, please contact us at editor@programmableweb.com. Twenty Three APIs have been added to the ProgrammableWeb directory in categories such as Open Data, Bitcoin, Chat, and Enterprise. Highlights today include two APIs for working with Unity game development platform. Here’s a rundown of the latest additions.
Read more…

賛成!スマートシティ プロジェクト リスのスコットランドでの離れて $31 m|Aye! Smart city projects squirrel away $31m in Scotland

オープンデータ関連のニュースです。

http://readwrite.com/2016/12/13/scottish-cities-raise-31m-collaborate-smart-city-projects-cl4/

日本語

TranslateApiException: Cannot find an active Azure Market Place Translator Subscription associated with the request credentials. : ID=1250.V2_Json.Translate.1C3C477C
続きを読む…

English

Scotland’s seven major cities are teaming up to develop a number of smart city projects, backed by a $31 million war chest. According to Scottish Construction Now, the seven cities will springboard off the funding to collaboratively develop themselves into future-capable digital hubs. See also: Outdated thinking on wireless could doom UK smart cities The smart cities program is under the mantle of the Scottish Cities Alliance, which includes Aberdeen, Dundee, Edinburgh, Glasgow, Inverness, Perth and Stirling along with the Scottish government. European Regional Development Funding will contribute $13 million to smart cities initiatives, with another $18 million chipped in by the seven cities.
Read more…

トランプ ホワイト家に入る前に気候データを保存する科学者ラッシュ|Scientists Rush to Save Climate Data Before Trump Enters White House

オープンデータ関連のニュースです。

http://www.complex.com/life/2016/12/scientists-copy-u-s-climate-data-before-donald-trump-presidency

日本語

気候変動否定論者をされている次期大統領ドナルド ・ トランプ、結果として科学者は気候変動に関する政府データ保存変更イベント トランプの管理は、事実を否定することを継続する努力でデータを消去しように動いています。 少しトランプ就任 1 月 20 日前に情報をアーカイブする 1 ヶ月以上、ワシントン ポスト報告科学者保管のための独立したサーバー上の連邦政府の気候変動データを保存します。それらの努力は、オープン データ フィラデルフィアのグループおよびソフトウェア会社データ セットを保存する方法を見つけるための Azavea 人と会ったがフィラデルフィアのペンシルバニア大学の研究者から仕事を含んでください。
続きを読む…

English

As a result of President-elect Donald Trump being a climate change denier, scientists are moving to save federal government data about climate change in the event Trump’s administration attempt to erase data in an effort to continue denying facts. Having a little over a month to archive information before Trump takes office Jan. 20, The Washington Post reported scientists are saving federal climate change data on independent servers for safekeeping. Those efforts include work from researchers at the University of Pennsylvania in Philadelphia who have met with people from the Open Data Philly group and software company Azavea to find a way to save data sets.
Read more…

スマート都市交通データを ‘ 得る、当局に語った|’Get smart on urban transport data’, authorities told

オープンデータ関連のニュースです。

http://www.digitalbydefaultnews.co.uk/2016/12/12/get-smart-on-urban-transport-data-authorities-told/

日本語

TranslateApiException: Cannot find an active Azure Market Place Translator Subscription associated with the request credentials. : ID=1250.V2_Json.Translate.1BA5FF35
続きを読む…

English

A newly published report from the Urban Transport Group has found that transport authorities and UK legislation must keep pace with the vast volumes of data generated as people travel in order to provide better customer service and plan services more efficiently. The report, which follows an event held by Urban Transport Group in partnership with the Future Cities Catapult in May 2016, outlines the opportunities that come from data. It recommends that data will mean transport users will become far more fully informed about their travel choices whilst at the same time it will transform the ability of transport authorities to plan and manage transport networks and services more efficiently and effectively.
Read more…

上院は政府のオープン データの歴史的な裏書を通過します。|Senate passes historic endorsement of open government data

オープンデータ関連のニュースです。

https://sunlightfoundation.com/2016/12/12/senate-passes-historic-endorsement-of-open-government-data/

日本語

TranslateApiException: Cannot find an active Azure Market Place Translator Subscription associated with the request credentials. : ID=1250.V2_Json.Translate.1BA5F06A
続きを読む…

English

Amidst unanswered questions about the future of open government in the United States, the Senate has provided a unanimous endorsement of a set of enduring principles that the Sunlight Foundation has advanced and defended for a decade: that data created using the funds of the people should be available to the people in open formats online, without cost or restriction. On Dec. 10, 2016, S.2852, the Open, Public, Electronic, and Necessary (OPEN) Government Data Act, passed the Senate with an amendment by unanimous consent. The OPEN Government Data Act has been a core priority of the Sunlight Foundation in Washington in 2016. We are thrilled that the Senate has acted to move it and grateful to the bill’s co-sponsors for their support for open government.
Read more…

米国がヘルスケア データ駆動型の司法制度を融合する方法|How the US melds data-driven justice system with healthcare

オープンデータ関連のニュースです。

http://www.enterpriseinnovation.net/article/how-us-melds-data-driven-justice-system-healthcare-2011441622

日本語

統合失調症から人の苦しみは、隣人の家に侵入逮捕された、警察刑務所に彼を置く必要がありますか、彼らに移すべき彼適切なケアのための医療専門家に? 米国チーフ データ科学者 DJ パティルと言われて理想的な危機介入で訓練を受けた役員精神的な病気の症状を認識できる必要があります市民ケビン早期の場合と同様に適切な対応を取ることができるはず。 統合失調症に苦しんで、彼は精神病のエピソードを持っていた、家に押し入ったし、裸浴室に彼自身を置きます。しかし、呼び出しに応答した法の執行者は刑務所に彼を入れていません。彼らは適切な対応を取ることができた、彼に彼が必要なケアを与えた。 「なぜこれが重要な?」と彼は尋ねた。」ので今年だけで、11。
続きを読む…

English

If a person suffering from schizophrenia was caught breaking into a neighbor’s house, should the police put him in jail or should they turn him over to healthcare specialists for proper care? US Chief Data Scientist DJ Patil said that ideally officers trained in crisis intervention should be able to recognize the symptoms of mental illness and should be able to take the appropriate response as they did in the case of citizen Kevin Early. Suffering from schizophrenia, he said he had a psychotic episode, broke into a house and put himself in the bathroom naked. But the law enforcers who responded to the call didn’t put him in jail. They were able to take the appropriate response and gave him the care he needed. “Why is this important?” he asked. “Because this year alone, 11.
Read more…

オープン データハブのアップグレード – 水曜日 14/12 9:00-11:00|Open Data Hub upgrade – Wednesday 14/12 09:00-11:00

オープンデータ関連のニュースです。

http://opendata.transport.nsw.gov.au/forum/t/open-data-hub-upgrade-wednesday-14-12-09-00-11-00/490/1

日本語

我々 は明日のオープン データ ハブのメンテナンスを受けるが (12/14) 9:00 と 11:00 の間。この時間の間に開いたデータ ハブ (https://opendata.transport.nsw.gov.au) は使用できません。ただし、開発者ポータル (https://developer.transport.nsw.gov.au) は影響を受けません、使用することができます。 場合は、このスレッドに投稿してください質問がある場合。
続きを読む…

English

We will be undergoing scheduled maintenance of the Open Data Hub tomorrow (14/12) between 09:00 and 11:00. During this time the Open Data Hub (https://opendata.transport.nsw.gov.au) will be unavailable. However, the Developer Portal (https://developer.transport.nsw.gov.au) will be unaffected and can be used. If you have any questions please post them in this thread.
Read more…

上院は満場一致で広範な データを開く 命令、開かれた政府データ法を通過します。|Senate Unanimously Passes Broad Open Data Mandate, OPEN Government Data Act

オープンデータ関連のニュースです。

http://www.datacoalition.org/press-releases/senate-unanimously-passes-broad-open-data-mandate-open-government-data-act-now-the-115th-congress-must-take-action/

日本語

ワシントン dc-早朝オープン、公共、電子および必要な (オープン) 政府データ行為 (S.2852)、法案を 1 月に再導入時に衆参両院で渡すことができます簡単に着信 115 議会に強力な信号を送信する上院は満場一致で承認しました。オープン データ自治法は、一般、機械可読データ形式を使用して自分の情報をオンラインで公開するすべての連邦政府機関を必要があります。 上院のアクションこの朝はオープン データ連邦政府情報の既定の目標をさらに支援します。
続きを読む…

English

Washington, D.C. – Early this morning the Senate approved by unanimous consent the Open, Public, Electronic and Necessary (OPEN) Government Data Act (S.2852), sending a strong signal to the incoming 115th Congress that the bill can quickly be passed by both chambers upon re-introduction in January. The OPEN Government Data Act would require all federal agencies to publish their information online, using nonproprietary, machine-readable data formats. The Senate’s action this morning helps further the goal of making open data the default for federal information.
Read more…

pythonでXMLをパースするときに出る2つのエラーの解決方法

python

pythonでXMLをパースしようとしたときに出くわすエラー2つについて修正方法をメモしておきます。

エラー1
IOError: [Errno 2] No such file or directory: u'<?xml version=”1.0″ encoding=”UTF-8″?> …

エラー2
root = tree.getroot()
AttributeError: ‘Element’ object has no attribute ‘getroot’…

次のソースはよくネットにサンプルとしてよく見かけるコードですが、5行目のところでエラー1がでます。

import xml.etree.ElementTree as ET

req = …(省略) #postした結果XMLが返却されるとする

tree = ET.parse(req.text)  #エラー1
root = tree.getroot() 

#hogehogeを検索
ret=root.find(".//hogehoge").text

req.textにはXMLが入っていますが、これがファイル名だと思われてしまうからですね。
そのため、No such file or directoryと怒られるわけです。
なのでエラーメッセージには、u'<?xml version=”1.0″ encoding=”UTF-8″?> …のようにXMLの内容が表示されています。
parseには、ファイルのパスを渡す必要があります。

IOError: [Errno 2] No such file or directory: u'<?xml version=”1.0″ encoding=”UTF-8″?> …

XMLの文字列をパースする場合には、以下のようにfromstringを使用します。

import xml.etree.ElementTree as ET

req = …(省略) #postした結果XMLが返却されるとする

tree = ET.fromstring(req.text.encode('utf-8'))  #エラー1が解消します
root = tree.getroot()                           #今度はここでエラー2

#hogehogeを検索
ret=root.find(".//hogehoge").text

5行目のエラーが解消されてメデタシメデタシなのですが、今度は6行目でエラーになります。

root = tree.getroot()
AttributeError: ‘Element’ object has no attribute ‘getroot’…

今度は、getrootがないと怒られます。
こちらは次のように修正します。

import xml.etree.ElementTree as ET

req = …(省略) #postした結果XMLが返却されるとする

root = ET.fromstring(req.text.encode('utf-8'))

#hogehogeを検索
ret=root.find(".//hogehoge").text

以上でおしまいです。

カナダ政府は、開かれた政府のグローバル ・ リーダーシップ|Government of Canada shows global leadership on open government

オープンデータ関連のニュースです。

http://sports.yahoo.com/news/government-canada-shows-global-leadership-193508517.html

日本語

TranslateApiException: Cannot find an active Azure Market Place Translator Subscription associated with the request credentials. : ID=0642.V2_Json.Translate.1A397154
続きを読む…

English

OTTAWA, ONTARIO–(Marketwired – Dec 9, 2016) – Government data is an important resource that can drive innovation, inform businesses, and enhance government accountability. The Honourable Scott Brison, President of the Treasury Board, is in Paris, France, today leading Canada’s delegation at the Open Government Partnership Global Summit, where he announced that Canada is taking a leadership role in the global movement to improve transparency and open government. The Minister announced that Canada will adopt the International Open Data Charter. This is a key commitment in Canada’s 3rd Biennial Plan to the Open Government Partnership, and it will support strategic partnerships with governments and civil society organizations in Canada and around the world.
Read more…