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
概要 bottlenoseについて インストール方法 ItemLookupで商品情報をxml形式で取得する サンプルコード 実行結果(item要素のみ抜粋) xmlをパースする サンプルコード 実行結果 最後に お薦め書籍 概要 Product Advertising APIについては、Product Advertising APIから。 基本的に上記の通りのルールでプログラムを書けばいいのだが、面倒臭い。 APIのラッパー的なものが既に作られているのであればそちらを使ったほうが早い。 プログラムもPerl,Python,Ruby,PHPなどいろいろあるが、好きなものを選べば良いと思う。 Pythonのライブラリではbottlenoseが使い易そうだったので使ってみた。 ちなみに、AWSAccessKeyId、AWSSecretKey、AssosiateIdなどの取得の方法は、省略する。。
MOONGIFTはオープンソース・ソフトウェアを紹介するブログです。2021年07月16日で更新停止しました Web APIがどれだけ広まろうともスクレイピングの需要はなかなかなくなりません。特にWebサイトがシステム化されるのに合わせて、画面構成が一定のテンプレートに沿って出力されるようになったので、より定型で情報が取得できるようになっています。 今回紹介するPortiaはスクレイピングの基本である取得場所の設定をビジュアル的に行えるソフトウェアです。 Portiaの使い方 PortiaはScrapingHubというWebサービスの中で一機能として提供されています。 こちらがメイン画面です。蜘蛛がモチーフです。 任意のWebサイトを表示します。 そして欲しい情報があるDOMを選択します。 重なって取得もできます。例えばタイトルとリンクといった具合です。 右側に設定が一覧表示されます。 テ
Simply point Daphne to your ASGI application, and optionally set a bind address and port (defaults to localhost, port 8000): daphne -b 0.0.0.0 -p 8001 django_project.asgi:application If you intend to run daphne behind a proxy server you can use UNIX sockets to communicate between the two: daphne -u /tmp/daphne.sock django_project.asgi:application If daphne is being run inside a process manager, yo
Today, we're thrilled to host Jacob Kaplan-Moss. Jacob's a former Herokai and long-time core contributor to Django, and he's here to share an in-depth look at something that he believes will define the future of the framework. Django Channels allows Python developers to build real-time, asynchronous web apps with Python and JavaScript. It augments Django’s robust response-request architecture with
ASGI ASGI, or the Asynchronous Server Gateway Interface, is the specification which Channels and Daphne are built upon, designed to untie Channels apps from a specific application server and provide a common way to write application and middleware code. It’s a spiritual successor to WSGI, designed not only run in an asynchronous fashion via asyncio, but also supporting multiple protocols. The ful
FunkLoadはPythonで作られたWebアプリケーション向けの負荷試験ツールです。 レポートがわかりやすいので、負荷試験の際によく利用してます。 便利ではあるのですが、いくつか使いづらい点があったので、funkload-friendlyというラッパーモジュールを作りました。 GitHub - tokibito/funkload-friendly: Friendly wrapper of FunkLoad. Python 2.7のみ対応です(FunkLoadがPython3に未対応) FunkLoadとの違い 大雑把ですが以下、funkload-friendlyで便利にしたところです。 リクエスト間でCookieが保持される(セッションやCSRF対策されたフォームの扱いなどが簡単) REST API(JSON)の扱いが簡単 結果ファイルの出力先にディレクトリを指定できる なるべくFun
I'm sure by now you know that I have released a book and a couple of videos on Flask in cooperation with O'Reilly Media. While the coverage of the Flask framework in these is fairly complete, there are a small number of features that for one reason or another did not get mentioned much, so I thought it would be a good idea to write articles about them here. This article is dedicated to streaming,
from datetime import datetime def logging(func): def wrapper(obj, *args, **kwds): print("{} {} {} {} args={} kwds={}".format( datetime.now().strftime("%Y-%m-%d %H:%M:%S"), "INFO", func.__qualname__, "START", args, kwds)) rtn = func(obj, *args, **kwds) print("{} {} {} {} return {}".format( datetime.now().strftime("%Y-%m-%d %H:%M:%S"), "INFO", func.__qualname__, "END", rtn)) return rtn return wrappe
>>> $ py.test ../tests/test_webapi.py =============================================================================== test session starts =============================================================================== platform darwin -- Python 2.7.5 -- py-1.4.31 -- pytest-2.7.0 rootdir: /Users/*****, inifile: pytest.ini plugins: cache, django, pep8, pythonpath collected 2 items ../tests/test_webap
Exception: Traceback (most recent call last): File "/Library/Python/2.7/site-packages/pip-8.1.0-py2.7.egg/pip/basecommand.py", line 209, in main status = self.run(options, args) File "/Library/Python/2.7/site-packages/pip-8.1.0-py2.7.egg/pip/commands/install.py", line 317, in run prefix=options.prefix_path, File "/Library/Python/2.7/site-packages/pip-8.1.0-py2.7.egg/pip/req/req_set.py", line 732,
先日からVim本体のパッケージ機能を使い、プラグインマネージャは使わない生活をしています。 とはいえプラグインのアップデートやヘルプの生成は手作業では面倒なので、そのあたりを処理してくれるPythonのスクリプトを書きました。 始めはdotfileをgit管理(今まではhgで管理してbitbucketに置いてました)にしてプラグインをsubmoduleにすれば十分かと思ったのですが、やってみたら意外と面倒でした。 Pythonで書いたのは、自分の場合VimがあるところならまずPythonもあるというのと、3.4で入ったpathlibというパスをいい感じに扱えるライブラリを使ってみたかったからです。 この記事を書きながらログ周りやオプションを整備してリファクタリングもしましたが、あくまで自分用に書いたスクリプトなので機能は最低限です。 gitにしか対応していませんが、パッケージ機能を試したい
最近は協力プレイやPvPなどの「リアルタイムサーバー」を書くときは Go が主流になっているのですが、 Tornado を使ったシステムも健在です。 (以前の記事) 数人〜十数人程度の「部屋」を、1つの Tornado プロセスに複数もたせ、さらに一台のサーバーにその Tornado プロセスを複数置くことでCPUのマルチコアを活用する構成になっているのですが、最近各プロセスがログファイルを書く部分でブロックして応答性能が悪化するケースがあったので対策しました。 この記事ではその対策で行ったチューニングや、行わなかったチューニングについても紹介します。 ※なお、この記事は Tornado を題材にしていますが、似たような仕組みになっている node.js などの他の言語のフレームワークでも同じ事が言えるはずです。 前提知識 Tornado は epoll や select などのIO多重化
背景 VimでのPython開発環境構築 これまでPythonのプログラム開発は PyCharm で行ってきましたが,Vimに乗り換えようと試行錯誤しているところです.開発環境を整備していくなかで,PEP8を遵守するようにコードを自動で修正するプラグイン hachibeeDI/vim-operator-autopep8 がPython3でうまく動作しないことが分かりました.初心者なもので,自分の設定が間違っている可能性もあります.ただ,せっかくなので,GitHubの練習も兼ねて,はじめてのVimプラグインを作成してみることにしました. [参考URL] GitHub のフォーク (fork) とプルリクエスト (pull request) の使い方 Windows 10にGVimベースのPython開発環境を構築する(1)インストール偏 Python 3で動かないわけ hachibeeDI/
Per-task fork or synchronous worker By default, TaskTiger forks a subprocess for each task, This comes with several benefits: Memory leaks caused by tasks are avoided since the subprocess is terminated when the task is finished. A hard time limit can be set for each task, after which the task is killed if it hasn't completed. To ensure performance, any necessary Python modules can be preloaded in
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く