0.0.189
This commit is contained in:
parent
9f917548fa
commit
c3d5d26197
@ -1,4 +1,4 @@
|
|||||||
# API Reference shows all functions in Guan package. The current version is guan-0.0.188, updated on December 07, 2023.
|
# API Reference shows all functions in Guan package. The current version is guan-0.0.189, updated on December 07, 2023.
|
||||||
|
|
||||||
import guan
|
import guan
|
||||||
|
|
||||||
@ -824,6 +824,9 @@ guan.statistics_with_day_and_time(content='', filename='a', file_format='.txt')
|
|||||||
# 统计Python文件中import的数量并排序
|
# 统计Python文件中import的数量并排序
|
||||||
import_statement_counter = guan.count_number_of_import_statements(filename, file_format='.py', num=1000)
|
import_statement_counter = guan.count_number_of_import_statements(filename, file_format='.py', num=1000)
|
||||||
|
|
||||||
|
# 根据一定的字符长度来分割文本
|
||||||
|
split_text_list = guan.split_text(text, wrap_width=3000)
|
||||||
|
|
||||||
# 从网页的标签中获取内容
|
# 从网页的标签中获取内容
|
||||||
content = guan.get_html_from_tags(link, tags=['title', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'li', 'a'])
|
content = guan.get_html_from_tags(link, tags=['title', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'li', 'a'])
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
# replace with your username:
|
# replace with your username:
|
||||||
name = guan
|
name = guan
|
||||||
version = 0.0.188
|
version = 0.0.189
|
||||||
author = guanjihuan
|
author = guanjihuan
|
||||||
author_email = guanjihuan@163.com
|
author_email = guanjihuan@163.com
|
||||||
description = An open source python package
|
description = An open source python package
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Metadata-Version: 2.1
|
Metadata-Version: 2.1
|
||||||
Name: guan
|
Name: guan
|
||||||
Version: 0.0.188
|
Version: 0.0.189
|
||||||
Summary: An open source python package
|
Summary: An open source python package
|
||||||
Home-page: https://py.guanjihuan.com
|
Home-page: https://py.guanjihuan.com
|
||||||
Author: guanjihuan
|
Author: guanjihuan
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Guan is an open-source python package developed and maintained by https://www.guanjihuan.com/about (Ji-Huan Guan, 关济寰). The primary location of this package is on website https://py.guanjihuan.com. GitHub link: https://github.com/guanjihuan/py.guanjihuan.com.
|
# Guan is an open-source python package developed and maintained by https://www.guanjihuan.com/about (Ji-Huan Guan, 关济寰). The primary location of this package is on website https://py.guanjihuan.com. GitHub link: https://github.com/guanjihuan/py.guanjihuan.com.
|
||||||
|
|
||||||
# The current version is guan-0.0.188, updated on December 07, 2023.
|
# The current version is guan-0.0.189, updated on December 07, 2023.
|
||||||
|
|
||||||
# Installation: pip install --upgrade guan
|
# Installation: pip install --upgrade guan
|
||||||
|
|
||||||
@ -3600,6 +3600,12 @@ def count_number_of_import_statements(filename, file_format='.py', num=1000):
|
|||||||
import_statement_counter = Counter(import_array).most_common(num)
|
import_statement_counter = Counter(import_array).most_common(num)
|
||||||
return import_statement_counter
|
return import_statement_counter
|
||||||
|
|
||||||
|
# 根据一定的字符长度来分割文本
|
||||||
|
def split_text(text, wrap_width=3000):
|
||||||
|
import textwrap
|
||||||
|
split_text_list = textwrap.wrap(text, wrap_width)
|
||||||
|
return split_text_list
|
||||||
|
|
||||||
# 从网页的标签中获取内容
|
# 从网页的标签中获取内容
|
||||||
def get_html_from_tags(link, tags=['title', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'li', 'a']):
|
def get_html_from_tags(link, tags=['title', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'li', 'a']):
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user