usdrate is a lightweight CLI tool that retrieves and caches USD/JPY mid rate exchange data from 77bank's website. It automatically fetches data for the current and past 7 years, stores the results in a package-local cache, and allows you to easily query the mid rate for any specific date.
Project description
usdrate
usdrateは、七十七銀行の為替情報サイトからUSD/JPYの仲値データを取得・キャッシュし、指定した日付の為替レートを簡単に問い合わせるためのCLIツールです。RSUの申告の際に過去にVestされた際の仲値を一々調べるのが辛くなって作りました。
動作概要
- キャッシュデータの確認をし、なかった場合は現在の西暦および過去7年分(合計8年分)の為替データを七十七銀行から取得します
- キャッシュデータはパッケージ内のキャッシュディレクトリに保存され、以降の実行で再利用されます
- 指定した日付のUSD/JPY仲値をコマンドラインから問い合わせができます
インストール
以下のコマンドでインストールできます:
pip install usdrate
使い方
基本的な使い方
指定した日付の為替仲値を取得するには、以下のようにコマンドを実行します:
usdrate 2024/08/27
The USD/JPY mid rate on 2024-08-27 is 144.86.
このコマンドは、2024年8月27日のUSD/JPY仲値を表示します。
キャッシュの強制更新
キャッシュを更新したい場合は、--updateまたは-uオプションを使用します:
usdrate 2024/01/01 --update
このコマンドは、キャッシュを更新し、指定した日付の為替仲値を取得します。
ライセンス
このプロジェクトはMITライセンスの下で公開されています。
作者
kon0n0 (kono@ms1.kononet.jp)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file usdrate-0.1.0.tar.gz.
File metadata
- Download URL: usdrate-0.1.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5817b62d31160f7d88d16249f8e89c75061359ff26e47b4f82963e34e32fc33
|
|
| MD5 |
40d998efcb8faa94921ee49f273d23ae
|
|
| BLAKE2b-256 |
0e3129001c11bcbf71132f60cc5f824b4fc16bf8d2872ec9861a45b00fac6f32
|
File details
Details for the file usdrate-0.1.0-py3-none-any.whl.
File metadata
- Download URL: usdrate-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
645034790389b94da0a89f01a2dbfb6e8b6c3d340d6d71b899ce8da770f4f342
|
|
| MD5 |
abe95d63260f240c7c3bc1ae420126bf
|
|
| BLAKE2b-256 |
b0fd4d84e8cb51c0ed56d0d22ebf3f3b2dd63dc3d452c06041259e2d3d735d3e
|