Shortners 1.1.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- shortners-1.1.11/PKG-INFO +84 -0
- shortners-1.1.11/README.md +60 -0
- shortners-1.1.11/Shortners/__init__.py +22 -0
- shortners-1.1.11/Shortners/functions/__init__.py +1 -0
- shortners-1.1.11/Shortners/functions/collections.py +7 -0
- shortners-1.1.11/Shortners/functions/function01.py +17 -0
- shortners-1.1.11/Shortners/functions/function02.py +55 -0
- shortners-1.1.11/Shortners/scripts/__init__.py +2 -0
- shortners-1.1.11/Shortners/scripts/script01.py +4 -0
- shortners-1.1.11/Shortners/scripts/script02.py +4 -0
- shortners-1.1.11/Shortners.egg-info/PKG-INFO +84 -0
- shortners-1.1.11/Shortners.egg-info/SOURCES.txt +15 -0
- shortners-1.1.11/Shortners.egg-info/dependency_links.txt +1 -0
- shortners-1.1.11/Shortners.egg-info/requires.txt +1 -0
- shortners-1.1.11/Shortners.egg-info/top_level.txt +1 -0
- shortners-1.1.11/setup.cfg +4 -0
- shortners-1.1.11/setup.py +24 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: Shortners
|
|
3
|
+
Version: 1.1.11
|
|
4
|
+
Summary: Python url shortner
|
|
5
|
+
Home-page: https://github.com/Clinton-Abraham
|
|
6
|
+
Author: Clinton Abraham
|
|
7
|
+
Author-email: clintonabrahamc@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: url,shortner,telegram
|
|
10
|
+
Classifier: Natural Language :: English
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
18
|
+
Classifier: Topic :: Software Development :: Localization
|
|
19
|
+
Classifier: Topic :: Software Development :: User Interfaces
|
|
20
|
+
Classifier: Topic :: Software Development :: Version Control
|
|
21
|
+
Requires-Python: ~=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
Requires-Dist: aiohttp
|
|
24
|
+
|
|
25
|
+
<p align="center">
|
|
26
|
+
📦 <a href="https://pypi.org/project/shortners" style="text-decoration:none;">SHORTNERS</a>
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
<p align="center">
|
|
30
|
+
<a href="https://telegram.me/clinton_abraham"><img src="https://img.shields.io/badge/𝑪𝒍𝒊𝒏𝒕𝒐𝒏 𝑨𝒃𝒓𝒂𝒉𝒂𝒎-30302f?style=flat&logo=telegram" alt="telegram badge"/></a>
|
|
31
|
+
<a href="https://telegram.me/Space_x_bots"><img src="https://img.shields.io/badge/Sᴘᴀᴄᴇ ✗ ʙᴏᴛꜱ-30302f?style=flat&logo=telegram" alt="telegram badge"/></a>
|
|
32
|
+
<a href="https://telegram.me/sources_codes"><img src="https://img.shields.io/badge/Sᴏᴜʀᴄᴇ ᴄᴏᴅᴇꜱ-30302f?style=flat&logo=telegram" alt="telegram badge"/></a>
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
## INSTALLATION
|
|
36
|
+
```bash
|
|
37
|
+
pip install shortners
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif">
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
|
|
44
|
+
import asyncio
|
|
45
|
+
from Shortners.functions import Shortners
|
|
46
|
+
|
|
47
|
+
shortner_api = "a1cgsja52iey3j53mg"
|
|
48
|
+
shortner_url = "https://modijiurl.com/api"
|
|
49
|
+
contents_url = "https://github.com/Clinton-Abraham"
|
|
50
|
+
|
|
51
|
+
core = Shortners(api=shortner_api, domain=shortner_url)
|
|
52
|
+
|
|
53
|
+
async def test():
|
|
54
|
+
o = await core.convert(contents_url)
|
|
55
|
+
print(o.result)
|
|
56
|
+
print(o.status)
|
|
57
|
+
print(o.errors)
|
|
58
|
+
|
|
59
|
+
asyncio.run(test())
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif">
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
|
|
67
|
+
import asyncio
|
|
68
|
+
from Shortners.functions import Shortners
|
|
69
|
+
|
|
70
|
+
shortner_api = "a1cgsja52iey3j53mg"
|
|
71
|
+
shortner_url = "https://xxxxxx.net/api"
|
|
72
|
+
contents_url = "Link01 : https://github.com/Clinton-Abraham Link02 : https://telegram.me/Clinton_Abraham"
|
|
73
|
+
|
|
74
|
+
core = Shortners(api=shortner_api, domain=shortner_url)
|
|
75
|
+
|
|
76
|
+
async def test():
|
|
77
|
+
o = await core.bulkshort(contents_url)
|
|
78
|
+
print(o)
|
|
79
|
+
|
|
80
|
+
asyncio.run(test())
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif">
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
📦 <a href="https://pypi.org/project/shortners" style="text-decoration:none;">SHORTNERS</a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://telegram.me/clinton_abraham"><img src="https://img.shields.io/badge/𝑪𝒍𝒊𝒏𝒕𝒐𝒏 𝑨𝒃𝒓𝒂𝒉𝒂𝒎-30302f?style=flat&logo=telegram" alt="telegram badge"/></a>
|
|
7
|
+
<a href="https://telegram.me/Space_x_bots"><img src="https://img.shields.io/badge/Sᴘᴀᴄᴇ ✗ ʙᴏᴛꜱ-30302f?style=flat&logo=telegram" alt="telegram badge"/></a>
|
|
8
|
+
<a href="https://telegram.me/sources_codes"><img src="https://img.shields.io/badge/Sᴏᴜʀᴄᴇ ᴄᴏᴅᴇꜱ-30302f?style=flat&logo=telegram" alt="telegram badge"/></a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
## INSTALLATION
|
|
12
|
+
```bash
|
|
13
|
+
pip install shortners
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif">
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
|
|
20
|
+
import asyncio
|
|
21
|
+
from Shortners.functions import Shortners
|
|
22
|
+
|
|
23
|
+
shortner_api = "a1cgsja52iey3j53mg"
|
|
24
|
+
shortner_url = "https://modijiurl.com/api"
|
|
25
|
+
contents_url = "https://github.com/Clinton-Abraham"
|
|
26
|
+
|
|
27
|
+
core = Shortners(api=shortner_api, domain=shortner_url)
|
|
28
|
+
|
|
29
|
+
async def test():
|
|
30
|
+
o = await core.convert(contents_url)
|
|
31
|
+
print(o.result)
|
|
32
|
+
print(o.status)
|
|
33
|
+
print(o.errors)
|
|
34
|
+
|
|
35
|
+
asyncio.run(test())
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif">
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
|
|
43
|
+
import asyncio
|
|
44
|
+
from Shortners.functions import Shortners
|
|
45
|
+
|
|
46
|
+
shortner_api = "a1cgsja52iey3j53mg"
|
|
47
|
+
shortner_url = "https://xxxxxx.net/api"
|
|
48
|
+
contents_url = "Link01 : https://github.com/Clinton-Abraham Link02 : https://telegram.me/Clinton_Abraham"
|
|
49
|
+
|
|
50
|
+
core = Shortners(api=shortner_api, domain=shortner_url)
|
|
51
|
+
|
|
52
|
+
async def test():
|
|
53
|
+
o = await core.bulkshort(contents_url)
|
|
54
|
+
print(o)
|
|
55
|
+
|
|
56
|
+
asyncio.run(test())
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif">
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
licence = 'MIT'
|
|
2
|
+
version = '1.1.11'
|
|
3
|
+
pythons = '~=3.10'
|
|
4
|
+
appname = 'Shortners'
|
|
5
|
+
install = ['aiohttp']
|
|
6
|
+
clinton = 'Clinton Abraham'
|
|
7
|
+
mention = ['url', 'shortner', 'telegram']
|
|
8
|
+
profile = 'https://github.com/Clinton-Abraham'
|
|
9
|
+
|
|
10
|
+
DATA03 = 'Python url shortner'
|
|
11
|
+
DATA01 = "clintonabrahamc@gmail.com"
|
|
12
|
+
DATA02 = ['Natural Language :: English',
|
|
13
|
+
'Intended Audience :: Developers',
|
|
14
|
+
'Operating System :: OS Independent',
|
|
15
|
+
'Programming Language :: Python :: 3.10',
|
|
16
|
+
'Programming Language :: Python :: 3.11',
|
|
17
|
+
'Programming Language :: Python :: 3.12',
|
|
18
|
+
'Programming Language :: Python :: 3.13',
|
|
19
|
+
'Topic :: Software Development :: Libraries',
|
|
20
|
+
'Topic :: Software Development :: Localization',
|
|
21
|
+
'Topic :: Software Development :: User Interfaces',
|
|
22
|
+
'Topic :: Software Development :: Version Control',]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .function02 import Shortners
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
#======================================================================================
|
|
3
|
+
|
|
4
|
+
class Shortner:
|
|
5
|
+
|
|
6
|
+
async def shortlink(self, recived):
|
|
7
|
+
async with self.seon() as seion:
|
|
8
|
+
param = {'api': self.apis, 'url': recived}
|
|
9
|
+
async with seion.get(self.site, params=param, timeout=self.tims) as oem:
|
|
10
|
+
if oem.status == 200 or oem.status == "success":
|
|
11
|
+
moones = await oem.json()
|
|
12
|
+
moonus = moones.get("shortenedUrl", None)
|
|
13
|
+
return moonus
|
|
14
|
+
else:
|
|
15
|
+
return None
|
|
16
|
+
|
|
17
|
+
#======================================================================================
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import re
|
|
2
|
+
import aiohttp
|
|
3
|
+
import asyncio
|
|
4
|
+
from ..scripts import Regexs
|
|
5
|
+
from ..scripts import Scripted
|
|
6
|
+
from .function01 import Shortner
|
|
7
|
+
from .collections import SMessage
|
|
8
|
+
from aiohttp import ClientTimeout
|
|
9
|
+
#======================================================================================
|
|
10
|
+
|
|
11
|
+
class Shortners(Shortner):
|
|
12
|
+
|
|
13
|
+
def __init__(self, **kwargs):
|
|
14
|
+
self.seon = aiohttp.ClientSession
|
|
15
|
+
self.tims = kwargs.get("timeout", 30)
|
|
16
|
+
self.apis = kwargs.get("api", Scripted.DATA01)
|
|
17
|
+
self.site = kwargs.get("domain", Scripted.DATA02)
|
|
18
|
+
|
|
19
|
+
#======================================================================================
|
|
20
|
+
|
|
21
|
+
async def clinton(self, recived):
|
|
22
|
+
try:
|
|
23
|
+
moonus = await self.shortlink(recived)
|
|
24
|
+
return SMessage(result=moonus, status=200)
|
|
25
|
+
except asyncio.TimeoutError as errors:
|
|
26
|
+
return SMessage(result=recived, status=404, errors=errors)
|
|
27
|
+
except Exception as errors:
|
|
28
|
+
return SMessage(result=recived, status=404, errors=errors)
|
|
29
|
+
|
|
30
|
+
#======================================================================================
|
|
31
|
+
|
|
32
|
+
async def convert(self, recived):
|
|
33
|
+
try:
|
|
34
|
+
moonus = await self.shortlink(recived)
|
|
35
|
+
return SMessage(result=moonus, status=200)
|
|
36
|
+
except asyncio.TimeoutError as errors:
|
|
37
|
+
return SMessage(result=recived, status=404, errors=errors)
|
|
38
|
+
except Exception as errors:
|
|
39
|
+
return SMessage(result=recived, status=404, errors=errors)
|
|
40
|
+
|
|
41
|
+
#======================================================================================
|
|
42
|
+
|
|
43
|
+
async def bulkshort(self, text, wait=1, storage={}):
|
|
44
|
+
alllinks = re.findall(Regexs.DATA01, text)
|
|
45
|
+
for link in alllinks:
|
|
46
|
+
newlink = await self.convert(link)
|
|
47
|
+
storage[link] = newlink.result
|
|
48
|
+
await asyncio.sleep(wait)
|
|
49
|
+
|
|
50
|
+
for original, shortened in storage.items():
|
|
51
|
+
text = text.replace(original, shortened)
|
|
52
|
+
|
|
53
|
+
return text
|
|
54
|
+
|
|
55
|
+
#======================================================================================
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: Shortners
|
|
3
|
+
Version: 1.1.11
|
|
4
|
+
Summary: Python url shortner
|
|
5
|
+
Home-page: https://github.com/Clinton-Abraham
|
|
6
|
+
Author: Clinton Abraham
|
|
7
|
+
Author-email: clintonabrahamc@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: url,shortner,telegram
|
|
10
|
+
Classifier: Natural Language :: English
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
18
|
+
Classifier: Topic :: Software Development :: Localization
|
|
19
|
+
Classifier: Topic :: Software Development :: User Interfaces
|
|
20
|
+
Classifier: Topic :: Software Development :: Version Control
|
|
21
|
+
Requires-Python: ~=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
Requires-Dist: aiohttp
|
|
24
|
+
|
|
25
|
+
<p align="center">
|
|
26
|
+
📦 <a href="https://pypi.org/project/shortners" style="text-decoration:none;">SHORTNERS</a>
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
<p align="center">
|
|
30
|
+
<a href="https://telegram.me/clinton_abraham"><img src="https://img.shields.io/badge/𝑪𝒍𝒊𝒏𝒕𝒐𝒏 𝑨𝒃𝒓𝒂𝒉𝒂𝒎-30302f?style=flat&logo=telegram" alt="telegram badge"/></a>
|
|
31
|
+
<a href="https://telegram.me/Space_x_bots"><img src="https://img.shields.io/badge/Sᴘᴀᴄᴇ ✗ ʙᴏᴛꜱ-30302f?style=flat&logo=telegram" alt="telegram badge"/></a>
|
|
32
|
+
<a href="https://telegram.me/sources_codes"><img src="https://img.shields.io/badge/Sᴏᴜʀᴄᴇ ᴄᴏᴅᴇꜱ-30302f?style=flat&logo=telegram" alt="telegram badge"/></a>
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
## INSTALLATION
|
|
36
|
+
```bash
|
|
37
|
+
pip install shortners
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif">
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
|
|
44
|
+
import asyncio
|
|
45
|
+
from Shortners.functions import Shortners
|
|
46
|
+
|
|
47
|
+
shortner_api = "a1cgsja52iey3j53mg"
|
|
48
|
+
shortner_url = "https://modijiurl.com/api"
|
|
49
|
+
contents_url = "https://github.com/Clinton-Abraham"
|
|
50
|
+
|
|
51
|
+
core = Shortners(api=shortner_api, domain=shortner_url)
|
|
52
|
+
|
|
53
|
+
async def test():
|
|
54
|
+
o = await core.convert(contents_url)
|
|
55
|
+
print(o.result)
|
|
56
|
+
print(o.status)
|
|
57
|
+
print(o.errors)
|
|
58
|
+
|
|
59
|
+
asyncio.run(test())
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif">
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
|
|
67
|
+
import asyncio
|
|
68
|
+
from Shortners.functions import Shortners
|
|
69
|
+
|
|
70
|
+
shortner_api = "a1cgsja52iey3j53mg"
|
|
71
|
+
shortner_url = "https://xxxxxx.net/api"
|
|
72
|
+
contents_url = "Link01 : https://github.com/Clinton-Abraham Link02 : https://telegram.me/Clinton_Abraham"
|
|
73
|
+
|
|
74
|
+
core = Shortners(api=shortner_api, domain=shortner_url)
|
|
75
|
+
|
|
76
|
+
async def test():
|
|
77
|
+
o = await core.bulkshort(contents_url)
|
|
78
|
+
print(o)
|
|
79
|
+
|
|
80
|
+
asyncio.run(test())
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif">
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
setup.py
|
|
3
|
+
Shortners/__init__.py
|
|
4
|
+
Shortners.egg-info/PKG-INFO
|
|
5
|
+
Shortners.egg-info/SOURCES.txt
|
|
6
|
+
Shortners.egg-info/dependency_links.txt
|
|
7
|
+
Shortners.egg-info/requires.txt
|
|
8
|
+
Shortners.egg-info/top_level.txt
|
|
9
|
+
Shortners/functions/__init__.py
|
|
10
|
+
Shortners/functions/collections.py
|
|
11
|
+
Shortners/functions/function01.py
|
|
12
|
+
Shortners/functions/function02.py
|
|
13
|
+
Shortners/scripts/__init__.py
|
|
14
|
+
Shortners/scripts/script01.py
|
|
15
|
+
Shortners/scripts/script02.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
aiohttp
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Shortners
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
from Shortners import DATA01, DATA02, DATA03
|
|
3
|
+
from Shortners import licence, version
|
|
4
|
+
from Shortners import pythons, appname
|
|
5
|
+
from Shortners import install, clinton
|
|
6
|
+
from Shortners import mention, profile
|
|
7
|
+
|
|
8
|
+
with open("README.md", "r") as mess:
|
|
9
|
+
description = mess.read()
|
|
10
|
+
|
|
11
|
+
setup(name=appname,
|
|
12
|
+
url=profile,
|
|
13
|
+
author=clinton,
|
|
14
|
+
version=version,
|
|
15
|
+
license=licence,
|
|
16
|
+
keywords=mention,
|
|
17
|
+
description=DATA03,
|
|
18
|
+
classifiers=DATA02,
|
|
19
|
+
author_email=DATA01,
|
|
20
|
+
python_requires=pythons,
|
|
21
|
+
packages=find_packages(),
|
|
22
|
+
install_requires=install,
|
|
23
|
+
long_description=description,
|
|
24
|
+
long_description_content_type="text/markdown")
|