產生隨機英文名稱或英文名稱的中文翻譯
Project description
SampleName
產生隨機英文名稱或英文名稱的中文翻譯, 寫範例程式時可以用
名稱清單
Install
pip install SampleName
Methods
- listCustom() - 從自訂清單隨機挑選不重複的
- listNameEng() - 隨機取得男生/女生英文名字
- listNameCht() - 隨機取得男生/女生英文名字翻譯
- listMaleNameEng() - 隨機取得男生英文名稱
- listMaleNameCht() - 隨機取得男生英文名字翻譯
- listFemaleNameEng() - 隨機取得女生英文名字
- listFemaleNameCht() - 隨機取得女生英文名字翻譯
Using
建立物件
from sampleName import SampleName
smapleName = SampleName()
隨機取出 8 筆名稱 (預設 8 筆)
# 取出隨機男性/女性 英文 名稱
nameList = smapleName.listNameEng()
print(nameList)
# ['Kate', 'Cedric', 'Adrian', 'Yuri', 'Lara', 'Mildred', 'Craig', 'Oswald']
# 取出隨機男性/女性 中文 名稱
nameList = smapleName.listNameCht()
print(nameList)
# ['海頓', '藍道夫', '吉羅德', '妮可拉', '阿爾瓦', '比尤萊', '伊蒂絲', '珀莉']
隨機取出自訂筆數名稱
# 取出 4 筆女性英文名稱
nameList = smapleName.listFemaleNameEng(4)
print(nameList)
# ['Elizabeth', 'Irene', 'Candice', 'Myra']
# 取出 5 筆男性英文名稱翻譯
nameList = smapleName.listMaleNameCht(5)
print(nameList)
# ['班森', '愛格伯特', '扎威爾', '凱利', '菲力克斯']
從自訂清單內取得隨機名稱
nameList = ["愛爾默", "妮可拉", "特麗莎布藍達", "伯頓", "若娜"]
smapleName = SampleName(l)
nameList = smapleName.listCustom(2)
print(nameList)
# ['特麗莎布藍達', '愛爾默']
載入自訂名稱檔案
# nameList.json 內容
# ["愛爾默", "妮可拉", "特麗莎布藍達", "伯頓", "若娜"]
nameFile = 'nameList.json'
smapleName = SampleName(nameFile)
nameList = smapleName.listCustom(2)
print(nameList)
# ['妮可拉', '愛爾默']
Development
- VSCode
- 開發環境佈置 Remote-Containers
- 執行 remote container 會自動安裝 flake8, yapf 套件, 以及 pytest
- 單元測試, 執行
pytest
- release 後會自動上傳到 PyPI, 版本號會用 tag
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
SampleName-0.1.0.tar.gz
(16.0 kB
view details)
Built Distribution
File details
Details for the file SampleName-0.1.0.tar.gz
.
File metadata
- Download URL: SampleName-0.1.0.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c425fc7acd9a169229693c0530ca98164bf9f6c45718fd46da89d3387363776 |
|
MD5 | d3038aeee02d299b120b01d9efd04a2c |
|
BLAKE2b-256 | 5f1296c939fe7d62f381c46fe7d2e19c44b0ef102a968c424bd3842f2a4adf84 |
File details
Details for the file SampleName-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: SampleName-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e26d0cc69f9eb19d790aea8a72f889931337e3430ffa0d3091fa39302f8597ca |
|
MD5 | 0cb145d40c7d8ebbe6134aa6bbeae97c |
|
BLAKE2b-256 | fe33dc8f2b3e40e5072bdf5b2a2abc97661d8c447283a4e1210fd1baa9a0476e |