Skip to main content

baidu translate for free with async and proxy support

Project description

freemt-utils Python3.6|3.7 packageCodecovPyPI version

various utils for freemt

Update v.0.0.7

langcode_to_tmxcode: need (marisa-trie) and langcodes.

If you don't have VC in the system, you'll need to install a whl version of marisa-trie that can be downloaded from https://www.lfd.uci.edu/~gohlke/pythonlibs/#marisa-trie

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


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.1.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

freemt_utils-0.1.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file freemt-utils-0.1.0.tar.gz.

File metadata

  • Download URL: freemt-utils-0.1.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.25.1 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.7

File hashes

Hashes for freemt-utils-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3f7ecb4c98bc7ff02ffd2e2f76c65c4112018dc0256a22b66753baf520880c3c
MD5 b31858843fb53457f29eba54f032ab84
BLAKE2b-256 b1aaf63678342bd1905829c380697695763db6290cdfccca56ab213825aab32c

See more details on using hashes here.

File details

Details for the file freemt_utils-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: freemt_utils-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.12

File hashes

Hashes for freemt_utils-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7423612132dbbae929b6db25369a473831eb06e2350b116d18a67cb2890edc42
MD5 04803c5506c1ec7d512d288770170e53
BLAKE2b-256 404036568998d2e7e1c9b0fd98877cdfdcdf68b5ec5e413784eed5ca35be77c3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page