birdrecord-cli 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 yoshino-s
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,102 @@
1
+ Metadata-Version: 2.4
2
+ Name: birdrecord-cli
3
+ Version: 0.1.0
4
+ Summary: CLI for China Bird Record (birdreport.cn); default API host weixin.birdrecord.cn (single-file main.py + uv).
5
+ Author: yoshino-s
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/yoshino-s/birdrecord-cli
8
+ Project-URL: Repository, https://github.com/yoshino-s/birdrecord-cli
9
+ Project-URL: Documentation, https://github.com/yoshino-s/birdrecord-cli#readme
10
+ Project-URL: Issues, https://github.com/yoshino-s/birdrecord-cli/issues
11
+ Project-URL: Changelog, https://github.com/yoshino-s/birdrecord-cli/releases
12
+ Project-URL: PyPI, https://pypi.org/project/birdrecord-cli/
13
+ Keywords: birdrecord,birding,cli,weixin,miniprogram,httpx,click
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Internet :: WWW/HTTP
21
+ Requires-Python: >=3.12
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: click>=8.1.0
25
+ Requires-Dist: httpx>=0.28.1
26
+ Requires-Dist: pycryptodome>=3.21.0
27
+ Requires-Dist: pydantic>=2.10.0
28
+ Requires-Dist: pypinyin>=0.53.0
29
+ Dynamic: license-file
30
+
31
+ # Birdrecord CLI
32
+
33
+ CLI for the [Birdrecord](https://www.birdreport.cn/) / China Bird Record mini-program API. HTTP defaults to API host `https://weixin.birdrecord.cn` (override with `--base-url`); the [portal site](https://www.birdreport.cn/) is separate.
34
+
35
+ **Species taxonomy**: Checklist entries, names, and `taxonid` values match the app and follow **Zheng 4**—the 4th edition of *A Checklist of the Birds of China* (中国鸟类分类与分布名录·第四版, “郑四”).
36
+
37
+ ## Install from PyPI
38
+
39
+ Requires **Python 3.12+**.
40
+
41
+ ```bash
42
+ pip install birdrecord-cli
43
+ # or: uv tool install birdrecord-cli
44
+ birdrecord-cli --help
45
+ ```
46
+
47
+ Package index: [pypi.org/project/birdrecord-cli](https://pypi.org/project/birdrecord-cli/).
48
+
49
+ ## Run with uvx (no prior install)
50
+
51
+ [uv](https://docs.astral.sh/uv/) downloads the package into an ephemeral environment. Pin the version for reproducible behavior:
52
+
53
+ ```bash
54
+ uvx --from 'birdrecord-cli==0.1.0' birdrecord-cli --help
55
+ uvx --from 'birdrecord-cli==0.1.0' birdrecord-cli provinces --pretty
56
+ ```
57
+
58
+ Use the latest release version from PyPI if it differs from the example above.
59
+
60
+ ## Single-file + uv (no install)
61
+
62
+ [PEP 723](https://peps.python.org/pep-0723/) script; [uv](https://docs.astral.sh/uv/) installs deps automatically.
63
+
64
+ ```bash
65
+ curl -fsSL -o main.py 'https://raw.githubusercontent.com/yoshino-s/birdrecord-cli/main/main.py'
66
+ uv run main.py --help
67
+ ```
68
+
69
+ For a fork, change `yoshino-s` and/or `main` in the URL.
70
+
71
+ ## Usage
72
+
73
+ Shared flags: `--token`, `--base-url`, `--no-verify`, `--timeout`, `--pretty`, `--envelope`. Subcommands: `provinces`, `cities`, `taxon`, `report`, `search`; most support `--schema`. `search` accepts optional `--taxon` / `--report` for activity drill-down; stdout JSON shapes are described in [docs/CLI.md](docs/CLI.md) under **`search` output (JSON)**. Full copied `--help` text: [docs/CLI.md](docs/CLI.md).
74
+
75
+ ```bash
76
+ birdrecord-cli provinces --pretty
77
+ birdrecord-cli report --id 1948816 --pretty
78
+ birdrecord-cli search --body-json '{"startTime":"2026-02-24","endTime":"2026-03-24","province":"河北省","taxonid":4148,"version":"CH4"}' --pretty
79
+ ```
80
+
81
+ (With `uv run main.py`, use the same subcommands after `uv run main.py`.)
82
+
83
+ Environment variables:
84
+
85
+ - `BIRDRECORD_CACHE_DIR`: optional taxon cache root (`…/taxon`); if unset, `$XDG_CACHE_HOME/birdrecord/taxon` when `XDG_CACHE_HOME` is set, else `~/.cache/birdrecord/taxon`.
86
+ - `BIRDRECORD_CLI_CN`: any truthy value (not `0` / `false` / `no` / `off`) uses Chinese JSON Schema descriptions (e.g. `--schema`).
87
+
88
+ ## Demo
89
+
90
+ ![birdrecord-cli demo](docs/birdrecord-demo.gif)
91
+
92
+ ## Development
93
+
94
+ Clone, then `uv sync --group dev && uv run pytest tests/ -v` (some tests hit the live API; some use `verify=False`). Tests import via [`birdrecord_client.py`](./birdrecord_client.py).
95
+
96
+ ## License
97
+
98
+ MIT — see [LICENSE](LICENSE).
99
+
100
+ ---
101
+
102
+ **中文说明**:[README.zh-CN.md](./README.zh-CN.md)
@@ -0,0 +1,72 @@
1
+ # Birdrecord CLI
2
+
3
+ CLI for the [Birdrecord](https://www.birdreport.cn/) / China Bird Record mini-program API. HTTP defaults to API host `https://weixin.birdrecord.cn` (override with `--base-url`); the [portal site](https://www.birdreport.cn/) is separate.
4
+
5
+ **Species taxonomy**: Checklist entries, names, and `taxonid` values match the app and follow **Zheng 4**—the 4th edition of *A Checklist of the Birds of China* (中国鸟类分类与分布名录·第四版, “郑四”).
6
+
7
+ ## Install from PyPI
8
+
9
+ Requires **Python 3.12+**.
10
+
11
+ ```bash
12
+ pip install birdrecord-cli
13
+ # or: uv tool install birdrecord-cli
14
+ birdrecord-cli --help
15
+ ```
16
+
17
+ Package index: [pypi.org/project/birdrecord-cli](https://pypi.org/project/birdrecord-cli/).
18
+
19
+ ## Run with uvx (no prior install)
20
+
21
+ [uv](https://docs.astral.sh/uv/) downloads the package into an ephemeral environment. Pin the version for reproducible behavior:
22
+
23
+ ```bash
24
+ uvx --from 'birdrecord-cli==0.1.0' birdrecord-cli --help
25
+ uvx --from 'birdrecord-cli==0.1.0' birdrecord-cli provinces --pretty
26
+ ```
27
+
28
+ Use the latest release version from PyPI if it differs from the example above.
29
+
30
+ ## Single-file + uv (no install)
31
+
32
+ [PEP 723](https://peps.python.org/pep-0723/) script; [uv](https://docs.astral.sh/uv/) installs deps automatically.
33
+
34
+ ```bash
35
+ curl -fsSL -o main.py 'https://raw.githubusercontent.com/yoshino-s/birdrecord-cli/main/main.py'
36
+ uv run main.py --help
37
+ ```
38
+
39
+ For a fork, change `yoshino-s` and/or `main` in the URL.
40
+
41
+ ## Usage
42
+
43
+ Shared flags: `--token`, `--base-url`, `--no-verify`, `--timeout`, `--pretty`, `--envelope`. Subcommands: `provinces`, `cities`, `taxon`, `report`, `search`; most support `--schema`. `search` accepts optional `--taxon` / `--report` for activity drill-down; stdout JSON shapes are described in [docs/CLI.md](docs/CLI.md) under **`search` output (JSON)**. Full copied `--help` text: [docs/CLI.md](docs/CLI.md).
44
+
45
+ ```bash
46
+ birdrecord-cli provinces --pretty
47
+ birdrecord-cli report --id 1948816 --pretty
48
+ birdrecord-cli search --body-json '{"startTime":"2026-02-24","endTime":"2026-03-24","province":"河北省","taxonid":4148,"version":"CH4"}' --pretty
49
+ ```
50
+
51
+ (With `uv run main.py`, use the same subcommands after `uv run main.py`.)
52
+
53
+ Environment variables:
54
+
55
+ - `BIRDRECORD_CACHE_DIR`: optional taxon cache root (`…/taxon`); if unset, `$XDG_CACHE_HOME/birdrecord/taxon` when `XDG_CACHE_HOME` is set, else `~/.cache/birdrecord/taxon`.
56
+ - `BIRDRECORD_CLI_CN`: any truthy value (not `0` / `false` / `no` / `off`) uses Chinese JSON Schema descriptions (e.g. `--schema`).
57
+
58
+ ## Demo
59
+
60
+ ![birdrecord-cli demo](docs/birdrecord-demo.gif)
61
+
62
+ ## Development
63
+
64
+ Clone, then `uv sync --group dev && uv run pytest tests/ -v` (some tests hit the live API; some use `verify=False`). Tests import via [`birdrecord_client.py`](./birdrecord_client.py).
65
+
66
+ ## License
67
+
68
+ MIT — see [LICENSE](LICENSE).
69
+
70
+ ---
71
+
72
+ **中文说明**:[README.zh-CN.md](./README.zh-CN.md)
@@ -0,0 +1,102 @@
1
+ Metadata-Version: 2.4
2
+ Name: birdrecord-cli
3
+ Version: 0.1.0
4
+ Summary: CLI for China Bird Record (birdreport.cn); default API host weixin.birdrecord.cn (single-file main.py + uv).
5
+ Author: yoshino-s
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/yoshino-s/birdrecord-cli
8
+ Project-URL: Repository, https://github.com/yoshino-s/birdrecord-cli
9
+ Project-URL: Documentation, https://github.com/yoshino-s/birdrecord-cli#readme
10
+ Project-URL: Issues, https://github.com/yoshino-s/birdrecord-cli/issues
11
+ Project-URL: Changelog, https://github.com/yoshino-s/birdrecord-cli/releases
12
+ Project-URL: PyPI, https://pypi.org/project/birdrecord-cli/
13
+ Keywords: birdrecord,birding,cli,weixin,miniprogram,httpx,click
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Internet :: WWW/HTTP
21
+ Requires-Python: >=3.12
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: click>=8.1.0
25
+ Requires-Dist: httpx>=0.28.1
26
+ Requires-Dist: pycryptodome>=3.21.0
27
+ Requires-Dist: pydantic>=2.10.0
28
+ Requires-Dist: pypinyin>=0.53.0
29
+ Dynamic: license-file
30
+
31
+ # Birdrecord CLI
32
+
33
+ CLI for the [Birdrecord](https://www.birdreport.cn/) / China Bird Record mini-program API. HTTP defaults to API host `https://weixin.birdrecord.cn` (override with `--base-url`); the [portal site](https://www.birdreport.cn/) is separate.
34
+
35
+ **Species taxonomy**: Checklist entries, names, and `taxonid` values match the app and follow **Zheng 4**—the 4th edition of *A Checklist of the Birds of China* (中国鸟类分类与分布名录·第四版, “郑四”).
36
+
37
+ ## Install from PyPI
38
+
39
+ Requires **Python 3.12+**.
40
+
41
+ ```bash
42
+ pip install birdrecord-cli
43
+ # or: uv tool install birdrecord-cli
44
+ birdrecord-cli --help
45
+ ```
46
+
47
+ Package index: [pypi.org/project/birdrecord-cli](https://pypi.org/project/birdrecord-cli/).
48
+
49
+ ## Run with uvx (no prior install)
50
+
51
+ [uv](https://docs.astral.sh/uv/) downloads the package into an ephemeral environment. Pin the version for reproducible behavior:
52
+
53
+ ```bash
54
+ uvx --from 'birdrecord-cli==0.1.0' birdrecord-cli --help
55
+ uvx --from 'birdrecord-cli==0.1.0' birdrecord-cli provinces --pretty
56
+ ```
57
+
58
+ Use the latest release version from PyPI if it differs from the example above.
59
+
60
+ ## Single-file + uv (no install)
61
+
62
+ [PEP 723](https://peps.python.org/pep-0723/) script; [uv](https://docs.astral.sh/uv/) installs deps automatically.
63
+
64
+ ```bash
65
+ curl -fsSL -o main.py 'https://raw.githubusercontent.com/yoshino-s/birdrecord-cli/main/main.py'
66
+ uv run main.py --help
67
+ ```
68
+
69
+ For a fork, change `yoshino-s` and/or `main` in the URL.
70
+
71
+ ## Usage
72
+
73
+ Shared flags: `--token`, `--base-url`, `--no-verify`, `--timeout`, `--pretty`, `--envelope`. Subcommands: `provinces`, `cities`, `taxon`, `report`, `search`; most support `--schema`. `search` accepts optional `--taxon` / `--report` for activity drill-down; stdout JSON shapes are described in [docs/CLI.md](docs/CLI.md) under **`search` output (JSON)**. Full copied `--help` text: [docs/CLI.md](docs/CLI.md).
74
+
75
+ ```bash
76
+ birdrecord-cli provinces --pretty
77
+ birdrecord-cli report --id 1948816 --pretty
78
+ birdrecord-cli search --body-json '{"startTime":"2026-02-24","endTime":"2026-03-24","province":"河北省","taxonid":4148,"version":"CH4"}' --pretty
79
+ ```
80
+
81
+ (With `uv run main.py`, use the same subcommands after `uv run main.py`.)
82
+
83
+ Environment variables:
84
+
85
+ - `BIRDRECORD_CACHE_DIR`: optional taxon cache root (`…/taxon`); if unset, `$XDG_CACHE_HOME/birdrecord/taxon` when `XDG_CACHE_HOME` is set, else `~/.cache/birdrecord/taxon`.
86
+ - `BIRDRECORD_CLI_CN`: any truthy value (not `0` / `false` / `no` / `off`) uses Chinese JSON Schema descriptions (e.g. `--schema`).
87
+
88
+ ## Demo
89
+
90
+ ![birdrecord-cli demo](docs/birdrecord-demo.gif)
91
+
92
+ ## Development
93
+
94
+ Clone, then `uv sync --group dev && uv run pytest tests/ -v` (some tests hit the live API; some use `verify=False`). Tests import via [`birdrecord_client.py`](./birdrecord_client.py).
95
+
96
+ ## License
97
+
98
+ MIT — see [LICENSE](LICENSE).
99
+
100
+ ---
101
+
102
+ **中文说明**:[README.zh-CN.md](./README.zh-CN.md)
@@ -0,0 +1,12 @@
1
+ LICENSE
2
+ README.md
3
+ birdrecord_client.py
4
+ main.py
5
+ pyproject.toml
6
+ birdrecord_cli.egg-info/PKG-INFO
7
+ birdrecord_cli.egg-info/SOURCES.txt
8
+ birdrecord_cli.egg-info/dependency_links.txt
9
+ birdrecord_cli.egg-info/entry_points.txt
10
+ birdrecord_cli.egg-info/requires.txt
11
+ birdrecord_cli.egg-info/top_level.txt
12
+ tests/test_birdrecord_client.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ birdrecord-cli = main:main
@@ -0,0 +1,5 @@
1
+ click>=8.1.0
2
+ httpx>=0.28.1
3
+ pycryptodome>=3.21.0
4
+ pydantic>=2.10.0
5
+ pypinyin>=0.53.0
@@ -0,0 +1,2 @@
1
+ birdrecord_client
2
+ main
@@ -0,0 +1,81 @@
1
+ """
2
+ Re-export the Birdrecord client and models from ``main`` for tests and ``import birdrecord_client``.
3
+
4
+ End users: install from PyPI (``pip install birdrecord-cli``) and run ``birdrecord-cli``; or use the
5
+ single-file ``main.py`` workflow with ``uv run``.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from main import (
11
+ AdcodeCityRequest,
12
+ AdcodeProvinceRequest,
13
+ BirdrecordClient,
14
+ CityRow,
15
+ ChartActivityReportRow,
16
+ ChartActivityTaxonRow,
17
+ CommonChartBundleGrouped,
18
+ CommonListActivityTaxonRequest,
19
+ CommonPageActivityRequest,
20
+ DEFAULT_TAXON_VERSION,
21
+ DubiousAccurateCounts,
22
+ MemberProfilePayload,
23
+ MonthSearchEntry,
24
+ PointDetailPayload,
25
+ ProvinceRow,
26
+ RecordSummaryPayload,
27
+ RecordSummaryRequest,
28
+ RegionChartQueryBody,
29
+ ReportBundleResult,
30
+ ReportDetailPayload,
31
+ ReportGetRequest,
32
+ SearchStatisticResult,
33
+ StandardApiEnvelope,
34
+ TaxonMonthSlice,
35
+ TaxonRow,
36
+ TaxonSearchRequest,
37
+ build_common_list_taxon_request,
38
+ build_common_page_activity_request,
39
+ coerce_common_activity_body,
40
+ filter_region_rows_by_query,
41
+ filter_taxon_rows_by_query,
42
+ )
43
+
44
+ from main import _load_taxon_search_disk as _load_taxon_search_disk
45
+ from main import _save_taxon_search_disk as _save_taxon_search_disk
46
+
47
+ __all__ = [
48
+ "AdcodeCityRequest",
49
+ "AdcodeProvinceRequest",
50
+ "BirdrecordClient",
51
+ "CityRow",
52
+ "ChartActivityReportRow",
53
+ "ChartActivityTaxonRow",
54
+ "CommonChartBundleGrouped",
55
+ "CommonListActivityTaxonRequest",
56
+ "CommonPageActivityRequest",
57
+ "DEFAULT_TAXON_VERSION",
58
+ "DubiousAccurateCounts",
59
+ "MemberProfilePayload",
60
+ "MonthSearchEntry",
61
+ "PointDetailPayload",
62
+ "ProvinceRow",
63
+ "RecordSummaryPayload",
64
+ "RecordSummaryRequest",
65
+ "RegionChartQueryBody",
66
+ "ReportBundleResult",
67
+ "ReportDetailPayload",
68
+ "ReportGetRequest",
69
+ "SearchStatisticResult",
70
+ "StandardApiEnvelope",
71
+ "TaxonMonthSlice",
72
+ "TaxonRow",
73
+ "TaxonSearchRequest",
74
+ "_load_taxon_search_disk",
75
+ "_save_taxon_search_disk",
76
+ "build_common_list_taxon_request",
77
+ "build_common_page_activity_request",
78
+ "coerce_common_activity_body",
79
+ "filter_region_rows_by_query",
80
+ "filter_taxon_rows_by_query",
81
+ ]