| Name | szh_toolbox JSON |
| Version |
0.0.18
JSON |
| download |
| home_page | None |
| Summary | 我自己的工具箱 |
| upload_time | 2023-10-31 15:50:07 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.7 |
| license | None |
| keywords |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# 写在前面
我自己写的工具箱,没有api文档的,想看函数功能就直接看函数定义时的注释吧,还挺详细的
# python代码功能
```python
# 示例1,读取WRF变量计算天顶角
from szh_toolbox import get_zenith_angle
WRFfile = 'wrfout_d01_2021-07-22_04:00:00'
Longitude = getwrfvar(WRFfile, 'XLONG')
Latitude = getwrfvar(WRFfile, 'XLAT')
z2 = get_zenith_angle(123,0,35786,Longitude, Latitude)
```
```python
# 示例2,实现namelist文件和python对象的相互转化
import szh_toolbox.namelist as nl
# config是python字典对象
config = nl.load("data/namelist.input")
print(nl.dump(config))
```
```python
# 示例3,实现shell脚本中变量定义赋值的替换
from szh_toolbox import ShellScriptVariable
# 类功能展示
ssv = ShellScriptVariable('data/myshell.sh')
ssv.show()
ssv.update('a', '这是A', 0)
ssv.update('d', '"这是 D"')
ssv.show()
ssv.save('data/myshell2.sh')
# 一行代码替换变量
ShellScriptVariable.modify('data/myshell.sh', 'a', '这是A', 'data/myshell3.sh')
```
# 命令行工具
也就是可以直接在命令行里执行的代码
```bash
# 直接打印namelist.wps文件定义的区域的范围
st-wps
st-wps namelist.wps
```
```bash
# 下载noaa的数据比如ATMS L1
st-noaa -h
st-noaa orderId -o savepath
```
Raw data
{
"_id": null,
"home_page": null,
"name": "szh_toolbox",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "szh <suo.zh@qq.com>",
"download_url": "https://files.pythonhosted.org/packages/4a/01/eda227c28c7003eb9309125ae06589a54e5e0d0fc573bd57854a7b5b915b/szh_toolbox-0.0.18.tar.gz",
"platform": null,
"description": "# \u5199\u5728\u524d\u9762\n\u6211\u81ea\u5df1\u5199\u7684\u5de5\u5177\u7bb1\uff0c\u6ca1\u6709api\u6587\u6863\u7684\uff0c\u60f3\u770b\u51fd\u6570\u529f\u80fd\u5c31\u76f4\u63a5\u770b\u51fd\u6570\u5b9a\u4e49\u65f6\u7684\u6ce8\u91ca\u5427\uff0c\u8fd8\u633a\u8be6\u7ec6\u7684\n# python\u4ee3\u7801\u529f\u80fd\n```python\n# \u793a\u4f8b1\uff0c\u8bfb\u53d6WRF\u53d8\u91cf\u8ba1\u7b97\u5929\u9876\u89d2\nfrom szh_toolbox import get_zenith_angle\nWRFfile = 'wrfout_d01_2021-07-22_04:00:00'\nLongitude = getwrfvar(WRFfile, 'XLONG')\nLatitude = getwrfvar(WRFfile, 'XLAT')\nz2 = get_zenith_angle(123,0,35786,Longitude, Latitude)\n```\n```python\n# \u793a\u4f8b2\uff0c\u5b9e\u73b0namelist\u6587\u4ef6\u548cpython\u5bf9\u8c61\u7684\u76f8\u4e92\u8f6c\u5316\nimport szh_toolbox.namelist as nl\n# config\u662fpython\u5b57\u5178\u5bf9\u8c61\nconfig = nl.load(\"data/namelist.input\")\nprint(nl.dump(config))\n```\n```python\n# \u793a\u4f8b3\uff0c\u5b9e\u73b0shell\u811a\u672c\u4e2d\u53d8\u91cf\u5b9a\u4e49\u8d4b\u503c\u7684\u66ff\u6362\nfrom szh_toolbox import ShellScriptVariable\n# \u7c7b\u529f\u80fd\u5c55\u793a\nssv = ShellScriptVariable('data/myshell.sh')\nssv.show()\nssv.update('a', '\u8fd9\u662fA', 0)\nssv.update('d', '\"\u8fd9\u662f D\"')\nssv.show()\nssv.save('data/myshell2.sh')\n# \u4e00\u884c\u4ee3\u7801\u66ff\u6362\u53d8\u91cf\nShellScriptVariable.modify('data/myshell.sh', 'a', '\u8fd9\u662fA', 'data/myshell3.sh')\n```\n# \u547d\u4ee4\u884c\u5de5\u5177\n\u4e5f\u5c31\u662f\u53ef\u4ee5\u76f4\u63a5\u5728\u547d\u4ee4\u884c\u91cc\u6267\u884c\u7684\u4ee3\u7801\n```bash\n# \u76f4\u63a5\u6253\u5370namelist.wps\u6587\u4ef6\u5b9a\u4e49\u7684\u533a\u57df\u7684\u8303\u56f4\nst-wps\nst-wps namelist.wps\n```\n```bash\n# \u4e0b\u8f7dnoaa\u7684\u6570\u636e\u6bd4\u5982ATMS L1\nst-noaa -h\nst-noaa orderId -o savepath\n```",
"bugtrack_url": null,
"license": null,
"summary": "\u6211\u81ea\u5df1\u7684\u5de5\u5177\u7bb1",
"version": "0.0.18",
"project_urls": {
"Bug Tracker": "https://github.com/pypa/sampleproject/issues",
"Homepage": "https://github.com/pypa/sampleproject"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e384386860542a9dafed82e9508651db3fb6930674918399c82f392009084287",
"md5": "8e69a2a548aad2a361b133f7a7ac12d2",
"sha256": "1aa702f5702cc2e9fd314d5af4622cd6a8c4fc7a92199569b084c1c27a0019aa"
},
"downloads": -1,
"filename": "szh_toolbox-0.0.18-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8e69a2a548aad2a361b133f7a7ac12d2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 17231,
"upload_time": "2023-10-31T15:50:04",
"upload_time_iso_8601": "2023-10-31T15:50:04.106471Z",
"url": "https://files.pythonhosted.org/packages/e3/84/386860542a9dafed82e9508651db3fb6930674918399c82f392009084287/szh_toolbox-0.0.18-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4a01eda227c28c7003eb9309125ae06589a54e5e0d0fc573bd57854a7b5b915b",
"md5": "cc82174d56843242129e8aa1461f642d",
"sha256": "0eae9265e66cef15d8c062e62eb56d783b4f530b22f73df8548ff9f9e66a3ec1"
},
"downloads": -1,
"filename": "szh_toolbox-0.0.18.tar.gz",
"has_sig": false,
"md5_digest": "cc82174d56843242129e8aa1461f642d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 14503,
"upload_time": "2023-10-31T15:50:07",
"upload_time_iso_8601": "2023-10-31T15:50:07.992928Z",
"url": "https://files.pythonhosted.org/packages/4a/01/eda227c28c7003eb9309125ae06589a54e5e0d0fc573bd57854a7b5b915b/szh_toolbox-0.0.18.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-31 15:50:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pypa",
"github_project": "sampleproject",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "szh_toolbox"
}