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
Skip to the content. Home jc JC - JSON Convert kellyjonbrazil@gmail.com This package converts the output of many standard unix command line tools and file-types to dictionaries and lists of dictionaries. Interactive Documentation Using jc in your python programs: >>> help('jc') >>> help('jc.lib') >>> jc.get_help('parser_module_name') Developing jc parsers: >>> help('jc.utils') >>> help('jc.streami
Did you know that some Python modules can double-up as handy command-line tools? For example, you can run Python's webbrowser module from the command-line to open up a given URL in your default web browser: The Python standard library includes many such module-script hybrids. Below is a complete list of every module in Python that can be run as a command-line script. Feel free to jump right to the
Command Line mitmproxy is your swiss-army knife for debugging, testing, privacy measurements, and penetration testing. It can be used to intercept, inspect, modify and replay web traffic such as HTTP/1, HTTP/2, HTTP/3, WebSockets, or any other SSL/TLS-protected protocols. You can prettify and decode a variety of message types ranging from HTML to Protobuf, intercept specific messages on-the-fly, m
Tip See the navigation links in the header or side-bar. Click (top left) on mobile. Welcome¶ Welcome to the Textual framework documentation. Get started or go straight to the Tutorial What is Textual?¶ Textual is a Rapid Application Development framework for Python, built by Textualize.io. Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal or a web browser!
Introduction jcは、標準的なUnixコマンドの出力を受け取って その出力をJSONにパースするという、python製ツールです。 (コマンドラインまたはpythonのモジュールとして使用可能) 例えば、Unixコマンド結果を少し加工したり一部の出力だけほしいときには ちょっとしたスクリプトを書いたりします。 そんなとき、Unixコマンドの出力形式がJSON形式で扱えれば スクリプトを書く手間が多少は省けます。 今回はUnixコマンド出力結果をJSON形式に変換するツールの jcを紹介します。 Setup インストールはMacならHomebrewで可能です。 % brew install jc pipでも可能。 %pip3 install jc その他、各種パッケージマネージャでインストールできるので、 こちらを参照してください。 Try jc jcは標準入力からパイプを使って
It seems as though more and more of the simple command-line tools and small scripts that used to be bash or small c programs are slowly turning into python programs. Of course, we will just have to wait and see if this ultimately turns out to be a good idea. But in the meantime, next time you’re revamping or writing a new tool, why not spice it up with Rich? Rich is a python library written by [Wi
Rich Terminal python Rich has become a popular (20K stars on GH) way of beautifying CLIs, and I'm pleased to see a number of projects using it. Since Rich is mature and battle-tested now, I had considered winding-down development. Until, I saw this tweet: The Tweet Do you want to see something […] Rich has become a popular (20K stars on GH) way of beautifying CLIs, and I'm pleased to see a number
Rich インストール 使い方 Rich github.com Richを使うとターミナル上でカラー、スタイル付け、テーブル表示、シンタックスハイライト、Markdown表示などのリッチなテキスト表現ができる。 インストール pipでインストールできる。 $ pip install rich 使い方 下記コマンドを実行するとどのような出力ができるか確認できる。 $ python -m rich loggingやprogressなどは以下のようにすることで確認できる。 $ python -m rich.logging $ python -m rich.progress 一番簡単な使い方はrich printメソッドをimportしてBuilt-inのprintのように使う方法。 from rich import print print("Hello, [bold magenta]World[
こんにちは、どんな作業もターミナルで行うことが多めの平野です。 最近はパイプに流すようなCLIアプリもPythonで作ることが多いので、 そこで必要になったいくつかの要素をまとめてみます。 パイプライン処理として実装しよう BrokenPipeの表示を消す argparseによる引数とオプションのパース この辺を考慮すれば、あとは文字列変換の主要なロジックだけを実装すればOKかと思います。 パイプライン処理として実装しよう パイプライン処理とだけ言うと色々な意味がありそうですが、ここで言っている意味は データの先頭行の処理の結果は最終行が入力される前でも取り出せるようにしよう ということです。 パイプ (コンピュータ)#シェルからの使用 - Wikipedia 複数行のテキストが入力されてきた時に、 それぞれの行の文字数をカウントするアプリケーションを作ったとします。 この時、以下のような
Pythonをコマンドラインで使いたいのでopyというコマンドを作った Sun Sep 8 16:22:46 JST 2019 (modified: Mon Sep 9 18:33:27 JST 2019) views: 16707, keywords:opy, Python, ワンライナー, シェル芸 この記事は最終更新日が6年以上前のものです。 一つ前の記事をもうちょい真面目に書きました。 この記事の要旨 Pythonをコマンドラインで直接使うのは面倒。Pythonワンライナーは地獄。 解決のために opy というコマンドを作って公開 使い方はREADMEにあります なかなかいいので使ってみてください opyを変な呼び方しないでください!やるなよ!絶対やるなよ!! 経緯 Rubyにrbというワンライナー用のコマンド(Rubyのラッパー)があるという話を聞いたので、Pythonでも作って
- はじめに - 本記事はpython prompt toolkit(以下 ptk)の動作を理解するメモです。 ptkで出来ること、その概要を書いています。 - はじめに - - ptkとは - ptkで作成されたツール - ptkの描画を理解する - print_formatted_text Application Screenオブジェクトのレンダリング KeybindingとFilter 関連 おわりに - ptkとは - ptkは、Pythonで実装されているCLI用のツールキットである。 コンソール上でのフルスクリーンアプリケーションの作成 dialogs、progress-barの生成 シェルのようなインタラクティブな入出力 補完 clipboardの管理 出力テキスト色の変更 シンタックスハイライト EmacsとViのキーバインディング マウスカーソルによる操作 各種非同期処理
はじめに 先日のS3フォルダの削除に引き続き、S3フォルダをコピーしてみます。先日の削除と同様にコピー対象のオブジェクトのリストが取得した後、個々のオブジェクトをコピーするプロブラムを書く必要がありました。これも毎回関数を作成するのは面倒なので、いざというときに備えて作成しましたのでご紹介します。 検証用データ 以下のような階層のデータを事前に作成しました。 $ aws s3 ls s3://s3-copy-folder/ --recursive 2018-06-29 20:24:28 0 source-folder/ 2018-06-29 21:08:40 0 source-folder/source-sub-folder/ 2018-06-29 21:09:28 0 source-folder/source-sub-folder/test-sub.txt 2018-06-29 20:2
・・・みたいな事象が発生し、速やかに機器の状態を確認したい、といった状況がしばしば起こります。 こういった場合、(まだアクセスが可能なうちに)機器にログインし、 速やかにshow系のコマンドを叩き情報の確保を行うというオペレーションが必要になります。 その際のコマンドはある程度定型化されていると言えます。 (下記は特定の機器・OSに依らず、こういったコマンドが挙げられるよね、というリストです) ・・・など。 たとえばCisco IOSなど、ネットワークの機器・OSに対しては上記のようなコマンドを入力することで設定情報や状態の確認を行うことができます。 特に障害発生時のような緊急度が高い状況においては、 調査に時間を割くために定型的な作業についてはなるべく人の手を使わずに行いたいところではあります。 この記事では、上記のようなコマンドの結果を速やかに取得するため、 自動で機器にログインし、コ
Welcome to the second Click tutorial on how to improve your command-line tools and Python scripts. I’ll show you some more advanced features that help you when things are getting a bit more complex and feature rich in you scripts. You might wonder why I suggest using Click over argparse or optparse. I don’t think they are bad tools, they both have their place and being part of the standard library
以前にhttpie でリクエストヘッダも表示するというメモを書きました。 改めて、HTTPie のインストール方法 / 基本的な使い方をメモしておきます。 インストール Debian / Ubuntu にインストールする 標準リポジトリから apt-get でインストール可能です。 apt-get -y install httpie RHEL / CentOS にインストールする 標準リポジトリにはパッケージが無い為、EPEL からインストールします。 yum -y install epel-release yum -y install python2-httpie pip でインストールする pip でインストールするのも簡単です。 以下は pip 自体からインストールする場合の手順です。 yum -y install gcc python-devel curl -L https://b
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く