Skip to main content

Translate Jupyter Notebooks using Google Translate

Project description

JUPYTER-TRANSLATION

Translate your Jupyter notebooks from the command line or in a Python script.

PyPI Version License MIT Python 3

--

Installation

Create and activate a virtual environment and then install jupyter-translation:

$ pip install jupyter-translation

---> 100%

Usage

jupyter-translation in the command line

$ jupyter-translation input_notebook.ipynb

or

$ python -m jupyter_translation input_notebook.ipynb

It translates input_notebook.ipynb from French to English. The result is a file named input_notebook_en.ipynb.

Get help with this command :

$ jupyter-translation --help

or

$ python -m jupyter_translation --help

jupyter-translation in a Python script

import asyncio

from jupyter_translation import translate_single_notebook, translate_multiple_notebooks


# Translate one notebook from Spanish to English.
asyncio.run(
        translate_single_notebook(
            input_files="input_notebook.ipynb", 
            output_path="translated_notebook.ipynb",
            src_lang='es',
            dest_lang='en'
            )
    )

# Translate multiple notebooks. Default translation is from French to English.
asyncio.run(translate_multiple_notebooks("input_notebook1.ipynb", "input_notebook2.ipynb"))

License

This project is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyter_translation-0.1.3.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupyter_translation-0.1.3-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file jupyter_translation-0.1.3.tar.gz.

File metadata

  • Download URL: jupyter_translation-0.1.3.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.18

File hashes

Hashes for jupyter_translation-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b03ebe786e3aff211532ce42f83441c4d321623bfcd998c086769bee0fc1875d
MD5 33cdf9697f0afc2a51ab3fbbc7de51fd
BLAKE2b-256 027d79806bb9e962692f028e2a51e1b879e8f5440f87991c3abc72e020f9ae32

See more details on using hashes here.

File details

Details for the file jupyter_translation-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_translation-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d4836d389fd39f49e03070e966f08f299aaa0da80586f65b3f2c61852e813ed2
MD5 398dd048645b66c8c6d78a2580ea7616
BLAKE2b-256 e43cfe199fe40ec2fdaf2646e2b456dbdb5df4eef0941ed12fdad826c0c3b3ce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page