Skip to main content

DeeptransTool

License: GPLv3 Python 3.10 PyPi Package

The package is still under development, you may find serious bugs or features like the pdf translator still missing. Any serious bugs please let me know by discord!

Summary and details


The perfect module to make translations with no character limitations, no need to pay and no need to give your bank details to access the API of DeepL. Translate the main text files (soon also pdf's) or give the text directly!

To fulfill the purpose, we make use of Selenium and the browser Chrome therefore, it is *necessary to have the browser installed on your computer. If you are on windows, download the latest version, if you are on linux, we recommend you to download this version.

(v1.4) ¿What's New?


  • Apparently they changed the structure of how the deepl.com page is built, and therefore, the scrapper stopped working. It's fixed!

  • The scrapp system was changed in the text. We now use "Beautifulsoup4" which will prevent us from errors in the future!

Functions


- file_translate(route, string_characters, l_from, l_to, new_file, new_file_extension)

Use the world's "best translator" to translate files with python, and without API key.

  • Parameters:

    • route: STR | Path of the file to translate.

    • string_characters: INT | how many characters will contain the string to be translated (it is done by parts, by the limitation that has the same translator). Use at most 5000, and with margin of error.

    • l_from: STR | Language of origin. Generally the first acronym of the original language is used! An example of this is "Español", its acronym being "es". If you have any doubts about the acronym of your source or target language, check the website DeepL.

    • l_to: STR | Target Language. Generally the first acronym of the original language is used! An example of this is "English", its acronym being "en". If you have any doubts about the acronym of your source or target language, check the website DeepL.

    • new_file: BOOL | If you want the translation of the file to be done on a new one, you should activate this option.

    • new_file_extension: STR | If the previous option is True (new_file), you have to provide a valid file extension for the new file. If it is not provided, your new extension will be assumed to be txt.

- string_translate(text, string_characters, l_from, l_to)

Use the world's "best translator" to translate any text and make use of it, without any restrictions!

  • Parameters:

    • text: STR | Text to translate!

    • string_characters: INT | how many characters will contain the string to be translated (it is done by parts, by the limitation that has the same translator). Use at most 5000, and with margin of error.

    • l_from: STR | Language of origin. Generally the first acronym of the original language is used! An example of this is "Español", its acronym being "es".

    • l_to: STR | Target Language. Generally the first acronym of the original language is used! An example of this is "English", its acronym being "en".

  • Return: Return the text translate.

Installation and Use!


Installation:

To use this package, the best idea is to do it through pip:

pip install DeeptransTool

IT IS VERY IMPORTANT THAT THE "D" AND THE "T" ARE CAPITALIZED.

Or, on the contrary, you can clone this repository and access it:

git clone https://github.com/ElHaban3ro/DeeptransTool

This will create a folder of the project itself inside your python root project. Next we have to install the necessary dependencies for the project to work correctly, this can be done with:

pip install -r requirements.txt 

This would ideally have to install all the necessary libraries for you. This will be installed in the virtual environment of your project. See how to create a virtual environment here.

In addition to this, remember to have the Chrome browser installed on your device. Remember that, if you are on Windows, you should install the latest version, and if you are on linux, install the version that I leave in my repository (Any problem, contact me by Discord or Twitter).

Use:

To use this package of this form:

from DTT.deepLTranslate import file_translate


mi_traduccion = file_translate('C:/miruta/archivo.txt', 4999, 'es', 'en', True, 'srt')

Text Files Allow:

  • srt
  • txt
  • html
  • log
  • csv
  • pdf

¿more? Send it

Autor Contact


Contact Twitter Contact Discord Contact Discord

Metadata

Release files for DeeptransTool 1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for DeeptransTool 1.4
File Size Uploaded
DeeptransTool-1.4.tar.gz 21.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for DeeptransTool 1.4
File Interpreter ABI Platform
DeeptransTool-1.4-py3-none-any.whl Python 3 none any Details

Total release size: 42.2 kB

Release files / DeeptransTool-1.4.tar.gz

Download URL DeeptransTool-1.4.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
78af073df31d52e963437f67afa6b787bb59305acda5825034382b1037d8a140
BLAKE2b-256 checksum
How to use checksums
abdfbd0b87a5455d6578823dae7f458ed5b6e52e2940dcb31f7f6ac2042a3be4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / DeeptransTool-1.4-py3-none-any.whl

Download URL DeeptransTool-1.4-py3-none-any.whl
Size 20.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab9457cc39371e4605459b690e87a2d880a7c38ebb16c4a241fcc67dd3e8619b
BLAKE2b-256 checksum
How to use checksums
f13a651b7bb307338cac46d53207c0855f7560e620df5d859fb0850a2184c0e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

1.4 This release

2 release files

1.3

2 release files

1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page