{"id":37073274,"url":"https://github.com/bobleer/bocfx","last_synced_at":"2026-01-14T08:36:05.114Z","repository":{"id":46879221,"uuid":"135992923","full_name":"bobleer/bocfx","owner":"bobleer","description":"中国银行外汇牌价爬虫 / API (Bank of China - Foreign Exchange - Spider/ API)","archived":false,"fork":false,"pushed_at":"2023-06-22T06:10:33.000Z","size":1249,"stargazers_count":98,"open_issues_count":4,"forks_count":20,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-03T23:19:56.241Z","etag":null,"topics":["api","bank","boc","china","exchange","foreign","fx","python","spider"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bobleer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-04T08:16:32.000Z","updated_at":"2025-11-21T03:50:13.000Z","dependencies_parsed_at":"2022-07-26T16:00:08.084Z","dependency_job_id":null,"html_url":"https://github.com/bobleer/bocfx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bobleer/bocfx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobleer%2Fbocfx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobleer%2Fbocfx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobleer%2Fbocfx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobleer%2Fbocfx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bobleer","download_url":"https://codeload.github.com/bobleer/bocfx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobleer%2Fbocfx/sbom","scorecard":{"id":246416,"data":{"date":"2025-08-11","repo":{"name":"github.com/bobleer/bocfx","commit":"700afe1ceeca14e4f9380aca7ee0fff2af6301d3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":0,"reason":"binaries present in source code","details":["Warn: binary detected: bocfx/__pycache__/__init__.cpython-310.pyc:1","Warn: binary detected: bocfx/__pycache__/__init__.cpython-37.pyc:1","Warn: binary detected: bocfx/__pycache__/__main__.cpython-310.pyc:1","Warn: binary detected: bocfx/__pycache__/__main__.cpython-37.pyc:1","Warn: binary detected: dist/bocfx-0.6.8-py3-none-any.whl:1","Warn: binary detected: dist/bocfx-0.6.9-py3-none-any.whl:1","Warn: binary detected: dist/bocfx-0.7.0-py3-none-any.whl:1","Warn: binary detected: dist/bocfx-0.7.1-py3-none-any.whl:1","Warn: binary detected: dist/bocfx-0.7.2-py3-none-any.whl:1","Warn: binary detected: dist/bocfx-0.7.3-py3-none-any.whl:1","Warn: binary detected: dist/bocfx-0.7.4-py3-none-any.whl:1","Warn: binary detected: dist/bocfx-0.7.5-py3-none-any.whl:1","Warn: binary detected: dist/bocfx-0.7.6-py3-none-any.whl:1","Warn: binary detected: dist/bocfx-0.7.7-py3-none-any.whl:1","Warn: binary detected: dist/bocfx-0.7.8-py3-none-any.whl:1","Warn: binary detected: dist/bocfx-0.7.9-py3-none-any.whl:1","Warn: binary detected: dist/bocfx-0.8.0-py3-none-any.whl:1","Warn: binary detected: dist/bocfx-0.8.1-py3-none-any.whl:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T07:42:01.753Z","repository_id":46879221,"created_at":"2025-08-17T07:42:01.753Z","updated_at":"2025-08-17T07:42:01.753Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:31:27.429Z","status":"ssl_error","status_checked_at":"2026-01-14T08:31:19.098Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","bank","boc","china","exchange","foreign","fx","python","spider"],"created_at":"2026-01-14T08:36:04.332Z","updated_at":"2026-01-14T08:36:05.048Z","avatar_url":"https://github.com/bobleer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bocfx ![](https://img.shields.io/badge/License-MIT-green.svg) ![](https://img.shields.io/badge/Python-3-3776ab.svg) ![](https://img.shields.io/badge/PyPI-0.8.1-ffd242.svg)\nAn easy-to-use python package for getting foreign exchange rate from Bank of China (BOC).  \n一个帮你快速获取中国银行外汇牌价的 Python 爬虫（也可作外汇牌价实时查询API)。  \nAuthor: [**Bob Lee**](https://boblee.cn)\n\n\u003cbr\u003e\n\n# Features\n# 特点\n\n* [x] **Multithreading 多线程**\n* [x] **As a command-line application 支持命令行应用模式**\n* [x] **As a python module 支持模块导入模式（import到你自己的项目里就能作API了）**\n* [x] **Foreign exchange selection 支持多种外汇币种同时输出（默认是英、欧、美、加、澳）**\n* [x] **Foreign exchange quotation filter 支持外汇牌价种类同时输出（买入、卖出、现钞、现汇、中行折算价）**\n* [x] **Date selection (Realtime/History) 支持仅输出最新牌价 或 输出指定时间段内全部牌价变动**\n* [x] **Line graph generation 支持生成历史波动曲线**\n* [x] **.csv generation 支持导出csv格式表格文件**\n* [x] **Set output path 支持导出到指定路径**\n* [x] **Show or close loading bar 支持显示或关闭进度条**\n* [x] **Export to database 支持导出到数据库（可使用Pandas的df.to_sql()）**\n\n\u003cbr\u003e\n\n# Contents\n# 目录\n\n- [Installation 安装](#installation)\n- [Basic Usage 基本用法](#basic-usage)\n\t- [As a command-line application 作为命令行程序使用](#as-command-line-application)\n\t- [As a python module 作为API使用](#as-python-module)\n- [Advanced Usage 进阶用法](#advanced-usage)\n\t- [As a command-line application 作为命令行程序使用](#as-command-line-application-1)\n\t\t- [Example](#example)\n\t- [As a python module 作为API使用](#as-python-module-1)\n\t\t- [Example](#example-1)\n- [Option and parameter 参数选择](#option-and-parameter)\n\t- [Option 1 `-f`/`--fx` 外汇种类](#option-1--f--fx)\n\t\t- [Common foreign currency:](#common-foreign-currency)\n\t\t- [Example](#example-2)\n\t- [Option 2 `-s`/`--sort` 牌价种类](#option-2--s--sort)\n\t\t- [Example](#example-3)\n\t- [Option 3 `-t`/`--time` 时间、时间段](#option-3--t--time)\n\t- [Option 4 `-p`/`--plot` 画图](#option-4--p--plot)\n\t- [Option 5 `-c`/`--csv` 导出csv表格](#option-5--c--csv)\n\t- [Option 6 `-o`/`--op` 导出文件路径设置](#option-6--o--op)\n\t- [Option 7 `-b`/`--bar` 开启进度条显示](#option-7--b--bar)\n- [Web API (temporary demo)](#web-api-temporary-demo)\n- [Limitation 局限性](#limitation)\n- [MIT Licence](#mit-licence)\n\u003cbr\u003e\n\n# Installation\n# 安装\n\nGenerally, one line command can perfect installation.\n```\npip3 install bocfx \n```  \nIf your `pip` links python3, please use `pip install bocfx` to install bocfx.   \n**REMEMBER**, Bocfx may not support python2.  \n\u003cbr\u003e\n\u003cbr\u003e\n\n# Basic Usage\n# 基本用法 (输出最新的牌价)\n\u003cbr\u003e\n\n## As a command-line application\n## 作为命令行工具使用\n\n```\n❯ bocfx\n\n\n+-----+--------+--------+--------+--------+----------+---------------------+\n|  5  | SE_BID | BN_BID | SE_ASK | BN_ASK | BOC_CONV |         Time        |\n+-----+--------+--------+--------+--------+----------+---------------------+\n| GBP | 873.01 | 845.88 | 879.44 | 883.32 |  874.54  | 2023-05-23 23:09:35 |\n| EUR | 757.61 | 734.07 | 763.19 | 765.65 |  760.31  | 2023-05-23 23:09:35 |\n| USD | 703.77 | 698.05 | 706.76 | 706.76 |  703.26  | 2023-05-23 23:09:35 |\n| CAD | 520.43 |  504   | 524.27 | 526.58 |  520.83  | 2023-05-23 23:09:35 |\n| AUD | 465.18 | 450.73 | 468.6  | 470.68 |  467.72  | 2023-05-23 23:09:35 |\n+-----+--------+--------+--------+--------+----------+---------------------+\n(SE = Spot Exchange, BN = Banknote)\n```\n\n```\n❯ bocfx -f USD                \n\n\n+-----+--------+--------+--------+--------+----------+---------------------+\n|  1  | SE_BID | BN_BID | SE_ASK | BN_ASK | BOC_CONV |         Time        |\n+-----+--------+--------+--------+--------+----------+---------------------+\n| USD | 703.77 | 698.05 | 706.76 | 706.76 |  703.26  | 2023-05-23 23:25:12 |\n+-----+--------+--------+--------+--------+----------+---------------------+\n(SE = Spot Exchange, BN = Banknote)\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## As a Python module\n## 作为 Python 模块导入使用\n\n```\n\u003e\u003e\u003e from bocfx import bocfx\n\n\u003e\u003e\u003e output = bocfx('GBP,USD','SE,ASK') # 选择了英镑和美元，现汇卖出价\n\u003e\u003e\u003e output # The latest foreign exchange rate | 英镑和美元，现汇卖出价 (最新的牌价)\n['879.22', '706.76'] \n```\n\u003cbr\u003e\n\u003cbr\u003e\n\n# Advanced Usage\n# 进阶用法\n\u003cbr\u003e\n\n## As a command-line application\n## 作为命令行工具使用时\n\n`-f` | 可选外汇 | FX selection\n`-s` | 可选牌价 | Quotation types selection\n`-t` | 可选时间 | Time / Period selection\n`-p` | 输出波动图 | Output plot\n`-c` | 输出csv | Output csv table\n`-o` | 指定输出路径 | Set output path\n\n```Bash\nbocfx [-f|--fx] [-s|--sort] [-t|--time] (-p|--plot) (-c|--csv) {-o|--op}\n```\n\u003cbr\u003e\n\u003cbr\u003e\n\n#### Example:\n\n```\n❯ bocfx -f GBP,USD,AUD -s ASK -t 30 -p -c -o '~/desktop/output'\n100%|█████████████████████████████████████████████| 3/3 [00:03\u003c00:00,  1.08s/it]\n100%|████████████████████████████████████████| 199/199 [00:00\u003c00:00, 422.62it/s]\n\n+-----+--------+--------+---------------------+\n|  3  | SE_ASK | BN_ASK |         Time        |\n+-----+--------+--------+---------------------+\n| GBP | 880.27 | 882.41 | 2019-02-24 10:30:00 |\n| USD | 673.08 | 673.08 | 2019-02-24 10:30:00 |\n| AUD | 480.65 | 481.82 | 2019-02-24 10:30:00 |\n| GBP | 880.27 | 882.41 | 2019-02-24 05:30:00 |\n| USD | 673.08 | 673.08 | 2019-02-24 05:30:00 |\n| AUD | 480.65 | 481.82 | 2019-02-24 05:30:00 |\n...\n| GBP | 889.64 | 891.8  | 2019-01-25 00:00:05 |\n| USD | 680.4  | 680.4  | 2019-01-25 00:00:05 |\n| AUD | 484.37 | 485.56 | 2019-01-25 00:00:05 |\n+-----+--------+--------+---------------------+\n(SE = Spot Exchange, BN = Banknote)\n\n.csv has already saved to /Users/bob/desktop/output/[GBP+USD+AUD]SE_ASK+BN_ASK_2019-01-25_2019-02-24.csv\n\nPlot has already saved to /Users/bob/desktop/output/[GBP+USD+AUD]SE_ASK+BN_ASK_2019-01-25_2019-02-24.png\n```\n![](https://github.com/bobleer/bocfx/raw/master/images/%5BGBP%2BUSD%2BAUD%5DSE_ASK%2BBN_ASK_2019-01-25_2019-02-24.png)\n\u003cbr\u003e\n\u003cbr\u003e\n\n## As a python module\n\n```python\nfrom bocfx import bocfx\n\nbocfx(FX=0, sort=0, time=-1, plot=0, csv=0, pt=0, op='~/bocfx_output')\n```\n\u003cbr\u003e\n\u003cbr\u003e\n\n#### Example:\n\n```\n\u003e\u003e\u003e from bocfx import bocfx\n\n# Equivalent command\n# example01 = bocfx(FX='GBP,USD', sort='SE', time=1)\n\n\u003e\u003e\u003e example01 = bocfx('GBP,USD','SE',1)\n100%|█████████████████████████████████████████████| 2/2 [00:01\u003c00:00,  1.49it/s]\n\n\u003e\u003e\u003e type(example01)\n\u003cclass 'list'\u003e\n\n\u003e\u003e\u003e print(example01)\n[[2, 'SE_BID', 'SE_ASK', 'Time'], ['USD', '669.74', '672.58', '2019-02-25 09:25:23'], ['GBP', '874.18', '880.62', '2019-02-25 09:25:13'], ... , ['GBP', '873.83', '880.27', '2019-02-24 00:00:05'], ['USD', '670.24', '673.08', '2019-02-24 00:00:05']]\n```\n\n\u003cbr\u003e\n\n```\n\u003e\u003e\u003e from bocfx import bocfx\n\n# Equivalent command\n# example02 = bocfx(FX='GBP,USD', sort='SE', time='2018-08-01,2018-08-02', plot=1, csv=1, pt=0, op='~/desktop/example/')\n\n\u003e\u003e\u003e example02 = bocfx('GBP,USD','SE','2018-08-01,2018-08-02',1,1,0,op='~/desktop/example/')\n100%|█████████████████████████████████████████████| 2/2 [00:02\u003c00:00,  1.05it/s]\n100%|██████████████████████████████████████████| 26/26 [00:00\u003c00:00, 134.46it/s]\n\n.csv has already saved to /Users/bob/desktop/example/[GBP+USD]SE_BID+SE_ASK_2018-08-01_2018-08-02.csv\n\nPlot has already saved to /Users/bob/desktop/example/[GBP+USD]SE_BID+SE_ASK_2018-08-01_2018-08-02.png\n\n\u003e\u003e\u003e type(example02)\n\u003cclass 'list'\u003e\n\n\u003e\u003e\u003e print(example02)\n[[2, 'SE_BID', 'SE_ASK', 'Time'], ['GBP', '888.85', '895.4', '2018-08-02 23:19:36'], ['USD', '683.01', '685.91', '2018-08-02 23:19:36'], ... , ['GBP', '891.33', '897.89', '2018-08-01 00:00:05'], ['USD', '680.22', '683.1', '2018-08-01 00:00:05']]\n```\n\n![](https://github.com/bobleer/bocfx/raw/master/images/%5BGBP%2BUSD%5DSE_BID%2BSE_ASK_2018-08-01_2018-08-02.png)\n\u003cbr\u003e\n\u003cbr\u003e\n\n# Option and parameter\n# 选项和参数\n\u003cbr\u003e\n\n## Option 1 `-f`/`--fx`\n## 外汇种类\n`-f`/`--fx` is the BOC foreign excahnge selector. This opinion supports **multi-parameter**.\n\n`,` is the separator of each parameter, e.g. `GBP,USD`\n\u003cbr\u003e\n\u003cbr\u003e\n\n#### Supported foreign currency:\n  \nFX | ISO Code | Full Name | Alias\n:-|:-|:-|:-\n`英镑` | `GBP` | Great Britain Pound | `UK` \n`港币` | `HKD` | Hong Kong Dollar | `HK` \n`美元` | `USD` | United States Dollar | `US`/`USA` \n`瑞士法郎` | `CHF` | Swiss Franc | \n`德国马克` | `DEM` | Deutsche Mark | \n`法国法郎` | `FRF` | French Franc | `FF` \n`新加坡元` | `SGD` | Singapore Dollar | \n`瑞典克朗` | `SEK` | Swedish Krona | \n`丹麦克朗` | `DKK` | Danish Krone | \n`挪威克朗` | `NOK` | Norwegian Krone | \n`日元` | `JPY` | Japanese Yen | `JP` \n`加拿大元` | `CAD` | Canadian Dollar | `CA` \n`澳大利亚元` | `AUD` | Australian Dollar | `AU` \n`欧元` | `EUR` | Euro | `EU` \n`澳门元` | `MOP` | Macao Pataca | `MO`\n`菲律宾比索` | `PHP` | Philippine Peso | \n`泰国铢` | `THB` | Thai Baht | \n`新西兰元` | `NZD` | New Zealand Dollar | `KIWI` \n`韩国元` | `WON` | South Korean Won | `SK` \n`卢布` | `RUB` | Russian Ruble | `RU` \n`林吉特` | `MYR` | Malaysia Ringgit | `SEN` \n`新台币` | `NTD` | New Taiwan Dollar | `TW` \n`西班牙比塞塔` | `ESP` | Spain Peseta | \n`意大利里拉` | `ITL` | Italian Lira | \n`荷兰盾` | `ANG` | Nederlandse Gulden | \n`比利时法郎` | `BEF` | Belgian Franc | \n`芬兰马克` | `FIM` | Finnish Mark | \n`印度卢比` | `INR` | Indian Rupee | \n`印尼卢比` | `IDR` | Indonesian Rupee | \n`巴西里亚尔` | `BRL` | Brasil Rial | \n`阿联酋迪拉姆` | `AED` | United Arab Emirates Dirham | \n`南非兰特` | `ZAF` | South African Rand | \n`沙特里亚尔` | `SAR` | Saudi Arabian Riyal | \n`土耳其里拉` | `TRY` | Yeni Türk Lirası | `YTL` \n  \nFX, ISO and Alias can be used as values of this option, e.g. `英镑`, `GBP`, `UK` are all correct.  \nThis parameter is case-insensitive, e.g. `GBP`, `gBp`, `UK`, `uk` will get same output.  \nIf not setting this parameter, the default value of parameter will be `GBP, EUR, USD, CAD, AUD`.  \n\u003cbr\u003e\n\u003cbr\u003e\n\n#### Example:\n\n```\n~\n❯ bocfx            \n100%|████████████████████████████████████████████| 5/5 [00:00\u003c00:00, 612.38it/s]\n\n+-----+--------+--------+--------+--------+---------------------+\n|  5  | SE_BID | BN_BID | SE_ASK | BN_ASK |         Time        |\n+-----+--------+--------+--------+--------+---------------------+\n| GBP | 874.37 | 847.2  | 880.81 | 882.95 | 2019-02-25 07:28:17 |\n| EUR | 759.05 | 735.47 | 764.65 | 766.35 | 2019-02-25 07:28:17 |\n| USD | 670.24 | 664.79 | 673.08 | 673.08 | 2019-02-25 07:28:17 |\n| CAD | 509.47 | 493.39 | 513.23 | 514.47 | 2019-02-25 07:28:17 |\n| AUD | 478.68 | 463.81 | 482.21 | 483.38 | 2019-02-25 07:28:17 |\n+-----+--------+--------+--------+--------+---------------------+\n(SE = Spot Exchange, BN = Banknote)\n\n~\n❯ bocfx -f GBP,USD                                             \n100%|███████████████████████████████████████████| 2/2 [00:00\u003c00:00, 1818.08it/s]\n\n+-----+--------+--------+--------+--------+---------------------+\n|  2  | SE_BID | BN_BID | SE_ASK | BN_ASK |         Time        |\n+-----+--------+--------+--------+--------+---------------------+\n| GBP | 874.37 | 847.2  | 880.81 | 882.95 | 2019-02-25 07:28:17 |\n| USD | 670.24 | 664.79 | 673.08 | 673.08 | 2019-02-25 07:28:17 |\n+-----+--------+--------+--------+--------+---------------------+\n(SE = Spot Exchange, BN = Banknote)\n```\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Option 2 `-s`/`--sort`\n## 牌价种类\n\n`-s`/`--sort` is the filter of quotation types. This opinion supports **multi-parameter**.\n\n`,` is the separator of each parameter.\n\n`-s`/`--sort` | `SE` Spot Exchange 现汇价 | `BN` Banknote 现钞价\n :-|:-|:-\n `BID` Bid Price 买入价 | `SE,BID` SE_BID | `BN,BID` BN_BID \n `ASK` Ask Price 卖出价 | `SE,ASK` SE_ASK | `BN,ASK` BN_ASK\n\nIf not using this option, the default output will include all four sorts.\n\u003cbr\u003e\n\u003cbr\u003e\n\n#### Example:\n\n```\n~\n❯ bocfx -f GBP,USD -s ASK                                  \n100%|████████████████████████████████████████████| 2/2 [00:00\u003c00:00, 443.63it/s]\n\n+-----+--------+--------+---------------------+\n|  2  | SE_ASK | BN_ASK |         Time        |\n+-----+--------+--------+---------------------+\n| GBP | 880.81 | 882.95 | 2019-02-25 07:28:17 |\n| USD | 673.08 | 673.08 | 2019-02-25 08:35:54 |\n+-----+--------+--------+---------------------+\n(SE = Spot Exchange, BN = Banknote)\n\n~\n❯ bocfx -f GBP,USD -s SE,BID\n100%|████████████████████████████████████████████| 2/2 [00:00\u003c00:00, 443.26it/s]\n\n+-----+--------+---------------------+\n|  2  | SE_BID |         Time        |\n+-----+--------+---------------------+\n| GBP | 874.57 | 2019-02-25 08:35:54 |\n| USD | 670.24 | 2019-02-25 08:35:54 |\n+-----+--------+---------------------+\n(SE = Spot Exchange, BN = Banknote)\n```\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Option 3 `-t`/`--time`\n## 时间范围选择\n\n`-t`/`--time` can filter the date of foreign exchange quotation.\n\nThere are 3 ways to write parameter.\n\n No. | Example | Definition | 定义\n :-|:-|:-|:-\n 1 | `6` | Get data from 6 days ago to today | 6 天之内的全部历史价格\n 2 | `2019-02-20` | Get data from 2019-02-20 to today | 选定时间到今天的全部历史价格\n 3 | `2019-02-20,2019-02-21` | Get data from 2019-02-20 to 2019-02-21 | 选定时间范围内全部历史价格\n \nIf not using this option, **only one price (the latest quotation price)** will be output.\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Option 4 `-p`/`--plot`\n## 是否生成折线图\n\nUsing `-p`/`--plot` can generate a line graph with .png format.\n\nThe default output path is `~/bocfx_output/`\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Option 5 `-c`/`--csv`\n## 是否生成csv表格\n\nUsing `-c`/`--csv` can output data in .csv format.\n\nThe default output path is `~/bocfx_output/`\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Option 6 `-o`/`--op`\n## 自定义输出路径\n\nUsing `-o`/`--op` can change default output path.\n\nExample: `-o '~/desktop/example/'`\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Option 7 `-b`/`--bar`\n## 开启进度条显示\n\nUsing `-b`/`--bar` can show loading bar while the tasks are running.\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n# Web API (temporary demo) (discarded now)\n\n***HTTP GET:*** http://sh.boblee.cn:8080/apis/bocfx?FX=GBP,USD\u0026sort=SE\u0026time=\u0026format=json\n\nParameter | Examples\n:-|:-\nFX= | ` (Blank = GBP,EUR,USD,CAD,AUD)`, `GBP`, `GBP,USD,AUD` \nsort= | ` (Blank = ALL four types)`, `SE`, `BN`, `ASK`, `BID`, `SE,ASK`, `SE,BID`, `BN,ASK`, `BN,BID`\ntime= | ` (Blank = The latest record)`, `1`, `2020-03-07`, `2020-03-07,2020-03-14`\nformat= | ` (Blank = json)`, `json`, `csv`, `original`\n  \nDescription of each parameter can be found .  \n每个参数的含义可参见上方的介绍.\n\n\u003cbr\u003e\n\n\n# Limitation\n# 局限性\n\nThis package is no-database design.   \n\nAll data are captured from http://srh.bankofchina.com/search/whpj/search.jsp in real time.  \n\n**Thus, the speed of spider will be strongly influenced by the connectation quality!**  \n**本脚本会受 中国银行官网接口速度 的影响！**\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n# MIT Licence\n\nCopyright (c) 2019 The Python Packaging Authority\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\u003cbr\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobleer%2Fbocfx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbobleer%2Fbocfx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobleer%2Fbocfx/lists"}