predeldomain


Namepredeldomain JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
Summary预删除域名查询
upload_time2024-12-15 17:33:16
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseApache-2.0
keywords domain
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 预删除域名获取

`.cn`, `.top` 预删除的域名获取。


<a href="https://pypi.org/project/predeldomain" target="_blank">
    <img src="https://img.shields.io/pypi/v/predeldomain.svg" alt="Package version">
</a>

<a href="https://pypi.org/project/predeldomain" target="_blank">
    <img src="https://img.shields.io/pypi/pyversions/predeldomain.svg" alt="Supported Python versions">
</a>

---


## 使用方法
### 1. 安装依赖包:
- 方式一:通过 pypi
```bash
pip install predeldomain
```
- 方式二:通过代码仓库
```bash
pip install git+https://framagit.org/idev/predeldomain.git
```
- 方式三:通过本地仓库
```bash
pip install -e .
```
- 方式四:通过 wheel 包
```bash
pip install predeldomain-X.X.X-py3-none-any.whl
```

### 2. 使用帮助

```bash
» predeldomain --help
usage: predeldomain [-h] [-d [1-30]] [-l [1-10]] [-m {1,2,3}] [-o OUPUT] [-s {cn,top}] [-t {text,json}] [-w WHOIS] [-v]

The domain to be pre-deleted.

options:
  -h, --help            show this help message and exit
  -d [1-30], --delay [1-30]
                        Delay: 1s to 30s
  -l [1-10], --length [1-10]
                        Length: 1 to 10
  -m {1,2,3}, --mode {1,2,3}
                        Mode: 1. Alphanumeric, 2. Numeric, 3. Alphabetic
  -o OUPUT, --ouput OUPUT
                        Output: print data to stdout
  -s {cn,top}, --suffix {cn,top}
                        Suffix: 'cn' or 'top'
  -t {text,json}, --type {text,json}
                        Save type: 'text' or 'json'
  -w WHOIS, --whois WHOIS
                        Whois: whois, isp, nic, none
  -v, --version         Print version
```
1. length: 长度,不含后缀
2. mode: 模式, 1. 数字 + 字母, 2. 数字, 3. 字母
3. suffix: 域名后缀, 'cn' 或者 'top'
4. type: 保存类型, 'text' 或者 'json' (数据保存和发送通知的格式)
5. whois: whois, isp,查询可用的方式。`留空`,则不查询,而是直接根据官网提供的数据判断;`whois`,则使用 `whois` 库查询;`isp` 则使用官方接口(`.top`)、腾讯云(`.cn`)的 API 查询。
6. version: 版本信息
7. delay: 接口查询延时,单位秒,默认为 3
8. ouput: 是否输出到控制台,默认为 False

结果将会通过 PUSH 通知,和保存到本地文件。本地文件将会以 `后缀_日期.log` 的格式保存(`_next`则是明天及以后预删除的域名)。

### 3. PUSH 通知
当前仅支持 [**Lark**](https://www.larksuite.com/) 以及 [**PushDeer**](http://www.pushdeer.com/)。依赖 [**ipush 库**](https://github.com/idevsig/pypush),可自行添加其它渠道。

需要设置环境变量
```bash
# Lark
export LARK_TOKEN=""
export LARK_SECRET=""

# PushDeer
export PUSHDEER_TOKEN=""
```

## 开发

### 1. 前置开发环境

1. 使用 [**Rye**](https://rye.astral.sh/) 作为包管理工具

### 2. 开发流程

1. 安装依赖包:

```bash
# 同步
rye sync
```

2. 代码检测与格式化:

```bash
# 检测
rye run check

# 格式化
rye run format
```

3. 单元测试:

```bash
# rye test
rye run tests

# pytest
python -m pytest

# 打印测试报告
python -m pytest -s
```

## 仓库镜像

- https://git.jetsung.com/idev/predeldomain
- https://framagit.org/idev/predeldomain
- https://gitcode.com/idev/predeldomain
- https://github.com/idevsig/predeldomain

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "predeldomain",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "domain",
    "author": null,
    "author_email": "Jetsung Chan <jetsungchan@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/8e/77/6f25002008a722abaf75bbb88f11b40750b9fb277247d30883da241210bb/predeldomain-0.2.0.tar.gz",
    "platform": null,
    "description": "# \u9884\u5220\u9664\u57df\u540d\u83b7\u53d6\n\n`.cn`, `.top` \u9884\u5220\u9664\u7684\u57df\u540d\u83b7\u53d6\u3002\n\n\n<a href=\"https://pypi.org/project/predeldomain\" target=\"_blank\">\n    <img src=\"https://img.shields.io/pypi/v/predeldomain.svg\" alt=\"Package version\">\n</a>\n\n<a href=\"https://pypi.org/project/predeldomain\" target=\"_blank\">\n    <img src=\"https://img.shields.io/pypi/pyversions/predeldomain.svg\" alt=\"Supported Python versions\">\n</a>\n\n---\n\n\n## \u4f7f\u7528\u65b9\u6cd5\n### 1. \u5b89\u88c5\u4f9d\u8d56\u5305\uff1a\n- \u65b9\u5f0f\u4e00\uff1a\u901a\u8fc7 pypi\n```bash\npip install predeldomain\n```\n- \u65b9\u5f0f\u4e8c\uff1a\u901a\u8fc7\u4ee3\u7801\u4ed3\u5e93\n```bash\npip install git+https://framagit.org/idev/predeldomain.git\n```\n- \u65b9\u5f0f\u4e09\uff1a\u901a\u8fc7\u672c\u5730\u4ed3\u5e93\n```bash\npip install -e .\n```\n- \u65b9\u5f0f\u56db\uff1a\u901a\u8fc7 wheel \u5305\n```bash\npip install predeldomain-X.X.X-py3-none-any.whl\n```\n\n### 2. \u4f7f\u7528\u5e2e\u52a9\n\n```bash\n\u00bb predeldomain --help\nusage: predeldomain [-h] [-d [1-30]] [-l [1-10]] [-m {1,2,3}] [-o OUPUT] [-s {cn,top}] [-t {text,json}] [-w WHOIS] [-v]\n\nThe domain to be pre-deleted.\n\noptions:\n  -h, --help            show this help message and exit\n  -d [1-30], --delay [1-30]\n                        Delay: 1s to 30s\n  -l [1-10], --length [1-10]\n                        Length: 1 to 10\n  -m {1,2,3}, --mode {1,2,3}\n                        Mode: 1. Alphanumeric, 2. Numeric, 3. Alphabetic\n  -o OUPUT, --ouput OUPUT\n                        Output: print data to stdout\n  -s {cn,top}, --suffix {cn,top}\n                        Suffix: 'cn' or 'top'\n  -t {text,json}, --type {text,json}\n                        Save type: 'text' or 'json'\n  -w WHOIS, --whois WHOIS\n                        Whois: whois, isp, nic, none\n  -v, --version         Print version\n```\n1. length: \u957f\u5ea6\uff0c\u4e0d\u542b\u540e\u7f00\n2. mode: \u6a21\u5f0f\uff0c 1. \u6570\u5b57 + \u5b57\u6bcd, 2. \u6570\u5b57, 3. \u5b57\u6bcd\n3. suffix: \u57df\u540d\u540e\u7f00\uff0c 'cn' \u6216\u8005 'top'\n4. type: \u4fdd\u5b58\u7c7b\u578b\uff0c 'text' \u6216\u8005 'json' \uff08\u6570\u636e\u4fdd\u5b58\u548c\u53d1\u9001\u901a\u77e5\u7684\u683c\u5f0f\uff09\n5. whois: whois, isp\uff0c\u67e5\u8be2\u53ef\u7528\u7684\u65b9\u5f0f\u3002`\u7559\u7a7a`\uff0c\u5219\u4e0d\u67e5\u8be2\uff0c\u800c\u662f\u76f4\u63a5\u6839\u636e\u5b98\u7f51\u63d0\u4f9b\u7684\u6570\u636e\u5224\u65ad\uff1b`whois`\uff0c\u5219\u4f7f\u7528 `whois` \u5e93\u67e5\u8be2\uff1b`isp` \u5219\u4f7f\u7528\u5b98\u65b9\u63a5\u53e3(`.top`)\u3001\u817e\u8baf\u4e91(`.cn`)\u7684 API \u67e5\u8be2\u3002\n6. version: \u7248\u672c\u4fe1\u606f\n7. delay: \u63a5\u53e3\u67e5\u8be2\u5ef6\u65f6\uff0c\u5355\u4f4d\u79d2\uff0c\u9ed8\u8ba4\u4e3a 3\n8. ouput: \u662f\u5426\u8f93\u51fa\u5230\u63a7\u5236\u53f0\uff0c\u9ed8\u8ba4\u4e3a False\n\n\u7ed3\u679c\u5c06\u4f1a\u901a\u8fc7 PUSH \u901a\u77e5\uff0c\u548c\u4fdd\u5b58\u5230\u672c\u5730\u6587\u4ef6\u3002\u672c\u5730\u6587\u4ef6\u5c06\u4f1a\u4ee5 `\u540e\u7f00_\u65e5\u671f.log` \u7684\u683c\u5f0f\u4fdd\u5b58\uff08`_next`\u5219\u662f\u660e\u5929\u53ca\u4ee5\u540e\u9884\u5220\u9664\u7684\u57df\u540d\uff09\u3002\n\n### 3. PUSH \u901a\u77e5\n\u5f53\u524d\u4ec5\u652f\u6301 [**Lark**](https://www.larksuite.com/) \u4ee5\u53ca [**PushDeer**](http://www.pushdeer.com/)\u3002\u4f9d\u8d56 [**ipush \u5e93**](https://github.com/idevsig/pypush)\uff0c\u53ef\u81ea\u884c\u6dfb\u52a0\u5176\u5b83\u6e20\u9053\u3002\n\n\u9700\u8981\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\n```bash\n# Lark\nexport LARK_TOKEN=\"\"\nexport LARK_SECRET=\"\"\n\n# PushDeer\nexport PUSHDEER_TOKEN=\"\"\n```\n\n## \u5f00\u53d1\n\n### 1. \u524d\u7f6e\u5f00\u53d1\u73af\u5883\n\n1. \u4f7f\u7528 [**Rye**](https://rye.astral.sh/) \u4f5c\u4e3a\u5305\u7ba1\u7406\u5de5\u5177\n\n### 2. \u5f00\u53d1\u6d41\u7a0b\n\n1. \u5b89\u88c5\u4f9d\u8d56\u5305\uff1a\n\n```bash\n# \u540c\u6b65\nrye sync\n```\n\n2. \u4ee3\u7801\u68c0\u6d4b\u4e0e\u683c\u5f0f\u5316\uff1a\n\n```bash\n# \u68c0\u6d4b\nrye run check\n\n# \u683c\u5f0f\u5316\nrye run format\n```\n\n3. \u5355\u5143\u6d4b\u8bd5\uff1a\n\n```bash\n# rye test\nrye run tests\n\n# pytest\npython -m pytest\n\n# \u6253\u5370\u6d4b\u8bd5\u62a5\u544a\npython -m pytest -s\n```\n\n## \u4ed3\u5e93\u955c\u50cf\n\n- https://git.jetsung.com/idev/predeldomain\n- https://framagit.org/idev/predeldomain\n- https://gitcode.com/idev/predeldomain\n- https://github.com/idevsig/predeldomain\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "\u9884\u5220\u9664\u57df\u540d\u67e5\u8be2",
    "version": "0.2.0",
    "project_urls": {
        "Documentation": "https://framagit.org/idev/predeldomain",
        "Homepage": "https://git.jetsung.com/idev/predeldomain",
        "Repository": "https://framagit.org/idev/predeldomain.git"
    },
    "split_keywords": [
        "domain"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6c91a23bfa604d4a4721ba3925ee32872990c58a33df4248745a77767ea3504f",
                "md5": "bbf965db2574a47b9914eb4d161cf37f",
                "sha256": "b05c7404df26b8b78128f087f10c16cc829cd7db245784f5164e90144f7bdbb2"
            },
            "downloads": -1,
            "filename": "predeldomain-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bbf965db2574a47b9914eb4d161cf37f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 14807,
            "upload_time": "2024-12-15T17:33:14",
            "upload_time_iso_8601": "2024-12-15T17:33:14.613754Z",
            "url": "https://files.pythonhosted.org/packages/6c/91/a23bfa604d4a4721ba3925ee32872990c58a33df4248745a77767ea3504f/predeldomain-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8e776f25002008a722abaf75bbb88f11b40750b9fb277247d30883da241210bb",
                "md5": "31e8a8ca93ee41de723b9d6df534724f",
                "sha256": "27177a442620c9bc2584c74b86e65c82f6994b7e0bacf1f39066a87ead61d753"
            },
            "downloads": -1,
            "filename": "predeldomain-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "31e8a8ca93ee41de723b9d6df534724f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 15280,
            "upload_time": "2024-12-15T17:33:16",
            "upload_time_iso_8601": "2024-12-15T17:33:16.890986Z",
            "url": "https://files.pythonhosted.org/packages/8e/77/6f25002008a722abaf75bbb88f11b40750b9fb277247d30883da241210bb/predeldomain-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-15 17:33:16",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "predeldomain"
}
        
Elapsed time: 0.46759s