generated from ZhaoQi99/python-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
87 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# Pagehub | ||
[![Python version](https://img.shields.io/pypi/pyversions/pagehub.svg?logo=python)](https://pypi.python.org/pypi/pagehub) | ||
[![PyPI package](https://img.shields.io/pypi/v/pagehub.svg)](https://pypi.python.org/pypi/pagehub) | ||
[![PyPI download](https://img.shields.io/pypi/dm/pagehub.svg)](https://pypi.python.org/pypi/pagehub) | ||
[![GitHub](https://img.shields.io/github/license/ZhaoQi99/pagehub)](https://github.com/ZhaoQi99/pagehub/blob/main/LICENSE) | ||
![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/ZhaoQi99/pagehub) | ||
# PageSaver | ||
[![Python version](https://img.shields.io/pypi/pyversions/pagesaver.svg?logo=python)](https://pypi.python.org/pypi/pagesaver) | ||
[![PyPI package](https://img.shields.io/pypi/v/pagesaver.svg)](https://pypi.python.org/pypi/pagesaver) | ||
[![PyPI download](https://img.shields.io/pypi/dm/pagesaver.svg)](https://pypi.python.org/pypi/pagesaver) | ||
[![GitHub](https://img.shields.io/github/license/ZhaoQi99/pagesaver)](https://github.com/ZhaoQi99/pagesaver/blob/main/LICENSE) | ||
![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/ZhaoQi99/pagesaver) | ||
|
||
Archive your web page. | ||
|
||
|
@@ -15,27 +15,27 @@ Archive your web page. | |
<summary><img height="15" src="https://www.python.org/favicon.ico"></img> pip</summary> | ||
|
||
```shell | ||
pip install pagehub | ||
pip install pagesaver | ||
✨🍰✨ | ||
``` | ||
Or you can use `pip install git+https://github.com/ZhaoQi99/PageHub.git | ||
Or you can use `pip install git+https://github.com/ZhaoQi99/PageSaver.git | ||
` install latest version. | ||
</details> | ||
|
||
<details> | ||
<summary><img height="15" src="https://cdn.simpleicons.org/docker/338FED?viewbox=auto" /> docker</summary> | ||
|
||
```shell | ||
docker run -d --name pagehub -p 8001:8001 zhaoqi99/pagehub | ||
docker run -d --name pagesaver -p 8001:8001 zhaoqi99/pagesaver | ||
``` | ||
|
||
</details> | ||
|
||
## Quick Start | ||
### HTTP API | ||
1. Init PageHub: `pagehub init` | ||
2. Start HTTP Server: `pagehub server` | ||
> `nohup pagehub server >> server.log 2>&1 &` | ||
1. Init PageSaver: `pagesaver init` | ||
2. Start HTTP Server: `pagesaver server` | ||
> `nohup pagesaver server >> server.log 2>&1 &` | ||
3. Examples: | ||
```shell | ||
~$ curl http://127.0.0.1:8001/api/record/https://www.baidu.com/?format=MHTML&format=PDF -H 'Authorization: <API_TOKEN>' | ||
|
@@ -44,7 +44,7 @@ docker run -d --name pagehub -p 8001:8001 zhaoqi99/pagehub | |
|
||
### CLI | ||
```shell | ||
pagehub export https://www.baidu.com -o . -f MHTML,PDF | ||
pagesaver export https://www.baidu.com -o . -f MHTML,PDF | ||
``` | ||
|
||
## HTTP Usage | ||
|
@@ -85,8 +85,8 @@ Using the Authorization header, format is: `Authorization: <API_TOKEN>` | |
## CLI Usage | ||
### Export | ||
```shell | ||
~$ pagehub export -h | ||
Usage: pagehub export [OPTIONS] URL | ||
~$ pagesaver export -h | ||
Usage: pagesaver export [OPTIONS] URL | ||
|
||
Export page to the output file | ||
|
||
|
@@ -98,19 +98,19 @@ Options: | |
``` | ||
### Server | ||
```shell | ||
~$ pagehub init | ||
~$ pagehub server -h | ||
Usage: pagehub server [OPTIONS] | ||
~$ pagesaver init | ||
~$ pagesaver server -h | ||
Usage: pagesaver server [OPTIONS] | ||
|
||
Run PageHub HTTP server | ||
Run PageSaver HTTP server | ||
|
||
Options: | ||
-h, --help Show this message and exit. | ||
-b, --bind TEXT The TCP host/address to bind to. [default: 0.0.0.0:8001] | ||
``` | ||
|
||
## Configuration | ||
Pagehub will read the configuration from `config.py` automatically. | ||
PageSaver will read the configuration from `config.py` automatically. | ||
|
||
### STORAGE | ||
* type: storage type. Currently supported values are "local". | ||
|
@@ -137,7 +137,7 @@ The property name in Notion to use for the MHTML file of a page. | |
Default: `mhtml` | ||
|
||
## License | ||
[GNU General Public License v3.0](https://github.com/ZhaoQi99/PageHub/blob/main/LICENSE) | ||
[GNU General Public License v3.0](https://github.com/ZhaoQi99/PageSaver/blob/main/LICENSE) | ||
|
||
## Author | ||
* Qi Zhao([[email protected]](mailto:[email protected])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import click | ||
|
||
from pagehub import __version__ | ||
from pagesaver import __version__ | ||
|
||
VERSION = rf""" | ||
____ _ _ _ _ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from pagehub.enums import ExportFormat | ||
from pagesaver.enums import ExportFormat | ||
|
||
SUPPORT_FORMATS = list(ExportFormat.__members__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.