-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add user agent string for http request
- Loading branch information
Showing
6 changed files
with
128 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2016-2099 Ailemon.net | ||
# | ||
# This file is part of ASRT Speech Recognition Tool Python SDK. | ||
# | ||
# ASRT is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# ASRT is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with ASRT. If not, see <https://www.gnu.org/licenses/>. | ||
# ============================================================================ | ||
|
||
'''@package processing | ||
ASRT is a high-level deep learning API for speech recognition, | ||
written in Python and capable of running on top of | ||
Keras, TensorFlow, or MxNet. | ||
Use ASRT if you need a deep learning library that: | ||
- Allows for easy and fast prototyping for speech recognition | ||
(through user friendliness, modularity, and extensibility). | ||
- Supports both Keras and other Deep learning framework(on future). | ||
- Runs seamlessly on CPU and GPU. | ||
- Contains a api server module for developers to test models easily. | ||
Read the documentation at: https://github.com/nl8590687/ASRT_SpeechRecognition/wiki | ||
For a detailed overview of what makes ASRT special, see: | ||
https://asrt.ailemon.me | ||
ASRT is compatible with Python 3.0-3.9 | ||
and is distributed under the GPL v3.0 license. | ||
''' | ||
|
||
from .http import get_http_session |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2016-2099 Ailemon.net | ||
# | ||
# This file is part of ASRT Speech Recognition Tool Python SDK. | ||
# | ||
# ASRT is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# ASRT is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with ASRT. If not, see <https://www.gnu.org/licenses/>. | ||
# ============================================================================ | ||
|
||
""" | ||
@author: nl8590687 | ||
ASRT语音识别Python SDK HTTP库模块 | ||
""" | ||
|
||
import platform | ||
import requests | ||
from ..version import __version__ | ||
|
||
|
||
_HTTP_USER_AGENT = '%s%s%s%s%s' % ("ASRT-SDK client/", __version__, | ||
" (python", platform.python_version(), ") (https://asrt.ailemon.net/)") | ||
|
||
|
||
def get_http_session(): | ||
''' | ||
Get a http request session | ||
''' | ||
sess=requests.Session() | ||
sess.headers.update({"User-Agent":_HTTP_USER_AGENT}) | ||
return sess |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2016-2099 Ailemon.net | ||
# | ||
# This file is part of ASRT Speech Recognition Tool Python SDK. | ||
# | ||
# ASRT is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# ASRT is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with ASRT. If not, see <https://www.gnu.org/licenses/>. | ||
# ============================================================================ | ||
|
||
'''@package processing | ||
ASRT is a high-level deep learning API for speech recognition, | ||
written in Python and capable of running on top of | ||
Keras, TensorFlow, or MxNet. | ||
Use ASRT if you need a deep learning library that: | ||
- Allows for easy and fast prototyping for speech recognition | ||
(through user friendliness, modularity, and extensibility). | ||
- Supports both Keras and other Deep learning framework(on future). | ||
- Runs seamlessly on CPU and GPU. | ||
- Contains a api server module for developers to test models easily. | ||
Read the documentation at: https://github.com/nl8590687/ASRT_SpeechRecognition/wiki | ||
For a detailed overview of what makes ASRT special, see: | ||
https://asrt.ailemon.me | ||
ASRT is compatible with Python 3.0-3.9 | ||
and is distributed under the GPL v3.0 license. | ||
''' | ||
|
||
__version__ = '1.1.2' |
This file contains 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