11# Lingo.dev Python SDK
22
3+ > 💬 ** [ Join our Discord community] ( https://lingo.dev/go/discord ) ** for support, discussions, and updates!
4+
35[ ![ PyPI version] ( https://badge.fury.io/py/lingodotdev.svg )] ( https://badge.fury.io/py/lingodotdev )
46[ ![ Python support] ( https://img.shields.io/pypi/pyversions/lingodotdev )] ( https://pypi.org/project/lingodotdev/ )
57[ ![ License] ( https://img.shields.io/badge/License-Apache%202.0-blue.svg )] ( https://opensource.org/licenses/Apache-2.0 )
@@ -31,10 +33,7 @@ from lingodotdev import LingoDotDevEngine
3133
3234# Initialize the engine
3335engine = LingoDotDevEngine({
34- ' api_key' : ' your-api-key-here' ,
35- ' api_url' : ' https://engine.lingo.dev' , # Optional, defaults to this URL
36- ' batch_size' : 25 , # Optional, defaults to 25
37- ' ideal_batch_item_size' : 250 # Optional, defaults to 250
36+ ' api_key' : ' your-api-key-here'
3837})
3938
4039# Localize a simple text
@@ -82,9 +81,6 @@ engine = LingoDotDevEngine(config)
8281** Parameters:**
8382- ` config ` (dict): Configuration dictionary with the following options:
8483 - ` api_key ` (str, required): Your Lingo.dev API key
85- - ` api_url ` (str, optional): API endpoint URL (default: ` https://engine.lingo.dev ` )
86- - ` batch_size ` (int, optional): Maximum number of items per batch (default: 25, max: 250)
87- - ` ideal_batch_item_size ` (int, optional): Target size for batch items (default: 250, max: 2500)
8884
8985#### Methods
9086
@@ -95,10 +91,9 @@ Localize a single text string.
9591** Parameters:**
9692- ` text ` (str): The text to localize
9793- ` params ` (dict): Localization parameters
98- - ` source_locale ` (str, optional): Source language code (e.g., 'en')
99- - ` target_locale ` (str, required): Target language code (e.g., 'es')
100- - ` fast ` (bool, optional): Enable fast mode for better performance on larger batches
101- - ` progress_callback ` (callable, optional): Progress callback function
94+ - ` source_locale ` (str): Source language code (e.g., 'en')
95+ - ` target_locale ` (str): Target language code (e.g., 'es')
96+ - ` progress_callback ` (callable): Progress callback function
10297
10398** Returns:** ` str ` - The localized text
10499
@@ -108,8 +103,7 @@ result = engine.localize_text(
108103 " Welcome to our application" ,
109104 {
110105 ' source_locale' : ' en' ,
111- ' target_locale' : ' es' ,
112- ' fast' : True
106+ ' target_locale' : ' es'
113107 }
114108)
115109```
@@ -121,7 +115,7 @@ Localize a Python dictionary with string values.
121115** Parameters:**
122116- ` obj ` (dict): The object to localize
123117- ` params ` (dict): Localization parameters (same as ` localize_text ` )
124- - ` progress_callback ` (callable, optional ): Progress callback function
118+ - ` progress_callback ` (callable): Progress callback function
125119
126120** Returns:** ` dict ` - The localized object with the same structure
127121
@@ -151,9 +145,8 @@ Localize a text string to multiple target languages.
151145** Parameters:**
152146- ` text ` (str): The text to localize
153147- ` params ` (dict): Batch localization parameters
154- - ` source_locale ` (str, required): Source language code
155- - ` target_locales ` (list, required): List of target language codes
156- - ` fast ` (bool, optional): Enable fast mode
148+ - ` source_locale ` (str): Source language code
149+ - ` target_locales ` (list): List of target language codes
157150
158151** Returns:** ` list ` - List of localized strings in the same order as target_locales
159152
@@ -163,8 +156,7 @@ results = engine.batch_localize_text(
163156 " Welcome to our platform" ,
164157 {
165158 ' source_locale' : ' en' ,
166- ' target_locales' : [' es' , ' fr' , ' de' , ' it' ],
167- ' fast' : True
159+ ' target_locales' : [' es' , ' fr' , ' de' , ' it' ]
168160 }
169161)
170162```
@@ -303,23 +295,6 @@ result = engine.localize_object(
303295)
304296```
305297
306- ### Configuration Options
307-
308- ``` python
309- # Optimized for large batches
310- engine = LingoDotDevEngine({
311- ' api_key' : ' your-api-key' ,
312- ' batch_size' : 100 , # Larger batches
313- ' ideal_batch_item_size' : 1000 # Larger items per batch
314- })
315-
316- # Optimized for small, frequent requests
317- engine = LingoDotDevEngine({
318- ' api_key' : ' your-api-key' ,
319- ' batch_size' : 10 , # Smaller batches
320- ' ideal_batch_item_size' : 100 # Smaller items per batch
321- })
322- ```
323298
324299## Development
325300
@@ -408,4 +383,8 @@ This project uses automated semantic releases:
408383
409384## Changelog
410385
411- See [ CHANGELOG.md] ( CHANGELOG.md ) for a detailed history of changes.
386+ See [ CHANGELOG.md] ( CHANGELOG.md ) for a detailed history of changes.
387+
388+ ---
389+
390+ > 💬 ** [ Join our Discord community] ( https://lingo.dev/go/discord ) ** for support, discussions, and updates!
0 commit comments