semvec/pypi-packages huggingface dataset:
zingmp3py 0.3.3
A light weight Python library for the ZingMp3 API

# zingmp3py
[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com)
#### A light weight Python library for the ZingMp3 API
##### *all functions are return dict or ZingMp3 Object

# install 

## pypi
```
pip install zingmp3py
```

## Git (version in development)
```
pip install git+https://github.com/thedtvn/zingmp3py.git
```


# Sync :
```py
from zingmp3py import ZingMp3

zi = ZingMp3()
# login is not required 
zi.login("zpsid cookies")
zi.getDetailPlaylist("67ZFO8DZ")
zi.getDetailArtist("Cammie")
zi.getRadioInfo("IWZ979CW")
zi.getSongInfo("ZWAF6UFD")
zi.getSongStreaming("ZWAF6UFD")
zi.getTop100()
zi.search("rick roll")
```

# Async
```py
import asyncio
from zingmp3py import ZingMp3Async

async def main():
    zi = ZingMp3Async()
    # login is not required 
    await zi.login("zpsid cookies")
    await zi.getDetailPlaylist("67ZFO8DZ")
    await zi.getDetailArtist("Cammie")
    await zi.getSongInfo("ZWAF6UFD")
    await zi.getSongStreaming("ZWAF6UFD")
    await zi.getTop100()
    await zi.search("rick roll")

asyncio.run(main())
```

## how to get zpsid cookies

go to https://id.zalo.me/account/logininfo then check f12 go to tab application go to cookies and check for cookie name zpsid

note: please check check you are login or not by check key  `logged` in json return in that url is `true`

## Get Type And ID

```py
from zingmp3py import getUrlTypeAndID

getUrlTypeAndID("https://zingmp3.vn/liveradio/IWZ979CW.html")
```
peduncle 0.0.2
Simple Python content extractor for html
Requires Python: >=3.7

# peduncle

very very very simple DOM based HTML content extraction tool, get rid of boilerplate dressing of a web page[1].

easy but useable

work with python 3.7+



[1] the word comes from [dragnet](https://github.com/dragnet-org/dragnet).

## install

```shell
pip install peduncle
```

## usage

```Python
import requests
from peduncle.peduncle import extract_text

# obtain the raw html
url="https://blog.rust-lang.org/2023/05/29/RustConf.html"
html = requests.get(url).text

# extract
print(extract_text(html))
```

## benchmark

### data

benchmark data comes from [dragnet_data](https://github.com/seomoz/dragnet_data), which contains 1381 web pages.

### result

|        | similarity         | 95%hit_rate | avg_length_gap(char) | length_gap_std     |
| ------ | ------------------ | ----------- | -------------------- | ------------------ |
| a=0.01 | 0.5767456743946341 | 0.22        | -4673.118            | 15343.704819895227 |
| a=025  | 0.8451692708814662 | 0.548       | -2082.988            | 14502.183923390849 |
| a=0.5  | 0.8226224698726087 | 0.47        | -368.696             | 8452.075615349402  |
| a=0.99 | 0.7527591593485807 | 0.292       | 1614.306             | 7917.618208044891  |

- a: alpha, control how much the content extractor tens to extract larger content piece
- similarity: cosine similarity between sparse vectors of answer and extracted text
- 95hit rate: percentage of similarity larger than 95%
- length gap: extracted text length - answer text length
- std: std