Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bounoable/deepl
DeepL Pro API client for Go.
https://github.com/bounoable/deepl
api client deepl glossary go golang pro translator
Last synced: about 3 hours ago
JSON representation
DeepL Pro API client for Go.
- Host: GitHub
- URL: https://github.com/bounoable/deepl
- Owner: bounoable
- License: mit
- Created: 2020-11-19T00:08:32.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-17T00:42:30.000Z (2 months ago)
- Last Synced: 2024-09-18T05:09:38.348Z (2 months ago)
- Topics: api, client, deepl, glossary, go, golang, pro, translator
- Language: Go
- Homepage:
- Size: 27.3 KB
- Stars: 21
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DeepL Pro API client
[![PkgGoDev](https://pkg.go.dev/badge/github.com/bounoable/deepl)](https://pkg.go.dev/github.com/bounoable/deepl)
Client library for the [**DeepL Pro API**](https://deepl.com).
## Installation
```sh
go get github.com/bounoable/deepl
```## Usage
See the [examples](./example_test.go).
```go
import (
"github.com/bounoable/deepl"
)client := deepl.New("your-auth-key")
translated, sourceLang, err := client.Translate(
context.TODO(),
"Hello, world",
deepl.Chinese,
)
if err != nil {
log.Fatal(err)
}log.Println(fmt.Sprintf("source language: %s", sourceLang))
log.Println(translated)
```## Testing
You can test the library against the real DeepL API by running the following command.
**CAUTION: Runnning these tests will add to your usage and therefore will be billed!**
```sh
make e2e-test authKey=YOUR_AUTH_KEY
```## License
[MIT](./LICENSE)