Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ALIILAPRO/yun-ir
A Python client for https://Yun.ir URL shortener API.
https://github.com/ALIILAPRO/yun-ir
aliilapro python shortener
Last synced: about 2 months ago
JSON representation
A Python client for https://Yun.ir URL shortener API.
- Host: GitHub
- URL: https://github.com/ALIILAPRO/yun-ir
- Owner: ALIILAPRO
- License: gpl-3.0
- Created: 2021-06-22T12:17:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-05T20:28:24.000Z (over 1 year ago)
- Last Synced: 2024-07-16T07:32:37.261Z (2 months ago)
- Topics: aliilapro, python, shortener
- Language: Python
- Homepage:
- Size: 24.4 KB
- Stars: 14
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Yun.ir Python Client
A Python client for the [Yun.ir](https://yun.ir/) URL shortener API.
## Installation
Install with `pip`:
```sh
pip install yun-ir
```## Usage
```python
from yun import Yunlogin = Yun.Api('YOUR tOKEN')
result = login.short('title', 'url')print(result)
```
## API`yun_ir.Yun(token: str)`
Create a new Yun.ir client instance.
`token`: Your Yun.ir API token.
`yun_ir.Yun.short(title: str, url: str) -> dict`
Shorten a URL using Yun.ir API.
`title`: Title for the URL
`url`: URL to shorten
Returns:
A dictionary containing the shortened URL, or an error message if the request fails.