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: 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 (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-24T09:11:12.000Z (3 months ago)
- Last Synced: 2025-03-24T10:22:23.178Z (3 months ago)
- Topics: aliilapro, python, shortener
- Language: Python
- Homepage:
- Size: 28.3 KB
- Stars: 13
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# کلاینت پایتون برای Yun.ir
یک کلاینت پایتون برای API سرویس کوتاهکننده لینک [Yun.ir](https://yun.ir/)
---
## نصب
نصب با استفاده از `pip`:
```sh
pip install yun-ir
```---
## نحوه استفاده
```python
from yun import Yunlogin = Yun.Api('YOUR tOKEN') # توکن API خود را وارد کنید
result = login.short('title', 'url') # به جای 'title' و 'url' مقادیر دلخواه را وارد کنیدprint(result) # نتیجه را چاپ میکند
```---
## مستندات API
### `yun_ir.Yun(token: str)`
ساخت یک نمونه از کلاینت Yun.ir
**پارامترها:**
- `token`: توکن API شما در Yun.ir---
### `yun_ir.Yun.short(title: str, url: str) -> dict`
کوتاهکردن یک لینک با استفاده از API یون
**پارامترها:**
- `title`: عنوان لینک
- `url`: لینکی که میخواهید کوتاه شود**خروجی:**
- یک دیکشنری شامل لینک کوتاهشده یا پیام خطا (در صورت بروز خطا)---
> حتماً باید یک توکن معتبر از [Yun.ir](https://yun.ir/) دریافت کرده باشید.
---
# 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.
**Parameters:**
- `token`: Your Yun.ir API token---
### `yun_ir.Yun.short(title: str, url: str) -> dict`
Shorten a URL using Yun.ir API.
**Parameters:**
- `title`: Title for the URL
- `url`: URL to shorten**Returns:**
- A dictionary containing the shortened URL, or an error message if the request fails.---
> Make sure you have a valid API token from [Yun.ir](https://yun.ir/)