Xannounce-parser
Exchange Announce Parser, 使用语法分析(基于 lark)提取交易所公告标题中的币种和公告类型, 例如:
$ uv run xparser 'Market Support for Clearpool(CPOOL) (KRW, BTC, USDT Market)'
> ParserResult(exchange='Upbit', type='New Spot', assets=[Coin(name='Clearpool', symbol='CPOOL')])
优势: 无假阳性, 解析器判别是特定类型就一定是特定类型. 缺陷: 可能有正例未检出
安装
使用 uv(推荐)
uv add xannounce-parser
使用 pip
pip install xannounce-parser
不安装测试
uvx --from xannounce-parser
为何不用 X?
正则表达式
简单的关键字匹配不够精确, 说实话, 你敢在交易中用正则匹配来的结果吗? 如果写得很复杂, 那为什么不使用特化的工具呢? 比如 Upbit 的英文公告中有四种上架格式:
Market Support for Zora(ZORA) (KRW, BTC, USDT Market)
Market Support for ACS, GO, OBSR, QTCON, RLY (USDT Market)
New Digital Assets Added to USDT Market (AGLD, AHT, ARPA, ASTR, BNT, EGLD, FIL, LWA, NEAR, OXT, RAD, XLM)
New digital asset on KRW Market (MINA)
硬写正则也没问题, 但是一定会比基于 BNF 语法的版本麻烦.
大语言模型
太慢了, 我希望能在 1ms 内得到结果然后发起交易. 不过目前的 https://coin.myuan.fun 上的匹配结果就是基于 GPT-5-nano 的.
小语言模型
有点复杂, 目前 Lark 表现已经很好, 如果未来有必要会考虑.
Roadmap
- 支持 Upbit 的上架、下架、警告信息
- 支持 Binance
- 支持 Bybit
- 支持 OKX
Metadata
Release files for xannounce-parser 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xannounce_parser-0.1.0.tar.gz | 3.2 kB | Without provenance | Details for xannounce_parser-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xannounce_parser-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for xannounce_parser-0.1.0-py3-none-any.whl |
Total release size: 7.5 kB
Release files / xannounce_parser-0.1.0.tar.gz
| Download URL | xannounce_parser-0.1.0.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f130ba396fd7c186bff747378dc6ec9f37607e06afcc0fb2688fae44da0e65eb
|
|
BLAKE2b-256 checksum How to use checksums |
079a0df7cf0d6767221cf85bbf51922f933f8183b036d4353160c58107dc23b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.0
|
Release files / xannounce_parser-0.1.0-py3-none-any.whl
| Download URL | xannounce_parser-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
060670828102d061ff0b9eb8af2c5dc16e5d4e744b76222fd26468cbf50422ef
|
|
BLAKE2b-256 checksum How to use checksums |
770c253be5f5c4dfaee58f7b5a2320d06c0d240edf3774db4efc4ffbb02aecaf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.0
|
Security for xannounce-parser 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.