dici-open 0.0.0a1__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.
- dici_open-0.0.0a1/LICENSE +21 -0
- dici_open-0.0.0a1/PKG-INFO +61 -0
- dici_open-0.0.0a1/README.md +43 -0
- dici_open-0.0.0a1/dici/__init__.py +0 -0
- dici_open-0.0.0a1/dici/__main__.py +5 -0
- dici_open-0.0.0a1/dici/main.py +86 -0
- dici_open-0.0.0a1/dici_open.egg-info/PKG-INFO +61 -0
- dici_open-0.0.0a1/dici_open.egg-info/SOURCES.txt +12 -0
- dici_open-0.0.0a1/dici_open.egg-info/dependency_links.txt +1 -0
- dici_open-0.0.0a1/dici_open.egg-info/entry_points.txt +2 -0
- dici_open-0.0.0a1/dici_open.egg-info/requires.txt +4 -0
- dici_open-0.0.0a1/dici_open.egg-info/top_level.txt +1 -0
- dici_open-0.0.0a1/pyproject.toml +29 -0
- dici_open-0.0.0a1/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 oJohnnyBoy
|
|
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,61 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dici-open
|
|
3
|
+
Version: 0.0.0a1
|
|
4
|
+
Summary: A dictionary request CLI program.
|
|
5
|
+
Author-email: oJohnnyMarcello <Bookman.Archive@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: dictionary,cli,portuguese
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Programming Language :: Python
|
|
10
|
+
Requires-Python: >=3.15
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: rich<15.0.0
|
|
14
|
+
Requires-Dist: prompt_toolkit==3.0.53
|
|
15
|
+
Requires-Dist: deepl==1.33.0
|
|
16
|
+
Requires-Dist: requests==2.34.2
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# Dici
|
|
20
|
+
|
|
21
|
+
Dici is an alpha-stage command-line dictionary tool. It currently supports Jisho-based Japanese/English lookups from the terminal and provides a simple interactive menu for searching words.
|
|
22
|
+
|
|
23
|
+
## Features
|
|
24
|
+
|
|
25
|
+
- Interactive terminal UI with a menu-driven workflow
|
|
26
|
+
- Jisho API lookups for Japanese and English definitions
|
|
27
|
+
- Rich formatted output via `rich`
|
|
28
|
+
|
|
29
|
+
## Requirements
|
|
30
|
+
|
|
31
|
+
- Python 3.15 or later
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
From the project directory, install the package and its dependencies:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
python -m pip install .
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
For local development, install in editable mode:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
python -m pip install -e .
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Run
|
|
48
|
+
|
|
49
|
+
After installation, launch the CLI with either of these commands:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
python -m dici
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
or:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
dici
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The app opens an interactive menu where you can choose dictionary sources and search for words.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Dici
|
|
2
|
+
|
|
3
|
+
Dici is an alpha-stage command-line dictionary tool. It currently supports Jisho-based Japanese/English lookups from the terminal and provides a simple interactive menu for searching words.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Interactive terminal UI with a menu-driven workflow
|
|
8
|
+
- Jisho API lookups for Japanese and English definitions
|
|
9
|
+
- Rich formatted output via `rich`
|
|
10
|
+
|
|
11
|
+
## Requirements
|
|
12
|
+
|
|
13
|
+
- Python 3.15 or later
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
From the project directory, install the package and its dependencies:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
python -m pip install .
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
For local development, install in editable mode:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
python -m pip install -e .
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Run
|
|
30
|
+
|
|
31
|
+
After installation, launch the CLI with either of these commands:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
python -m dici
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
or:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
dici
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The app opens an interactive menu where you can choose dictionary sources and search for words.
|
|
File without changes
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#| libraries
|
|
2
|
+
|
|
3
|
+
#⌊→ cli library
|
|
4
|
+
from prompt_toolkit.shortcuts import clear
|
|
5
|
+
from rich import print
|
|
6
|
+
from rich.panel import Panel
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
|
|
9
|
+
#⌊→ api library
|
|
10
|
+
import requests
|
|
11
|
+
|
|
12
|
+
#⌊→ apis var
|
|
13
|
+
jisho_url = 'http://beta.jisho.org/api/v1/search/words'
|
|
14
|
+
project_name = 'DICIOPEN'
|
|
15
|
+
|
|
16
|
+
formatation = {'word', 'sentence', 'meaning'}
|
|
17
|
+
|
|
18
|
+
console = Console()
|
|
19
|
+
|
|
20
|
+
def main():
|
|
21
|
+
content = f''
|
|
22
|
+
text = f'[red bold italic]WELCOME TO {project_name}[/red bold italic]'
|
|
23
|
+
text2= f'What do [red bold]you[/red bold] want to do? \n 1. Jisho \n 2. Eng \n 3. PT-BR'
|
|
24
|
+
while True:
|
|
25
|
+
console.print(Panel(f'{text}\n \n{text2}',title='DICIOPEN'))
|
|
26
|
+
choose = console.input('choose from (1-4) \n> ')
|
|
27
|
+
if choose == '4':
|
|
28
|
+
console.print(Panel('[green bold]See you later![/green bold] \n [red bold]Thank you :smile::heart:[/red bold]'))
|
|
29
|
+
break
|
|
30
|
+
elif choose == '1': # gets the word and calls jisho function
|
|
31
|
+
clear()
|
|
32
|
+
console.print(Panel('Write the word you want to search for: [grey italic](obs. in english or japanese)',title=project_name,subtitle="Japanese Dicitionary"))
|
|
33
|
+
word = console.input('> ')
|
|
34
|
+
get_jisho_data(word)
|
|
35
|
+
break
|
|
36
|
+
elif choose == '2':
|
|
37
|
+
pass
|
|
38
|
+
elif choose == '3':
|
|
39
|
+
pass
|
|
40
|
+
|
|
41
|
+
else:
|
|
42
|
+
console.print(Panel('[bold red]:x: This option is unavailable, try again later.'))
|
|
43
|
+
break
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def get_jisho_data(str):
|
|
49
|
+
r = requests.get(
|
|
50
|
+
jisho_url,
|
|
51
|
+
params={'keyword': str}
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
rtext = format_jisho_r(r.json())
|
|
55
|
+
console.print(Panel(rtext, title=project_name, subtitle='JISHO'))
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def format_entry(entry): # Gets the main word and reading and format its entries.
|
|
59
|
+
# Main reading and word, corresponding to the first item in 'japanese'.
|
|
60
|
+
maind = entry['japanese'][0]
|
|
61
|
+
word = maind.get('word', '')
|
|
62
|
+
reading = maind.get('reading', '')
|
|
63
|
+
|
|
64
|
+
# extra info
|
|
65
|
+
common = 'common' if entry['is_common'] else 'uncommon'
|
|
66
|
+
jlpt = ', '.join(entry['jlpt']).upper().replace('JLPT-','') or '-'
|
|
67
|
+
|
|
68
|
+
lines = [f'{word} 【{reading}】 ({common}, JLPT: {jlpt})']
|
|
69
|
+
|
|
70
|
+
# definitions
|
|
71
|
+
for i, sense in enumerate(entry['senses'], start=1):
|
|
72
|
+
meanings = '; '.join(sense['english_definitions'])
|
|
73
|
+
pos = ', '.join(sense['parts_of_speech'])
|
|
74
|
+
lines.append(f" {i}. {meanings} [{pos}]")
|
|
75
|
+
|
|
76
|
+
return '\n'.join(lines)
|
|
77
|
+
|
|
78
|
+
def format_jisho_r(respon):
|
|
79
|
+
if respon['meta']['status'] != 200:
|
|
80
|
+
return 'Error: Request failed.'
|
|
81
|
+
|
|
82
|
+
entries = respon['data']
|
|
83
|
+
return '\n\n'.join(format_entry(e) for e in entries)
|
|
84
|
+
|
|
85
|
+
if __name__ == '__main__':
|
|
86
|
+
main()
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dici-open
|
|
3
|
+
Version: 0.0.0a1
|
|
4
|
+
Summary: A dictionary request CLI program.
|
|
5
|
+
Author-email: oJohnnyMarcello <Bookman.Archive@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: dictionary,cli,portuguese
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Programming Language :: Python
|
|
10
|
+
Requires-Python: >=3.15
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: rich<15.0.0
|
|
14
|
+
Requires-Dist: prompt_toolkit==3.0.53
|
|
15
|
+
Requires-Dist: deepl==1.33.0
|
|
16
|
+
Requires-Dist: requests==2.34.2
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# Dici
|
|
20
|
+
|
|
21
|
+
Dici is an alpha-stage command-line dictionary tool. It currently supports Jisho-based Japanese/English lookups from the terminal and provides a simple interactive menu for searching words.
|
|
22
|
+
|
|
23
|
+
## Features
|
|
24
|
+
|
|
25
|
+
- Interactive terminal UI with a menu-driven workflow
|
|
26
|
+
- Jisho API lookups for Japanese and English definitions
|
|
27
|
+
- Rich formatted output via `rich`
|
|
28
|
+
|
|
29
|
+
## Requirements
|
|
30
|
+
|
|
31
|
+
- Python 3.15 or later
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
From the project directory, install the package and its dependencies:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
python -m pip install .
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
For local development, install in editable mode:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
python -m pip install -e .
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Run
|
|
48
|
+
|
|
49
|
+
After installation, launch the CLI with either of these commands:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
python -m dici
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
or:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
dici
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The app opens an interactive menu where you can choose dictionary sources and search for words.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
dici/__init__.py
|
|
5
|
+
dici/__main__.py
|
|
6
|
+
dici/main.py
|
|
7
|
+
dici_open.egg-info/PKG-INFO
|
|
8
|
+
dici_open.egg-info/SOURCES.txt
|
|
9
|
+
dici_open.egg-info/dependency_links.txt
|
|
10
|
+
dici_open.egg-info/entry_points.txt
|
|
11
|
+
dici_open.egg-info/requires.txt
|
|
12
|
+
dici_open.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dici
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = 'dici-open'
|
|
3
|
+
version = '0.0.0a1'
|
|
4
|
+
description = 'A dictionary request CLI program.'
|
|
5
|
+
license = 'MIT'
|
|
6
|
+
|
|
7
|
+
authors = [{name = 'oJohnnyMarcello', email = 'Bookman.Archive@gmail.com'}]
|
|
8
|
+
readme = {file = 'README.md', content-type = 'text/markdown'}
|
|
9
|
+
requires-python = '>= 3.15'
|
|
10
|
+
|
|
11
|
+
dependencies = [
|
|
12
|
+
'rich<15.0.0',
|
|
13
|
+
'prompt_toolkit==3.0.53',
|
|
14
|
+
'deepl==1.33.0',
|
|
15
|
+
'requests==2.34.2'
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
keywords = ['dictionary', 'cli', 'portuguese']
|
|
19
|
+
classifiers = [
|
|
20
|
+
"Development Status :: 3 - Alpha",
|
|
21
|
+
"Programming Language :: Python"
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.scripts]
|
|
25
|
+
dici = 'dici.main:main'
|
|
26
|
+
|
|
27
|
+
[build-system]
|
|
28
|
+
requires = ["setuptools >= 84.2.1"]
|
|
29
|
+
build-backend = "setuptools.build_meta"
|