You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
この記事はPython その2 Advent Calendar 2018の遅れてきた15日目の記事です。 最近、クローリング用のプログラムのasyncioを使った並行処理のプログラミングをしており、「asyncioのベストプラクティス」という趣旨の記事を書こうと思っていたのですが、自分自身感覚を掴めておらず、「あれ?これってasyncioのAPI自体も微妙なのでは?」「そもそもasyncioのドキュメントのドキュメントを読んでも、どの機能をどう組み合わせて使えばいいか分からない」と思ってしまっていて記事を書きかねていました。 ただ、知人から「trioというライブラリのAPI設計が素晴らしい」と薦めて頂いたのと、あまりにも待たせてしまうのも申し訳ないのでひとまず「調べてみた」レベルでアウトプットを出します。 私はまだ並列/並行/非同期処理に詳しいわけではないので、大きな思い違いをしている可能
And we’re back! As we mentioned in the first part of our blog post series, Instagram Server is a Python monolith with several million lines of code and a few thousand Django endpoints. This post is about how we use types to document and enforce a contract for our Python HTTP APIs. In the next few weeks, we’ll share details on more tools and techniques we’ve developed to manage our codebase’s quali
Posted on May 17, 2018 | 6 minutes | Fotis Gimian This post attempts to highlight my thought process in selecting a suitable stack for developing an API in Python for our current project at work. Although I have personally benchmarked various combinations, I haven’t documented the results for this article, instead merely mentioned which frameworks and WSGI servers were found to be fast or slow.
from urlparse import urlparse import urllib def toGSBL(str_url, character_code) scheme, netloc, path, params, query, fragments = urlparse(unicode(str_url, character_code, 'ignore')) netloc = netloc.encode('idna') path = urllib.quote_plus(path.encode('utf-8'), '') if len(path) > 0 else '/' query = urllib.quote_plus(query.encode('utf-8'), '') if len(query) > 0 else '' return scheme + '://' + netloc
Google Safe Browsing APIは特定のURLやバイナリが安全か否かをチェックするAPI。さっと調べるときに便利なようにJupyterから使えるようにしてみた。 普通のURLを入れると何も値が出てこないので「安全でないURL」を探したのと、ヒアドキュメントにURLを埋め込むあたりに苦労の跡が。 import pycurl, io, json url = 'http://malware.testing.google.test/testing/malware/' api_key = 'your_api_key' data = ''' {{ "client": {{ "clientId": "your_client_name", "clientVersion": "0.1" }}, "threatInfo": {{ "threatTypes": ["THREAT_TYPE_UNS
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く