Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
deepl-api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rausch, Fabian
deepl-api
Commits
4e469fb9
Commit
4e469fb9
authored
4 years ago
by
Fabian Rausch
Browse files
Options
Downloads
Patches
Plain Diff
Dockerized and documented
parent
a8530b58
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Dockerfile
+12
-0
12 additions, 0 deletions
Dockerfile
README.md
+15
-0
15 additions, 0 deletions
README.md
deepl_api.py
+1
-1
1 addition, 1 deletion
deepl_api.py
requirements.txt
+2
-0
2 additions, 0 deletions
requirements.txt
with
30 additions
and
1 deletion
Dockerfile
0 → 100644
+
12
−
0
View file @
4e469fb9
FROM
python:3.8-buster
COPY
requirements.txt requirements.txt
RUN
pip
install
-r
requirements.txt
COPY
auth_key auth_key
COPY
deepl_api.py deepl_api.py
EXPOSE
5000
ENTRYPOINT
["python"]
CMD
["deepl_api.py"]
This diff is collapsed.
Click to expand it.
README.md
0 → 100644
+
15
−
0
View file @
4e469fb9
# DeepL API
This service receives a string to translate and returns the translation in the desired language.
This service is part of the
[
Related Items project
](
https://gitlab.rrz.uni-hamburg.de/bay1620/wilps-related-items/
)
.
## Local Setup from repository
Due to the secret AUTH KEY there is no possibility here to use an image from Docker Hub. You have to follow these instructions instead:
-
Create a file named 'auth_key' in this folder
-
Put your AUTH KEY from DeepL Pro into the file (nothing else)
-
Build the Docker image from this folder:
`docker build -t deepl-api .`
-
Run the Docker container:
`docker run -p 6061:5050 deepl-api`
## Usage
You can use them - for example using curl - as follows:
-
`curl -F text="Guten Abend" -F target_lang=EN -X POST http://0.0.0.0:5050/translate`
This diff is collapsed.
Click to expand it.
deepl_api.py
+
1
−
1
View file @
4e469fb9
...
...
@@ -21,4 +21,4 @@ def get_abstracts_for_query_srf_api():
return
get_translation
(
text
,
target_lang
)
app
.
config
[
'
JSON_AS_ASCII
'
]
=
False
app
.
run
(
host
=
"
0.0.0.0
"
,
port
=
int
(
"
6061
"
),
debug
=
True
)
\ No newline at end of file
app
.
run
(
host
=
"
0.0.0.0
"
,
port
=
int
(
"
5050
"
),
debug
=
True
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
requirements.txt
0 → 100644
+
2
−
0
View file @
4e469fb9
requests
flask
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment