Skip to content

Commit d9898e9

Browse files
committed
Add emacs-paw pip
1 parent 80d175a commit d9898e9

File tree

5 files changed

+94
-29
lines changed

5 files changed

+94
-29
lines changed

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.PHONY: clean
2+
clean:
3+
rm -rf build dist *.egg-info
4+
.PHONY: dist
5+
dist: clean
6+
python3 -m build
7+
.PHONY: upload
8+
upload: dist
9+
python3 -m twine upload dist/*

README.org

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ You should install the following Dependencies if you want to make use all the po
120120
- [[https://github.com/rany2/edge-tts/][edge-tts]] (pronunciation)
121121
- [[https://github.com/ikawaha/kagome][kagome]] (For Japanese segmentation)
122122

123-
- python dependencies (install under the repo root folder by ~pip install .~ or one by one manually):
123+
- python dependencies (install under the repo root folder by ~pip install emacs-paw~ or one by one manually):
124124
- Python itself (3.10+, for mac 3.11+)
125125
- nltk
126126
- flask
@@ -168,9 +168,9 @@ Five steps:
168168
brew install python # You can use pyenv or other tools to install python
169169
#+end_src
170170

171-
3. Clone this repo to any place, and install ~paw~ command line by the following command, but this is optional, it helps you setup the dependencies
171+
3. Install ~paw~ command line by the following command
172172
#+begin_src sh
173-
pip install .
173+
pip install emacs-paw
174174
#+end_src
175175

176176
4-1. Please be patient... run the following command lines, you may need to adjust them based on your system, take mac for example:
@@ -181,13 +181,13 @@ Five steps:
181181
# Language Detection
182182
pip install pycld2 # install gcld3 on mac is difficult...
183183
# English
184-
pip install nltk # not needed if install by pip install .
184+
pip install nltk # not needed if install by pip install emacs-paw
185185
python -m nltk.downloader stopwords
186186
python -m nltk.downloader punkt
187187
# Japanese
188-
pip install mecab-python3 unidic-lite # not needed if install by pip install .
188+
pip install mecab-python3 unidic-lite # not needed if install by pip install emacs-paw
189189
# paw-server, for mac, please install python 3.11, 3.10 may have segementation fault issue
190-
pip install flask flask-cors requests # not needed if install by pip install .
190+
pip install flask flask-cors requests # not needed if install by pip install emacs-paw
191191
#+end_src
192192

193193
4-2. For android install:
@@ -197,7 +197,7 @@ Five steps:
197197
apt update
198198
apt install protobuf
199199
pip3.10 install gcld3
200-
pip3.10 install flask flask-cors requests # not needed if install by pip install .
200+
pip3.10 install flask flask-cors requests # not needed if install by pip install emacs-paw
201201
#+end_src
202202

203203
5. Finally, Install paw.el

README_PAW_CLI.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# paw (point-and-write)
2+
`emacs-paw` is a command line tool work with [paw.el](https://github.com/chenyanming/paw).
3+
4+
## Dependencies and Installation
5+
### Python Dependencies
6+
Install emacs-paw
7+
```sh
8+
pip install emacs-paw
9+
```
10+
11+
Install:
12+
```sh
13+
python -m nltk.downloader stopwords
14+
python -m nltk.downloader punkt
15+
```
16+
17+
## Usage
18+
### Command Line Interface
19+
The `paw` command line tool is designed to work with `paw.el`, providing several commands to facilitate the setup and operation of the Emacs plugin. The available commands are:
20+
- `run_server`: Start the PAW server for handling annotation requests.
21+
- `en_search`: Search in English dictionaries.
22+
- `ja_search`: Search in Japanese dictionaries.
23+
Refer to `cli.py` for more details on these commands.
24+
### Example Usage
25+
2. Start the PAW server:
26+
```sh
27+
paw run_server --database /home/damonchan/org/paw.sqlite --save-dir /tmp/ --port 5001 --wallabag-host https://example.com --wallabag-username username --wallabag-password password --wallabag-clientid clientid --wallabag-secret secret
28+
```
29+
3. Perform an English search:
30+
```sh
31+
paw en_search /home/damonchan/org/stardict.db MATCH hello --tag "" --wordlists /home/damonchan/org/5000.csv --known-words-files /home/damonchan/org/eudic.csv,/home/damonchan/org/english.txt
32+
```
33+
4. Perform a Japanese search:
34+
```sh
35+
paw ja_search /home/damonchan/org/japanese.db MATCH 海外の大企業は「ダイバーシティ(多様性)&インクルージョン(包括的) --tag "" --wordlist /home/damonchan/org/蓝宝书日语文法.csv --known-words-files /home/damonchan/org/japanese.txt
36+
```
37+
## Author
38+
Damon Chan
39+
## License
40+
This project is licensed under the GNU General Public License v3.0.

pyproject.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[build-system]
2+
requires = ["setuptools>=42", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
[project]
5+
name = "emacs-paw"
6+
version = "0.1.2"
7+
description = "Study for a life in Emacs with advanced annotation and language learning tools."
8+
readme = "README_PAW_CLI.md"
9+
authors = [{ name = "Damon Chan" }]
10+
license = { file = "LICENSE" }
11+
keywords = ["Emacs", "annotation", "language learning", "dictionary", "sql", "org-mode"]
12+
classifiers = [
13+
"Development Status :: 3 - Alpha",
14+
"Intended Audience :: Developers",
15+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
16+
"Programming Language :: Python :: 3.10",
17+
"Programming Language :: Python :: 3.11",
18+
"Natural Language :: English",
19+
"Natural Language :: Japanese",
20+
"Operating System :: OS Independent"
21+
]
22+
requires-python = ">=3.10"
23+
dependencies = [
24+
"Flask",
25+
"flask-cors",
26+
"requests",
27+
"nltk",
28+
"mecab-python3",
29+
"unidic-lite"
30+
]
31+
[project.urls]
32+
Homepage = "https://github.com/chenyanming/paw"
33+
Repository = "https://github.com/chenyanming/paw"
34+
[project.scripts]
35+
paw = "paw.cli:main"
36+
[tool.setuptools.packages.find]
37+
where = ["."]
38+
include = ["paw"]

setup.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)