some useful functions for python
Project description
fishbase 是什么?
fishbase 是由我们自主开发、整理的一套 Python 基础函数库。
怎么用?
# 通过 pip 进行安装或者更新
pip install -U fishbase
fishbase 能干什么?
生成手机号
>>> from fishbase.fish_random import gen_mobile
>>> # 随机生成一个手机号
>>> print(gen_mobile())
188****3925
取名字
>>> from fishbase.fish_random import gen_name
>>> # 随机生成一个姓名
>>> print(gen_name())
师*
>>> # 随机生成一个姓名,姓赵/男孩/3个字
>>> gen_name("赵","01", 3)
赵**
找电影
>>> from fishbase.fish_common import find_files
>>> # 获取当前路径下的 mp4 文件
>>> print(find_files(".", [".mp4"]))
创建项目结构
>>> import os
>>> from fishbase.fish_project import init_project_by_yml
>>> package_yml = '''
... project: hellopackage
... tree:
... - README.md
... - requirements.txt
... - setup.py
... '''
>>> # 通过 yml 文件创建一个项目结构
>>> init_project_by_yml(package_yml, '.')
>>> print(os.listdir('./hellopackage'))
['requirements.txt', 'README.md', 'setup.py']
甚至可以“查户口”
>>> from fishbase.fish_data import check_id_number
>>> # 简单校验身份证号
>>> print(check_id_number('320124198701010012'))
(False,)
更多
想看看我们还实现了些啥?请戳这里:http://fishbase.readthedocs.io/
如果您有好点子,希望我们帮忙实现,请戳这里:https://github.com/chinapnr/fishbase/issues
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
fishbase-1.1.5.tar.gz
(258.8 kB
view hashes)