csvkit のドキュメント: https://csvkit.readthedocs.io
Python プログラムを動かすために, Windows では「python」, Ubuntu では「python3」などのコマンドを使う.
あるいは, 開発環境や Python コンソール(Jupyter Qt Console,Spyder,PyCharm,PyScripter など)の利用も便利である.
あるいは,オンラインで動くGoogle Colaboratory のノートブックの利用も,場合によっては便利である.
Google Colaboratory のノートブックを使うか, 自分のパソコンで Python を動かすなどがありえる.
Google Colaboratory のノートブックを新規作成を行う.
https://colab.research.google.com
Google Colab はオンラインの Python 開発環境. 使用するには Google アカウントが必要
システム Python を使うことができる(システム Python を使う場合,Python のインストールは行わない)
システム Python を用いるときは,pip, setuptools の更新は次のコマンドで行う.
sudo apt -y update sudo apt -y install python3-pip python3-setuptools
Ubuntu で,システム Python 以外の Python をインストールしたい場合は pyenv が便利である: 別ページで説明している.
Python の URL: http://www.python.org/
【Python, pip の使い方】
Python, pip は,次のコマンドで起動できる.
【Python 開発環境のインストール】
JupyterLab, spyder, nteract (Python 開発環境) のインストールは, Windows でコマンドプロンプトを管理者として実行し, 次のコマンドを実行.
python -m pip install -U pip setuptools jupyterlab jupyter jupyter-console jupytext nteract_on_jupyter spyder
詳しくは,: 別ページで説明している.
JupyterLab, spyder, nteract (Python 開発環境) のインストール: : 別ページで説明している.
コマンドプロンプトを管理者として実行し,次のコマンドを実行.
python -m pip install -U pip setuptools pandas openpyxl csvkit python -m pip install -e git+https://github.com/wireservice/agate-excel.git#egg=agate-excel python -m pip install -U agate-dbf agate-sql six olefile
端末で,次のコマンドを実行
sudo apt -y update sudo apt -y install csvkit python3-pandas python3-csvkit
ここでは,csvkit に同封されているデータファイルである ne_1033_data.xlsxを, 次の URL からダウンロードして使用. https://github.com/wireservice/csvkit/tree/master/examples/realdata
in2csv ne_1033_data.xlsx > ne_1033_data.csv
ここでは,次のURLから ks_1033_data.csvをダウンロードして使用. https://github.com/wireservice/csvkit/tree/master/examples/realdata
csvjson ks_1033_data.csv > ks_1033_data.json
ここでは,次のURLから ks_1033_data.csvをダウンロードして使用. https://github.com/wireservice/csvkit/tree/master/examples/realdata
csvsql ks_1033_data.csv > ks_1033_data.sql
csvsql ks_1033_data.csv > ks_1033_data.sql csvsql --query "select * from ks_1033_data;" --insert ks_1033_data.csv > ks_1033_data.sql