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

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

Uploaded Source

Built Distribution

freemt_utils-0.0.6-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: freemt-utils-0.0.6.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.10

File hashes

Hashes for freemt-utils-0.0.6.tar.gz
Algorithm Hash digest
SHA256 df928f19d3f22335e1c275fae776b20168f0264363f6c8eac47d6c9f55fcf727
MD5 338e2769c7dd2379a63f9bdfff07a83d
BLAKE2b-256 f71762d4468662a11918b6e0db53217a386f43f15cfda0efe4e74bf2aa15e926

See more details on using hashes here.

File details

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

File metadata

  • Download URL: freemt_utils-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.10

File hashes

Hashes for freemt_utils-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e56348e3bf53e7380dca25a05d2e3393b000abe62fb5119b323cc054c2a0fbdf
MD5 db18c02f5651ccc8046890bf37168826
BLAKE2b-256 40257259b9f3970716815a278a9fca508735f05a94b439b82bc13b6589f4a450

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