Last active
June 8, 2022 01:46
-
-
Save groupdocscloud/a8f3182d5ec6edb3b9dbc847acd5c097 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GroupDocs.Translation Cloud-Python |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from groupdocstranslationcloud.configuration import Configuration | |
from groupdocstranslationcloud.api.storage_api import StorageApi | |
# enter valid client_secret and client_id | |
configuration = Configuration(client_secret="", client_id="") | |
# enter source and destination paths | |
src = "" | |
dest = "" | |
api = StorageApi(configuration) | |
api.copy_file(src, dest) | |
print(api.object_exists(dest)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from groupdocstranslationcloud.configuration import Configuration | |
from groupdocstranslationcloud.api.storage_api import StorageApi | |
# enter valid client_secret and client_id | |
configuration = Configuration(client_secret="", client_id="") | |
# enter path to source and destination folders | |
src = "" | |
dest = "" | |
api = StorageApi(configuration) | |
api.copy_folder(src, dest) | |
print(api.object_exists(dest)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from groupdocstranslationcloud.configuration import Configuration | |
from groupdocstranslationcloud.api.storage_api import StorageApi | |
# enter valid client_secret and client_id | |
configuration = Configuration(client_secret="", client_id="") | |
# enter path to folder | |
folder = "" | |
api = StorageApi(configuration) | |
api.create_folder(folder) | |
print(api.object_exists(folder)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from groupdocstranslationcloud.configuration import Configuration | |
from groupdocstranslationcloud.api.storage_api import StorageApi | |
# enter valid client_secret and client_id | |
configuration = Configuration(client_secret="", client_id="") | |
# enter path to file | |
path = "" | |
api = StorageApi(configuration) | |
api.delete_file(path) | |
print(api.object_exists(path)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from groupdocstranslationcloud.configuration import Configuration | |
from groupdocstranslationcloud.api.storage_api import StorageApi | |
# enter valid client_secret and client_id | |
configuration = Configuration(client_secret="", client_id="") | |
# enter path to folder | |
folder = "" | |
api = StorageApi(configuration) | |
api.delete_folder(folder) | |
print(api.object_exists(folder)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from groupdocstranslationcloud.configuration import Configuration | |
from groupdocstranslationcloud.api.storage_api import StorageApi | |
# enter valid client_secret and client_id | |
configuration = Configuration(client_secret="", client_id="") | |
# enter path to file on storage | |
path = "" | |
api = StorageApi(configuration) | |
res = api.download_file(path) | |
print(res) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from groupdocstranslationcloud.configuration import Configuration | |
from groupdocstranslationcloud.api.storage_api import StorageApi | |
# enter valid client_secret and client_id | |
configuration = Configuration(client_secret="", client_id="") | |
# enter path to file on storage | |
path = "" | |
api = StorageApi(configuration) | |
res = api.get_file_versions(path) | |
print(res) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from groupdocstranslationcloud.configuration import Configuration | |
from groupdocstranslationcloud.api.storage_api import StorageApi | |
# enter valid client_secret and client_id | |
configuration = Configuration(client_secret="", client_id="") | |
# enter path to folder | |
folder = "" | |
api = StorageApi(configuration) | |
res = api.get_files_list(folder) | |
print(res) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from groupdocstranslationcloud.configuration import Configuration | |
from groupdocstranslationcloud.api.storage_api import StorageApi | |
# enter valid client_secret and client_id | |
configuration = Configuration(client_secret="", client_id="") | |
# enter source and destination paths | |
src = "" | |
dest = "" | |
api = StorageApi(configuration) | |
api.move_file(src, dest) | |
print(api.object_exists(dest)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from groupdocstranslationcloud.configuration import Configuration | |
from groupdocstranslationcloud.api.storage_api import StorageApi | |
# enter valid client_secret and client_id | |
configuration = Configuration(client_secret="", client_id="") | |
# enter path to source and destination folders | |
src = "" | |
dest = "" | |
api = StorageApi(configuration) | |
api.move_folder(src, dest) | |
print(api.object_exists(dest)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from groupdocstranslationcloud.configuration import Configuration | |
from groupdocstranslationcloud.api.storage_api import StorageApi | |
# enter valid client_secret and client_id | |
configuration = Configuration(client_secret="", client_id="") | |
# enter path to file or folder on storage | |
path = "" | |
api = StorageApi(configuration) | |
res = api.object_exists(path) | |
print(res) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from groupdocstranslationcloud.configuration import Configuration | |
from groupdocstranslationcloud.api.storage_api import StorageApi | |
# enter valid client_secret and client_id | |
configuration = Configuration(client_secret="", client_id="") | |
api = StorageApi(configuration) | |
res = api.get_disc_usage() | |
print(res) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from groupdocstranslationcloud.configuration import Configuration | |
from groupdocstranslationcloud.api.storage_api import StorageApi | |
# enter valid client_secret and client_id | |
configuration = Configuration(client_secret="", client_id="") | |
# enter storage name | |
storage = "" | |
api = StorageApi(configuration) | |
res = api.storage_exists(storage) | |
print(res) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from groupdocstranslationcloud.configuration import Configuration | |
from groupdocstranslationcloud.api.translation_api import TranslationApi | |
from groupdocstranslationcloud.models.translate_text import TranslateText | |
from groupdocstranslationcloud.models.translate_document import TranslateDocument | |
# enter valid client_secret and client_id | |
configuration = Configuration(client_secret="", client_id="") | |
# enter language pair, file format (its extennsion), storage name, file name, folder(s) name, | |
# folder(s) where to save translated file and translated file name | |
pair = "" | |
_format = "" | |
outformat = "" | |
storage = "" | |
name = "t" | |
folder = "" | |
savepath = "" | |
savefile = "" | |
masters = False | |
elements = list() | |
# creating body of request | |
translator = TranslateDocument(pair, _format, outformat, storage, name, folder, savepath, savefile, masters, elements) | |
request = translator.to_string() | |
#perform API call | |
api = TranslationApi(configuration) | |
res = api.post_translate_document(request) | |
print(res.message) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from groupdocstranslationcloud.configuration import Configuration | |
from groupdocstranslationcloud.api.translation_api import TranslationApi | |
from groupdocstranslationcloud.models.translate_text import TranslateText | |
from groupdocstranslationcloud.models.translate_document import TranslateDocument | |
# enter valid client_secret and client_id | |
configuration = Configuration(client_secret="", client_id="") | |
# enter language pair and text to translate | |
pair = "" | |
text = "" | |
# creating body of request | |
translator = TranslateText(pair, text) | |
request = translator.to_string() | |
#perform API call | |
api = TranslationApi(configuration) | |
res = api.post_translate_text(request) | |
print(res.translation) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from groupdocstranslationcloud.configuration import Configuration | |
from groupdocstranslationcloud.api.storage_api import StorageApi | |
# enter valid client_secret and client_id | |
configuration = Configuration(client_secret="", client_id="") | |
# enter local path to file and path where to save file on storage | |
src = "" | |
dest = "" | |
api = StorageApi(configuration) | |
res = api.upload_file(dest, src) | |
print(res) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wich will be path in download file?