Skip to main content

気象庁(JMA)の天気データを取得・可視化・PDF化する教育向けツール

Project description

KishouScrapeDraw

KishouScrapeDraw は、気象庁(JMA)の気象データと天気図をもとに、グラフやPDFレポートを生成できる教育向けPythonパッケージです。

気象探究・理科の授業などでの活用を想定し、日本語対応・PDF出力・一括処理など、実用的な機能を備えています。


🚀 主な機能(4つ)

✅ 機能①:1日の気象要素の変化を取得・グラフ化

  • 指定した観測地点と日付の気温・気圧・湿度・降水量などを取得
  • 多軸グラフとして1枚の画像に描画
  • 観測地点は日本全国に対応(気象庁のデータ使用)
from drawgraph import DrawWeatherElements
DrawWeatherElements(year=2023, month=12, day=1, point="鳥取", classifyWeatherData=True)

出力例(保存先):WeatherGraph/graph_鳥取_20231201.png


✅ 機能②:天気図のダウンロード・分割・保存

  • 気象庁から天気図(実況図・日々の天気図)を自動取得
  • PDFまたはPNG形式に対応
  • 1日ごとに画像をトリミングして保存
from fetchweathermap import fetch_weather_map
fetch_weather_map(year=2023, month=12, day=1)

出力例(保存先):WeatherMap_2312/map_231201.png


✅ 機能③:気象グラフと天気図を統合したPDFレポートを作成

  • グラフと天気図を1ページにまとめたA4縦型のPDFを自動生成
  • 日本語フォント対応・QRコード付き
  • 教員や生徒の個人レポート用に最適
from createpdf import create_pdf
create_pdf(point="鳥取", year=2023, month=12, day=1)

出力例:OutputPDF/鳥取_20231201.pdf


✅ 機能④:複数人分のPDFを一括生成(CSV対応)

  • 生徒名簿CSV(組・番号/地点/日付)から複数PDFを自動出力
  • 各PDFに個別のファイル名を付けて保存
from createpdf import create_pdfs_from_csv
create_pdfs_from_csv("students.csv")

CSVファイル例:

組・番号,観測所,年,月,日
A1_田中,東京,2024,11,15
B2_鈴木,大阪,2024,11,16

出力例:OutputPDF/A1_田中_東京_20241115.pdf


📦 インストール方法

pip install KishouScrapeDraw

※ Python 3.8 以上推奨


🛠 システム前提条件(Linux / Google Colab)

天気図の画像変換や日本語PDF生成には、以下の外部ツールが必要です:

sudo apt-get update
sudo apt-get install -y poppler-utils ghostscript fonts-ipafont

📚 依存ライブラリ(pipで自動インストールされます)

  • matplotlib, japanize_matplotlib
  • pandas, numpy
  • fpdf, PyPDF2, pdf2image
  • requests
  • opencv-python-headless
  • qrcode[pil]

🧑‍🏫 開発者


📄 ライセンス

MIT License


🔗 GitHubリポジトリ

https://github.com/surugukishida/KishouScrapeDraw

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

kishouscrapedraw-0.1.0.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kishouscrapedraw-0.1.0-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file kishouscrapedraw-0.1.0.tar.gz.

File metadata

  • Download URL: kishouscrapedraw-0.1.0.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for kishouscrapedraw-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3cca28100f5200c8fec0e4ab4cd6101c0ddcfb45d55d1bbae3ffe77bc8aec541
MD5 bbf9e14a8c8aa2bc69c8259aaefbb3fa
BLAKE2b-256 65624eb2fad7c0ab4c948e95525f84096da0f63280b2bdbe4438c68c7255e940

See more details on using hashes here.

File details

Details for the file kishouscrapedraw-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for kishouscrapedraw-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb4c77c6b4ebbcc15d47c11fdd68c22450379af18a00b6655bbc93d308504a1f
MD5 aa585d6b95bc7adf48da5b4a4c05dddb
BLAKE2b-256 7eb9d83aa6871eaf49d34bc65d7e70ecfcb4e245b667d5503712e96a40868422

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page