Chris Trenthem
commited on
Commit
·
f420bc0
1
Parent(s):
7168aee
moved root folder documentation to /docs folder to reduce duplication
Browse files- AUTHORS.rst +0 -15
- CONTRIBUTING.rst +0 -128
- HISTORY.rst +0 -19
- LICENSE → docs/LICENSE +0 -0
- README.rst → docs/README.rst +30 -59
- docs/authors.rst +15 -1
- docs/contributing.rst +131 -1
- docs/history.rst +20 -1
- docs/readme.rst +0 -1
AUTHORS.rst
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
=======
|
2 |
-
Credits
|
3 |
-
=======
|
4 |
-
|
5 |
-
Development Lead
|
6 |
-
----------------
|
7 |
-
|
8 |
-
* Nidhal Baccouri <[email protected]>
|
9 |
-
|
10 |
-
Contributors
|
11 |
-
------------
|
12 |
-
|
13 |
-
@prataffel
|
14 |
-
@senk8
|
15 |
-
@nothead31
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CONTRIBUTING.rst
DELETED
@@ -1,128 +0,0 @@
|
|
1 |
-
.. highlight:: shell
|
2 |
-
|
3 |
-
============
|
4 |
-
Contributing
|
5 |
-
============
|
6 |
-
|
7 |
-
Contributions are welcome, and they are greatly appreciated! Every little bit
|
8 |
-
helps, and credit will always be given.
|
9 |
-
|
10 |
-
You can contribute in many ways:
|
11 |
-
|
12 |
-
Types of Contributions
|
13 |
-
----------------------
|
14 |
-
|
15 |
-
Report Bugs
|
16 |
-
~~~~~~~~~~~
|
17 |
-
|
18 |
-
Report bugs at https://github.com/nidhaloff/deep_translator/issues.
|
19 |
-
|
20 |
-
If you are reporting a bug, please include:
|
21 |
-
|
22 |
-
* Your operating system name and version.
|
23 |
-
* Any details about your local setup that might be helpful in troubleshooting.
|
24 |
-
* Detailed steps to reproduce the bug.
|
25 |
-
|
26 |
-
Fix Bugs
|
27 |
-
~~~~~~~~
|
28 |
-
|
29 |
-
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
|
30 |
-
wanted" is open to whoever wants to implement it.
|
31 |
-
|
32 |
-
Implement Features
|
33 |
-
~~~~~~~~~~~~~~~~~~
|
34 |
-
|
35 |
-
Look through the GitHub issues for features. Anything tagged with "enhancement"
|
36 |
-
and "help wanted" is open to whoever wants to implement it.
|
37 |
-
|
38 |
-
Write Documentation
|
39 |
-
~~~~~~~~~~~~~~~~~~~
|
40 |
-
|
41 |
-
deep_translator could always use more documentation, whether as part of the
|
42 |
-
official deep_translator docs, in docstrings, or even on the web in blog posts,
|
43 |
-
articles, and such.
|
44 |
-
|
45 |
-
Submit Feedback
|
46 |
-
~~~~~~~~~~~~~~~
|
47 |
-
|
48 |
-
The best way to send feedback is to file an issue at https://github.com/nidhaloff/deep_translator/issues.
|
49 |
-
|
50 |
-
If you are proposing a feature:
|
51 |
-
|
52 |
-
* Explain in detail how it would work.
|
53 |
-
* Keep the scope as narrow as possible, to make it easier to implement.
|
54 |
-
* Remember that this is a volunteer-driven project, and that contributions
|
55 |
-
are welcome :)
|
56 |
-
|
57 |
-
Get Started!
|
58 |
-
------------
|
59 |
-
|
60 |
-
Ready to contribute? Here's how to set up `deep_translator` for local development.
|
61 |
-
|
62 |
-
1. Fork the `deep_translator` repo on GitHub.
|
63 |
-
2. Clone your fork locally::
|
64 |
-
|
65 |
-
$ git clone [email protected]:your_name_here/deep_translator.git
|
66 |
-
|
67 |
-
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
|
68 |
-
|
69 |
-
$ mkvirtualenv deep_translator
|
70 |
-
$ cd deep_translator/
|
71 |
-
$ python setup.py develop
|
72 |
-
|
73 |
-
4. Create a branch for local development::
|
74 |
-
|
75 |
-
$ git checkout -b name-of-your-bugfix-or-feature
|
76 |
-
|
77 |
-
Now you can make your changes locally.
|
78 |
-
|
79 |
-
5. When you're done making changes, check that your changes pass flake8 and the
|
80 |
-
tests, including testing other Python versions with tox::
|
81 |
-
|
82 |
-
$ flake8 deep_translator tests
|
83 |
-
$ python setup.py test or pytest
|
84 |
-
$ tox
|
85 |
-
|
86 |
-
To get flake8 and tox, just pip install them into your virtualenv.
|
87 |
-
|
88 |
-
6. Commit your changes and push your branch to GitHub::
|
89 |
-
|
90 |
-
$ git add .
|
91 |
-
$ git commit -m "Your detailed description of your changes."
|
92 |
-
$ git push origin name-of-your-bugfix-or-feature
|
93 |
-
|
94 |
-
7. Submit a pull request through the GitHub website.
|
95 |
-
|
96 |
-
Pull Request Guidelines
|
97 |
-
-----------------------
|
98 |
-
|
99 |
-
Before you submit a pull request, check that it meets these guidelines:
|
100 |
-
|
101 |
-
1. The pull request should include tests.
|
102 |
-
2. If the pull request adds functionality, the docs should be updated. Put
|
103 |
-
your new functionality into a function with a docstring, and add the
|
104 |
-
feature to the list in README.rst.
|
105 |
-
3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check
|
106 |
-
https://travis-ci.com/nidhaloff/deep_translator/pull_requests
|
107 |
-
and make sure that the tests pass for all supported Python versions.
|
108 |
-
|
109 |
-
Tips
|
110 |
-
----
|
111 |
-
|
112 |
-
To run a subset of tests::
|
113 |
-
|
114 |
-
$ pytest -ra
|
115 |
-
|
116 |
-
|
117 |
-
Deploying
|
118 |
-
---------
|
119 |
-
|
120 |
-
A reminder for the maintainers on how to deploy.
|
121 |
-
Make sure all your changes are committed (including an entry in HISTORY.rst).
|
122 |
-
Then run::
|
123 |
-
|
124 |
-
$ bump2version patch # possible: major / minor / patch
|
125 |
-
$ git push
|
126 |
-
$ git push --tags
|
127 |
-
|
128 |
-
Travis will then deploy to PyPI if tests pass.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HISTORY.rst
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
==================
|
2 |
-
Important History
|
3 |
-
==================
|
4 |
-
|
5 |
-
- 1.4.4 added support for papago, added opt params, fixed deepl free api
|
6 |
-
- 1.4.3 added support deepl free api
|
7 |
-
- 1.4.2 added proxy support
|
8 |
-
- 1.3.4 bug fixes for the dutch language
|
9 |
-
- 1.3.3 fixed bug in google translate
|
10 |
-
|
11 |
-
- 1.2.5: added support for the DeepL translator
|
12 |
-
- 1.2.4: added support for the QCRI translator
|
13 |
-
- 1.2.1: added support for the yandex translator
|
14 |
-
- 1.1.9: fixed bug in requests
|
15 |
-
- 1.1.5: added language detection
|
16 |
-
- 1.1.3: added support for mymemory
|
17 |
-
- 1.0.4: added support for pons
|
18 |
-
- 1.0.2: added support for linguee
|
19 |
-
- 1.0.0: added support for google translate
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LICENSE → docs/LICENSE
RENAMED
File without changes
|
README.rst → docs/README.rst
RENAMED
@@ -2,7 +2,7 @@
|
|
2 |
deep-translator
|
3 |
##################
|
4 |
|
5 |
-
.. image:: assets/icon.jpg
|
6 |
:width: 100
|
7 |
:align: center
|
8 |
:alt: deep-translator-icon
|
@@ -125,7 +125,7 @@ Install the stable release:
|
|
125 |
|
126 |
.. code-block:: console
|
127 |
|
128 |
-
$ pip install -U
|
129 |
|
130 |
take a look at the docs if you want to install from source.
|
131 |
|
@@ -135,14 +135,14 @@ Quick Start
|
|
135 |
|
136 |
.. code-block:: python
|
137 |
|
138 |
-
from
|
139 |
translated = GoogleTranslator(source='auto', target='de').translate("keep it up, you are awesome") # output -> Weiter so, du bist großartig
|
140 |
|
141 |
or using proxies:
|
142 |
|
143 |
.. code-block:: python
|
144 |
|
145 |
-
from
|
146 |
|
147 |
proxies_example = {
|
148 |
"https": "34.195.196.27:8080",
|
@@ -155,7 +155,7 @@ or even directly from terminal:
|
|
155 |
|
156 |
.. code-block:: console
|
157 |
|
158 |
-
$
|
159 |
|
160 |
|
161 |
=====
|
@@ -175,7 +175,7 @@ Imports
|
|
175 |
|
176 |
.. code-block:: python
|
177 |
|
178 |
-
from
|
179 |
MicrosoftTranslator,
|
180 |
PonsTranslator,
|
181 |
LingueeTranslator,
|
@@ -536,7 +536,7 @@ can be used with all supported translators.
|
|
536 |
|
537 |
.. code-block:: python
|
538 |
|
539 |
-
from
|
540 |
|
541 |
# define your proxy configs:
|
542 |
proxies_example = {
|
@@ -551,71 +551,42 @@ can be used with all supported translators.
|
|
551 |
Usage from Terminal
|
552 |
--------------------
|
553 |
|
554 |
-
|
555 |
-
the right arguments, which are the translator you want to use, source language, target language and the text
|
556 |
-
you want to translate.
|
557 |
|
558 |
-
|
559 |
-
the other supported translators. Just read the documentation to have an overview about the supported translators in this library.
|
560 |
-
|
561 |
-
.. code-block:: console
|
562 |
|
563 |
-
|
564 |
|
565 |
-
|
566 |
|
567 |
.. code-block:: console
|
568 |
|
569 |
-
$
|
570 |
|
571 |
-
|
572 |
|
573 |
.. code-block:: console
|
574 |
|
575 |
-
$
|
576 |
|
577 |
-
|
578 |
|
579 |
.. code-block:: console
|
580 |
|
581 |
-
$
|
582 |
|
583 |
-
======
|
584 |
-
Tests
|
585 |
-
======
|
586 |
|
587 |
-
|
588 |
|
589 |
.. code-block:: console
|
590 |
|
591 |
-
$
|
592 |
-
|
593 |
-
- Or just install pytest
|
594 |
-
|
595 |
-
.. code-block:: console
|
596 |
-
|
597 |
-
$ pip install pytest
|
598 |
-
|
599 |
-
|
600 |
-
- you can run tests individually for each translator by passing the prefix **test_** followed by the translator name as an argument to pytest.
|
601 |
-
|
602 |
-
.. code-block:: console
|
603 |
-
|
604 |
-
$ pytest test_google_trans
|
605 |
-
$ pytest test_linguee
|
606 |
-
$ pytest test_mymemory
|
607 |
-
$ pytest test_pons
|
608 |
-
|
609 |
-
- Alternatively, you can run the test suite
|
610 |
-
|
611 |
-
.. code-block:: console
|
612 |
-
|
613 |
-
$ pytest -ra
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
|
|
|
|
|
|
|
618 |
|
|
|
619 |
|
620 |
========
|
621 |
Links
|
@@ -668,12 +639,12 @@ Copyright (c) 2020-present, Nidhal Baccouri
|
|
668 |
The Translator++ mobile app
|
669 |
===========================
|
670 |
|
671 |
-
.. image:: assets/app-icon.png
|
672 |
:width: 100
|
673 |
:alt: Icon of the app
|
674 |
|
675 |
|
676 |
-
After developing the
|
677 |
Sure, there is google translate, pons and linguee apps etc.. but isn't it cooler to make an app where all these
|
678 |
translators are integrated?
|
679 |
|
@@ -683,8 +654,8 @@ I open sourced the `Translator++ app <https://github.com/nidhaloff/deep-translat
|
|
683 |
Feel free to take a look at the code or make a pull request ;)
|
684 |
|
685 |
.. note::
|
686 |
-
The Translator++ app is based on the
|
687 |
-
of the
|
688 |
|
689 |
I published the first release on google play store on 02-08-2020
|
690 |
|
@@ -692,22 +663,22 @@ Here are some screenshots:
|
|
692 |
|
693 |
- Phone
|
694 |
|
695 |
-
.. image:: assets/translator1.jpg
|
696 |
:width: 30%
|
697 |
:height: 200
|
698 |
:alt: screenshot1
|
699 |
-
.. image:: assets/translator2.jpg
|
700 |
:width: 30%
|
701 |
:height: 200
|
702 |
:alt: screenshot2
|
703 |
-
.. image:: assets/spinner.jpg
|
704 |
:width: 30%
|
705 |
:height: 200
|
706 |
:alt: spinner
|
707 |
|
708 |
- Tablet:
|
709 |
|
710 |
-
.. image:: assets/hz_view.png
|
711 |
:width: 100%
|
712 |
:height: 300
|
713 |
:alt: screenshot3
|
|
|
2 |
deep-translator
|
3 |
##################
|
4 |
|
5 |
+
.. image:: ../assets/icon.jpg
|
6 |
:width: 100
|
7 |
:align: center
|
8 |
:alt: deep-translator-icon
|
|
|
125 |
|
126 |
.. code-block:: console
|
127 |
|
128 |
+
$ pip install -U deep-translator
|
129 |
|
130 |
take a look at the docs if you want to install from source.
|
131 |
|
|
|
135 |
|
136 |
.. code-block:: python
|
137 |
|
138 |
+
from deep-translator import GoogleTranslator
|
139 |
translated = GoogleTranslator(source='auto', target='de').translate("keep it up, you are awesome") # output -> Weiter so, du bist großartig
|
140 |
|
141 |
or using proxies:
|
142 |
|
143 |
.. code-block:: python
|
144 |
|
145 |
+
from deep-translator import GoogleTranslator
|
146 |
|
147 |
proxies_example = {
|
148 |
"https": "34.195.196.27:8080",
|
|
|
155 |
|
156 |
.. code-block:: console
|
157 |
|
158 |
+
$ deep-translator -trans "google" -src "en" -tg "de" -txt "keep it up, you are awesome"
|
159 |
|
160 |
|
161 |
=====
|
|
|
175 |
|
176 |
.. code-block:: python
|
177 |
|
178 |
+
from deep-translator import (GoogleTranslator,
|
179 |
MicrosoftTranslator,
|
180 |
PonsTranslator,
|
181 |
LingueeTranslator,
|
|
|
536 |
|
537 |
.. code-block:: python
|
538 |
|
539 |
+
from deep-translator import GoogleTranslator
|
540 |
|
541 |
# define your proxy configs:
|
542 |
proxies_example = {
|
|
|
551 |
Usage from Terminal
|
552 |
--------------------
|
553 |
|
554 |
+
Deep-translator supports a series of command line arguments for quick and simple access to the translators directly in your console.
|
|
|
|
|
555 |
|
556 |
+
.. note::
|
|
|
|
|
|
|
557 |
|
558 |
+
The program accepts ``deep-translator`` or ``dt`` as a command, feel free to substitute whichever you prefer.
|
559 |
|
560 |
+
For a list of available translators:
|
561 |
|
562 |
.. code-block:: console
|
563 |
|
564 |
+
$ deep-translator list
|
565 |
|
566 |
+
To translate a string or line of text:
|
567 |
|
568 |
.. code-block:: console
|
569 |
|
570 |
+
$ deep-translator google --source "english" --target "german" --text "happy coding"
|
571 |
|
572 |
+
Alternate short option names, along with using language abbreviations:
|
573 |
|
574 |
.. code-block:: console
|
575 |
|
576 |
+
$ deep-translator google -src "en" -tgt "de" -txt "happy coding"
|
577 |
|
|
|
|
|
|
|
578 |
|
579 |
+
Finally, to retrieve a list of available languages for a given translator:
|
580 |
|
581 |
.. code-block:: console
|
582 |
|
583 |
+
$ deep-translator languages google
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
584 |
|
585 |
+
======
|
586 |
+
Tests
|
587 |
+
======
|
588 |
|
589 |
+
Developers can install the development version of deep-translator and execute unit tests to verify functionality. For more information on doing this, see `the contribution guidelines <https://deep-translator.readthedocs.io/en/latest/contributing.html/>`_
|
590 |
|
591 |
========
|
592 |
Links
|
|
|
639 |
The Translator++ mobile app
|
640 |
===========================
|
641 |
|
642 |
+
.. image:: ../assets/app-icon.png
|
643 |
:width: 100
|
644 |
:alt: Icon of the app
|
645 |
|
646 |
|
647 |
+
After developing the deep-translator, I realized how cool this would be if I can use it as an app on my mobile phone.
|
648 |
Sure, there is google translate, pons and linguee apps etc.. but isn't it cooler to make an app where all these
|
649 |
translators are integrated?
|
650 |
|
|
|
654 |
Feel free to take a look at the code or make a pull request ;)
|
655 |
|
656 |
.. note::
|
657 |
+
The Translator++ app is based on the deep-translator package. I just built the app to prove the capabilities
|
658 |
+
of the deep-translator package ;)
|
659 |
|
660 |
I published the first release on google play store on 02-08-2020
|
661 |
|
|
|
663 |
|
664 |
- Phone
|
665 |
|
666 |
+
.. image:: ../assets/translator1.jpg
|
667 |
:width: 30%
|
668 |
:height: 200
|
669 |
:alt: screenshot1
|
670 |
+
.. image:: ../assets/translator2.jpg
|
671 |
:width: 30%
|
672 |
:height: 200
|
673 |
:alt: screenshot2
|
674 |
+
.. image:: ../assets/spinner.jpg
|
675 |
:width: 30%
|
676 |
:height: 200
|
677 |
:alt: spinner
|
678 |
|
679 |
- Tablet:
|
680 |
|
681 |
+
.. image:: ../assets/hz_view.png
|
682 |
:width: 100%
|
683 |
:height: 300
|
684 |
:alt: screenshot3
|
docs/authors.rst
CHANGED
@@ -1 +1,15 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=======
|
2 |
+
Credits
|
3 |
+
=======
|
4 |
+
|
5 |
+
Development Lead
|
6 |
+
----------------
|
7 |
+
|
8 |
+
* Nidhal Baccouri <[email protected]>
|
9 |
+
|
10 |
+
Contributors
|
11 |
+
------------
|
12 |
+
|
13 |
+
@prataffel
|
14 |
+
@senk8
|
15 |
+
@nothead31
|
docs/contributing.rst
CHANGED
@@ -1 +1,131 @@
|
|
1 |
-
..
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.. highlight:: shell
|
2 |
+
|
3 |
+
============
|
4 |
+
Contributing
|
5 |
+
============
|
6 |
+
|
7 |
+
Contributions are welcome, and they are greatly appreciated! Every little bit
|
8 |
+
helps, and credit will always be given.
|
9 |
+
|
10 |
+
You can contribute in many ways:
|
11 |
+
|
12 |
+
Types of Contributions
|
13 |
+
----------------------
|
14 |
+
|
15 |
+
Report Bugs
|
16 |
+
~~~~~~~~~~~
|
17 |
+
|
18 |
+
Report bugs at https://github.com/nidhaloff/deep_translator/issues.
|
19 |
+
|
20 |
+
If you are reporting a bug, please include:
|
21 |
+
|
22 |
+
* Your operating system name and version.
|
23 |
+
* Any details about your local setup that might be helpful in troubleshooting.
|
24 |
+
* Detailed steps to reproduce the bug.
|
25 |
+
* If the bug includes a tracelog, include that in your bug report. Remember on github, you can enclose code or console output in ``` insert code here ```.
|
26 |
+
|
27 |
+
Fix Bugs
|
28 |
+
~~~~~~~~
|
29 |
+
|
30 |
+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it.
|
31 |
+
|
32 |
+
Implement Features
|
33 |
+
~~~~~~~~~~~~~~~~~~
|
34 |
+
|
35 |
+
Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.
|
36 |
+
|
37 |
+
.. note::
|
38 |
+
|
39 |
+
You can contact @nothead31 or comment on the issue if you wish to be listed under 'Assigned'.
|
40 |
+
|
41 |
+
Write Documentation
|
42 |
+
~~~~~~~~~~~~~~~~~~~
|
43 |
+
|
44 |
+
deep_translator could always use more documentation, whether as part of the official deep_translator docs, in docstrings, or even on the web in blog posts, articles, and such. If you do a write-up on your own site, please let us know and we will add a link to it in the official documentation!
|
45 |
+
|
46 |
+
Submit Feedback
|
47 |
+
~~~~~~~~~~~~~~~
|
48 |
+
|
49 |
+
The best way to send feedback is to file an issue at https://github.com/nidhaloff/deep_translator/issues.
|
50 |
+
|
51 |
+
If you are proposing a feature:
|
52 |
+
|
53 |
+
* Explain in detail how it would work.
|
54 |
+
* Keep the scope as narrow as possible, to make it easier to implement.
|
55 |
+
* Remember that this is a volunteer-driven project, and that contributions
|
56 |
+
are welcome :)
|
57 |
+
|
58 |
+
Get Started!
|
59 |
+
------------
|
60 |
+
|
61 |
+
Ready to contribute? Here's how to set up `deep_translator` for local development.
|
62 |
+
|
63 |
+
1. Fork the `deep_translator` repo on GitHub.
|
64 |
+
2. Clone your fork locally::
|
65 |
+
|
66 |
+
$ git clone [email protected]:your_name_here/deep_translator.git
|
67 |
+
|
68 |
+
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
|
69 |
+
|
70 |
+
$ cd path/to/project
|
71 |
+
$ poetry shell
|
72 |
+
$ poetry install
|
73 |
+
|
74 |
+
.. note::
|
75 |
+
|
76 |
+
``poetry install`` will automatically install all package dependencies AND development dependencies. If you only want to run the package, append --no-dev to the command.
|
77 |
+
|
78 |
+
4. Create a branch for local development::
|
79 |
+
|
80 |
+
$ git checkout -b name-of-your-bugfix-or-feature
|
81 |
+
|
82 |
+
Now you can make your changes locally.
|
83 |
+
|
84 |
+
5. Ensure your changes are covered by test modules and that the tests pass with pytest before committing.
|
85 |
+
|
86 |
+
6. Commit your changes and push your branch to GitHub::
|
87 |
+
|
88 |
+
$ git add .
|
89 |
+
$ git commit -m "Your detailed description of your changes."
|
90 |
+
$ git push origin name-of-your-bugfix-or-feature
|
91 |
+
|
92 |
+
7. Submit a pull request through the GitHub website.
|
93 |
+
|
94 |
+
Pull Request Guidelines
|
95 |
+
-----------------------
|
96 |
+
|
97 |
+
Before you submit a pull request, check that it meets these guidelines:
|
98 |
+
|
99 |
+
1. The pull request should include any relevant tests (located under :file:`.deep_translator/tests`)
|
100 |
+
2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst.
|
101 |
+
3. Pull requests are automatically tested on GitHub for compatability with Python version 3.7, 3.8, and 3.9. Please review your test results and ensure your request passes all tests.
|
102 |
+
|
103 |
+
Tips
|
104 |
+
----
|
105 |
+
|
106 |
+
To run only certain tests::
|
107 |
+
|
108 |
+
$ pytest -ra
|
109 |
+
|
110 |
+
.. note::
|
111 |
+
|
112 |
+
will run all tests, excluding any that previously passed, and provides a simple test report.
|
113 |
+
|
114 |
+
$ pytest test_mod.py
|
115 |
+
|
116 |
+
.. note::
|
117 |
+
|
118 |
+
Runs only the tests in the named testing module. Useful for only testing a subset of functionality.
|
119 |
+
|
120 |
+
Deploying
|
121 |
+
---------
|
122 |
+
|
123 |
+
A reminder for the maintainers on how to deploy.
|
124 |
+
Make sure all your changes are committed (including an entry in HISTORY.rst).
|
125 |
+
Then run::
|
126 |
+
|
127 |
+
$ poetry version major|minor|patch
|
128 |
+
$ git push
|
129 |
+
$ git push --tags
|
130 |
+
|
131 |
+
After pushing a new version to the master branch, github will build a package and upload it to PyPI.
|
docs/history.rst
CHANGED
@@ -1 +1,20 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
==================
|
2 |
+
Important History
|
3 |
+
==================
|
4 |
+
|
5 |
+
- 1.5.0 improved cli functionality with streamlined commands and numerous bugfixes.
|
6 |
+
- 1.4.4 added support for papago, added opt params, fixed deepl free api
|
7 |
+
- 1.4.3 added support deepl free api
|
8 |
+
- 1.4.2 added proxy support
|
9 |
+
- 1.3.4 bug fixes for the dutch language
|
10 |
+
- 1.3.3 fixed bug in google translate
|
11 |
+
|
12 |
+
- 1.2.5: added support for the DeepL translator
|
13 |
+
- 1.2.4: added support for the QCRI translator
|
14 |
+
- 1.2.1: added support for the yandex translator
|
15 |
+
- 1.1.9: fixed bug in requests
|
16 |
+
- 1.1.5: added language detection
|
17 |
+
- 1.1.3: added support for mymemory
|
18 |
+
- 1.0.4: added support for pons
|
19 |
+
- 1.0.2: added support for linguee
|
20 |
+
- 1.0.0: added support for google translate
|
docs/readme.rst
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.. include:: ../README.rst
|
|
|
|