= commited on
Commit
f8a770b
·
1 Parent(s): 3e848bc

modified docs

Browse files
Files changed (6) hide show
  1. .idea/vcs.xml +6 -0
  2. .travis.yml +2 -2
  3. README.rst +22 -2
  4. docs/deep_translator.rst +54 -0
  5. docs/modules.rst +7 -0
  6. setup.py +1 -1
.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
.travis.yml CHANGED
@@ -22,8 +22,8 @@ deploy:
22
  distributions: sdist bdist_wheel
23
  user: nidhaloff
24
  password:
25
- secure: PLEASE_REPLACE_ME
26
  on:
27
  tags: true
28
  repo: nidhaloff/deep_translator
29
- python: 3.8
 
22
  distributions: sdist bdist_wheel
23
  user: nidhaloff
24
  password:
25
+ secure: __token__
26
  on:
27
  tags: true
28
  repo: nidhaloff/deep_translator
29
+ python: 3.7
README.rst CHANGED
@@ -41,6 +41,26 @@ Features
41
  * deep-translator uses google translate to translate a text. Therefore, all languages are supported
42
  * TODO: add support for the PONS translator (pons.com)
43
 
 
44
  Usage
45
- -----
46
- .. include:: docs/usage.rst
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  * deep-translator uses google translate to translate a text. Therefore, all languages are supported
42
  * TODO: add support for the PONS translator (pons.com)
43
 
44
+
45
  Usage
46
+ =====
47
+
48
+ To use deep_translator in a project::
49
+
50
+ from deep_translator import GoogleTranslator
51
+
52
+ english_text = 'happy coding'
53
+ chinese_text = '這很好'
54
+
55
+ # first create a GoogleTranslator object with source and target language
56
+ # then use the translate function to translate a text.
57
+ # All language are supported. Basic example:
58
+ result_german = GoogleTranslator(source='auto', target='de').translate(payload=english_text)
59
+ result_french = GoogleTranslator(source='auto', target='fr').translate(payload=chinese_text)
60
+
61
+ # Alternatively, you can pass languages by their name:
62
+ result_german = GoogleTranslator(source='english', target='german').translate(payload=english_text)
63
+ result_french = GoogleTranslator(source='auto', target='french').translate(payload=chinese_text)
64
+
65
+ # soon also support for the PONS translator.
66
+
docs/deep_translator.rst ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ deep\_translator package
2
+ ========================
3
+
4
+ Submodules
5
+ ----------
6
+
7
+ deep\_translator.cli module
8
+ ---------------------------
9
+
10
+ .. automodule:: deep_translator.cli
11
+ :members:
12
+ :undoc-members:
13
+ :show-inheritance:
14
+
15
+ deep\_translator.constants module
16
+ ---------------------------------
17
+
18
+ .. automodule:: deep_translator.constants
19
+ :members:
20
+ :undoc-members:
21
+ :show-inheritance:
22
+
23
+ deep\_translator.deep\_translator module
24
+ ----------------------------------------
25
+
26
+ .. automodule:: deep_translator.deep_translator
27
+ :members:
28
+ :undoc-members:
29
+ :show-inheritance:
30
+
31
+ deep\_translator.exceptions module
32
+ ----------------------------------
33
+
34
+ .. automodule:: deep_translator.exceptions
35
+ :members:
36
+ :undoc-members:
37
+ :show-inheritance:
38
+
39
+ deep\_translator.models module
40
+ ------------------------------
41
+
42
+ .. automodule:: deep_translator.models
43
+ :members:
44
+ :undoc-members:
45
+ :show-inheritance:
46
+
47
+
48
+ Module contents
49
+ ---------------
50
+
51
+ .. automodule:: deep_translator
52
+ :members:
53
+ :undoc-members:
54
+ :show-inheritance:
docs/modules.rst ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ deep_translator
2
+ ===============
3
+
4
+ .. toctree::
5
+ :maxdepth: 4
6
+
7
+ deep_translator
setup.py CHANGED
@@ -10,7 +10,7 @@ with open('README.rst') as readme_file:
10
  with open('HISTORY.rst') as history_file:
11
  history = history_file.read()
12
 
13
- requirements = [ ]
14
 
15
  setup_requirements = ['pytest-runner', ]
16
 
 
10
  with open('HISTORY.rst') as history_file:
11
  history = history_file.read()
12
 
13
+ requirements = ['requests', 'bs4']
14
 
15
  setup_requirements = ['pytest-runner', ]
16