pydu: Python 常用数据结构和工具库,欢迎你的加入!!!

2017-12-28 18:39:24 +08:00
 Prodesire
项目名称:
pydu

项目地址:
https://github.com/Prodesire/pydu

项目描述:
pydu ( python data structures and utils —— python 数据结构和工具)是一个面向 Python 2 和 3 的库。它收集自开源项目,也由贡献者创建。

示例代码:
英文版: http://pydu.readthedocs.io/en/latest/
中文版: http://pydu.readthedocs.io/zh/latest/

pydu 将平时常用的数据结构和工具都收录其中,可供日常开发使用,也可供学习借鉴。相比于 GitHub 上现存的 pyutils 等项目,其优势是积极维护,并有丰富文档。

现在,我们非常欢迎大家一起来提出想法、参与讨论、贡献代码,将平时常用的功能抽象为通用的工具集和数据结构,供大家学习或使用!
5220 次点击
所在节点    Python
43 条回复
agnewee
2017-12-28 19:02:37 +08:00
支持
Kylin30
2017-12-28 22:18:47 +08:00
先 star 为敬
Prodesire
2017-12-28 22:37:29 +08:00
@Kylin30 thanks
Prodesire
2017-12-28 22:38:27 +08:00
@agnewee 一起加油
mingyun
2017-12-28 23:22:51 +08:00
不支持 win 7
$ pip install pydu
Collecting pydu
Using cached pydu-0.3.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ADMINI~1\AppData\Local\Temp\pip-build-4i3oi1nh\pydu\setup.p
y", line 41, in <module>
long_description=open('README.rst').read(),
UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 1162: ill
egal multibyte sequence

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\ADMINI~1
\AppData\Local\Temp\pip-build-4i3oi1nh\pydu\
TuringGunner
2017-12-28 23:39:18 +08:00
支持一波,其实我觉得可以抛弃 python2 了
haiyangcn
2017-12-28 23:41:33 +08:00
stared
Prodesire
2017-12-28 23:50:02 +08:00
@mingyun 应该是 readme 中的中文引起的。请问是使用 Python2 还是 3 ?
Prodesire
2017-12-28 23:51:26 +08:00
@TuringGunner 主要是由于工作项目原因,还必须得支持 Python 2。 (逃
mingyun
2017-12-29 00:41:59 +08:00
lxml
2017-12-29 00:45:44 +08:00
建议使用 Gitbook 维护,readthedocs.io 阅读体验略逊
diggerdu
2017-12-29 03:03:27 +08:00
pythonds
264768502
2017-12-29 08:17:59 +08:00
est
2017-12-29 09:11:37 +08:00
https://github.com/Prodesire/pydu/blob/master/pydu/list.py

这个在 py3 里貌似就一句话

>>> list(dict.fromkeys('3938475638391'))
['3', '9', '8', '4', '7', '5', '6', '1']
DeTamble
2017-12-29 09:14:47 +08:00
Win 10, Python 3.6.3 安装失败。
pip install 错误信息和上面那位一样。
用本地文件安装同样失败:
[py36] PS E:\Download\pydu-master> python setup.py install
Traceback (most recent call last):
File "setup.py", line 41, in <module>
long_description=open('README.rst').read(),
UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 1162: illegal multibyte sequence

另外文档这里有三个 ipv6 写成 ipv4 了: https://pydu.readthedocs.io/zh/latest/network.html#pydu.network.is_ipv6
xpresslink
2017-12-29 09:19:08 +08:00
@est
如果要保证元素出现次序稳定,应该用
>>> from collections import OrderedDict
>>> OrderedDict.fromkeys('3938475638391').keys()
heaton_nobu
2017-12-29 09:48:19 +08:00
Network 里的 is_ipv6 部分没有改过来
swulling
2017-12-29 09:48:21 +08:00
基础库,尤其是数据结构,基础算法之类
没有一定的本事就别乱造轮子了……
est
2017-12-29 10:06:49 +08:00
@xpresslink python 3.6 以后的 dict 不会改变插入顺序了。

python2 的结果:

>>> list(dict.fromkeys('3938475638391'))
['1', '3', '5', '4', '7', '6', '9', '8']
est
2017-12-29 10:10:52 +08:00
@xpresslink .keys() 返回也不是 list 了。而是一个可以迭代的 view

https://www.python.org/dev/peps/pep-3106/

所以最后还是得 list() 一下。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/418389

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX