Utilities for handling Chinese pinyin
Project description
README.md
Utilities for handling Chinese pinyin
The utilities in this library make it easy to use Chinese pinyin
The unit tests are directly in the files and therefore serve as documentation of the utility functions in it. To execute the unit tests, you can just run:
pytest -s pinyin_utils.py
To get the library into a project:
pip install pinyin_utils
SYNOPSIS of pinyin_utils.py
coming soon
SYNOPSIS of translate.py
import os, time, trio, asks, pprint
from translate import translate, initDB, setApiKey
async def main():
# --- The database need not exist.
# Furthermore, if you leave out this call,
# the database will be put at ./Translations.db by default
initDB('./Translations.db')
# --- This env var key is the default if you leave this out
setApiKey(os.environ['GOOGLE_APIKEY'])
hWords = {
'cat': None,
'dog': None,
}
start_time = time.time()
async with trio.open_nursery() as nursery:
nursery.start_soon(translate, hWords)
total = time.time() - start_time
print(f"Total time: {total}")
pprint.PrettyPrinter(indent=3).pprint(hWords)
asks.init('trio')
trio.run(main)
# SYNOPSIS of tabdb.py
coming soon
# SYNOPSIS of englishWords.py
coming soon
# SYNOPSIS of ChineseDB.py
coming soon
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pinyin_utils-0.3.0.tar.gz.
File metadata
- Download URL: pinyin_utils-0.3.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad037076a2490f0593f7241028b77dda384e99b5aa06a9c91e83e581eb14588c
|
|
| MD5 |
02bab3d100aa4e8fd48557b5f17ddca8
|
|
| BLAKE2b-256 |
4229b44b487ffe4754639f52b6c847cb0e7bfcb89952d8cee5fc7b09dcb44aac
|
File details
Details for the file pinyin_utils-0.3.0-py3-none-any.whl.
File metadata
- Download URL: pinyin_utils-0.3.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e1219273cf9121b40732fd385b8e2dd7338b1c92a8e411ee802eb9cc287e7e8
|
|
| MD5 |
0626c43bc8f1bad8a2ad88a026bdaeeb
|
|
| BLAKE2b-256 |
d83f80747f76cf3251fb924d2fcab27d4df319539ac2f7ef3470215afea11b2d
|