GithubHelp home page GithubHelp logo

kagurazakayashi / closeweathermap Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.03 MB

实现类似于 openweathermap 的接口和返回信息,但从一个 XLSX 电子表格文件中读取。

License: Other

Go 91.50% Batchfile 8.50%

closeweathermap's Introduction

icon

XLSWeather

实现类似于 openweathermap 的接口和返回信息,但从一个 XLSX 电子表格文件中读取。强制从 XLSX 电子表格文件中的时间视为相对日期的虚拟气象数据,XLSX 电子表格文件可以记录多天日期。

系统要求

  • Linux:glibc 2.17 或更高版本
  • macOS:10.14 Mojave 或更高版本
  • Windows:10 或更高版本

命令行参数

xlsweather -f <电子表格文件路径.xlsx> [配置参数]

  • 必要参数
    • -f: 电子表格文件路径。如果作为第一个参数提供,可不加 -f 。
  • 性能和刷新
    • -r: 每次 GET 访问接口时,都重新读取 XLSX 电子表格文件而不是从内存中读取。
  • 网络配置
    • -l: HTTP 接口所使用的 <IP>:<端口号> ,不提供 IP 则允许所有 IP。默认为 127.0.0.1:80
    • -u: HTTP 接口的 URI 。默认为 /data/2.5/weather
    • -a: 限制只有指定的几个 APPID 才能访问,使用英文逗号分隔。留空则不限制。
  • 时间锁定
    • -d: 基准日期 YYYYMMDD ,为空则为当前日期。
    • -t: 强制按指定时间提供数据,格式示例: "2006-01-02 15:04:05"
  • 时区
    • -tc: 强制客户端时区为指定的 IANA 时区名称,例如 Europe/Paris
    • -ts: 强制 XLSX 文件时区为指定的 IANA 时区名称,例如 Asia/Shanghai
    • -ct: 将 XLSX 文件中的时间视为本地时区并转换为客户端时区,否则直接视为客户端时区。
  • 数据修正
    • -rd: 反转风向数据。
  • 调试
    • -v: 显示详细信息用于调试。
  • 额外功能
    • -host: 启动时临时添加一条项目到 hosts 文件中,结束时删除。例如 "127.0.0.1 api.openweathermap.org" (需要管理员/root权限运行本程序)

命令行示例: xlsweather -f testdata.xlsx -ts Asia/Shanghai -v

Ctrl+C 可中止应用程序

GET 请求参数

  • lat: 纬度 (用于确定使用哪个时区的时间进行判断)
  • lon: 经度 (用于确定使用哪个时区的时间进行判断)
  • APPID: 32位 APPID
  • mode: 返回数据类型,目前只支持 xml
  • units: 度量单位,目前只支持 metric

示例: http://127.0.0.1/data/2.5/weather?lat=48.0061&lon=0.1996&APPID=GGEkzWHqaaua3pdyRjzp7RiwTkvEpimV&mode=xml&units=metric

XLSX 电子表格文件格式要求

参见 示例电子表格文件 testdata.xlsx

  • 电子表格文件中的天数部分,将会根据第一行和后续的时间重新进行计算。
  • 在程序启动时,会显示实际读入内存的数据集。

LICENSE

Copyright (c) 2024 KagurazakaYashi XLSWeather is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details.

closeweathermap's People

Contributors

kagurazakayashi avatar

Stargazers

 avatar 神楽坂紫 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.