baidu translate for free with async and proxy support
Project description
freemt-utils
various utils for freemt
Installation
pip install freemt-utils
Validate installation
python -c "import freemt_utils; print(freemt_utils.__version__)"
0.0.1
Usage
from pathlib import Path
import asyncio
from freemt_utils import save_tempfile, switch_to, httpx_get, make_url, arun, fetch_proxies, logger_level
with switch_to():
print(Path.cwd()) # home dir
print(Path.cwd()) # back to the current work directory
try:
arun(httpx_get('www.baidu.com'))
except Exception as exc:
print(exc) # InvalidURL: No scheme included in URL.
res = arun(httpx_get(make_url('www.baidu.com')))
print(res.headers)
# Headers([('bdpagetype', '1'), ('bdqid',...
logger_level('info')
res.encoding = 'UTF-8'
save_tempfile(res.text) # display res.text in the default browser
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
freemt-utils-0.0.4.tar.gz
(6.5 kB
view hashes)
Built Distribution
Close
Hashes for freemt_utils-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c703f840dd2a00636c4dcfc85ff03ac1055630fa7f85ab2f09efb01810c5304 |
|
MD5 | 2fbba18e857bd11183eb21466c07b1b0 |
|
BLAKE2b-256 | a88c53d7a78cf5b129050809e9aa12371cd683271484b4104d0af1b63288610f |