https://github.com/zengbin93/zb
Personal established tools and implement of algorithm.
https://github.com/zengbin93/zb
Last synced: about 1 year ago
JSON representation
Personal established tools and implement of algorithm.
- Host: GitHub
- URL: https://github.com/zengbin93/zb
- Owner: zengbin93
- License: apache-2.0
- Created: 2017-10-31T06:57:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-11-12T09:08:11.000Z (over 5 years ago)
- Last Synced: 2025-03-27T21:51:59.454Z (about 1 year ago)
- Language: Python
- Size: 1.11 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zb
[`zb`](https://pypi.org/project/zb/) is a python module, which contains some
tools and algorithm implemented by myself.
If you are interested in this module, you can install it by `pip install zb`.
安装:`pip install zb -U -i https://pypi.python.org/simple`
## Tools
* Modify Dict
```python
from zb import AttrDict, OrderedAttrDict
# AttrDict is a dict that can get attribute by dot
d1 = AttrDict(x=1, y=2)
print(d1, '\n', d1.x, d1.y)
# OrderedAttrDict is same as AttrDict, but items are ordered
d2 = OrderedAttrDict(x=1, y=2)
print(d2, '\n', d2.x, d2.y)
```
* extract text from pdf file - `zb.tools.pdf.pdf2text`
```python
from zb.tools import pdf2text
pdf_path = "test.pdf"
pdf_url = "http://www.cninfo.com.cn/cninfo-new/disclosure/szse/download/1205276701?announceTime=2018-08-11"
text = pdf2text(pdf_path)
```