Skip to main content

some useful functions for python

Project description

https://travis-ci.org/chinapnr/fishbase.svg?branch=master https://coveralls.io/repos/github/chinapnr/fishbase/badge.svg?branch=master https://readthedocs.org/projects/fishbase/badge/?version=latest https://ci.appveyor.com/api/projects/status/ecskod12wy8fvkxu?svg=true

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


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)

Uploaded Source

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