pyNekobin 2.4__tar.gz → 2.7__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.
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyNekobin
3
- Version: 2.4
3
+ Version: 2.7
4
4
  Summary: Paste codes to Nekobin.com with python
5
5
  Home-page: https://github.com/Nusab19/pyNekobin
6
- Download-URL: https://github.com/Nusab19/pyNekobin/releases/tag/pyNekobin-2.4
6
+ Download-URL: https://github.com/Nusab19/pyNekobin/releases/tag/pyNekobin-2.7
7
7
  Author: Nusab Taha
8
8
  Author-email: nusabtaha33@gmail.com
9
9
  License: MIT
@@ -25,7 +25,7 @@ License-File: LICENSE
25
25
 
26
26
  This is a Python package that provides a simple wrapper around the [Nekobin](https://nekobin.com/) API, allowing you to easily paste and retrieve text snippets from the popular pastebin service.
27
27
 
28
- <img src="https://img.shields.io/pypi/l/pyNekobin.svg" alt="MIT LICENSE"> <img src="https://img.shields.io/pypi/pyversions/pynekobin.svg" alt="Supported Oython Versions">
28
+ <img src="https://img.shields.io/pypi/l/pyNekobin.svg" alt="MIT LICENSE"> <img src="https://img.shields.io/pypi/pyversions/pynekobin.svg" alt="Supported Python Versions">
29
29
  <img src="https://img.shields.io/pypi/v/pynekobin.svg" alt="PyPy Version">
30
30
  <img src="https://api.codacy.com/project/badge/Grade/99d901eaa09b44b4819aec05c330c968" alt="Code Quality">
31
31
 
@@ -58,10 +58,11 @@ To paste text to Nekobin, you can use the `paste()` method:
58
58
  ```python
59
59
  async def main():
60
60
  result = await nb.paste("Hello, world!")
61
+
61
62
  if result.ok:
62
- print("Pasted text at:", result.url)
63
+ print("Pasted text at:", result.url) # -> Pasted text at: https://nekobin.com/abxajsyas
63
64
  else:
64
- print("Error:", result.message)
65
+ print("Error:", result.message) # Error: Nekobin did not fulfil the request
65
66
 
66
67
  asyncio.run(main())
67
68
  ```
@@ -70,11 +71,12 @@ Similarly, you can use the `read()` method to retrieve text from Nekobin:
70
71
 
71
72
  ```python
72
73
  async def main():
73
- result = await nb.read("https://nekobin.com/abcdefg")
74
+ result = await nb.read("https://nekobin.com/abxajsyas")
75
+
74
76
  if result.ok:
75
- print("Retrieved text:", result.content)
77
+ print("Retrieved text:", result.content) # -> Retrieved text: Hello, world!
76
78
  else:
77
- print("Error:", result.message)
79
+ print("Error:", result.message) # -> Error: Document not found
78
80
 
79
81
  asyncio.run(main())
80
82
  ```
@@ -2,7 +2,7 @@
2
2
 
3
3
  This is a Python package that provides a simple wrapper around the [Nekobin](https://nekobin.com/) API, allowing you to easily paste and retrieve text snippets from the popular pastebin service.
4
4
 
5
- <img src="https://img.shields.io/pypi/l/pyNekobin.svg" alt="MIT LICENSE"> <img src="https://img.shields.io/pypi/pyversions/pynekobin.svg" alt="Supported Oython Versions">
5
+ <img src="https://img.shields.io/pypi/l/pyNekobin.svg" alt="MIT LICENSE"> <img src="https://img.shields.io/pypi/pyversions/pynekobin.svg" alt="Supported Python Versions">
6
6
  <img src="https://img.shields.io/pypi/v/pynekobin.svg" alt="PyPy Version">
7
7
  <img src="https://api.codacy.com/project/badge/Grade/99d901eaa09b44b4819aec05c330c968" alt="Code Quality">
8
8
 
@@ -35,10 +35,11 @@ To paste text to Nekobin, you can use the `paste()` method:
35
35
  ```python
36
36
  async def main():
37
37
  result = await nb.paste("Hello, world!")
38
+
38
39
  if result.ok:
39
- print("Pasted text at:", result.url)
40
+ print("Pasted text at:", result.url) # -> Pasted text at: https://nekobin.com/abxajsyas
40
41
  else:
41
- print("Error:", result.message)
42
+ print("Error:", result.message) # Error: Nekobin did not fulfil the request
42
43
 
43
44
  asyncio.run(main())
44
45
  ```
@@ -47,11 +48,12 @@ Similarly, you can use the `read()` method to retrieve text from Nekobin:
47
48
 
48
49
  ```python
49
50
  async def main():
50
- result = await nb.read("https://nekobin.com/abcdefg")
51
+ result = await nb.read("https://nekobin.com/abxajsyas")
52
+
51
53
  if result.ok:
52
- print("Retrieved text:", result.content)
54
+ print("Retrieved text:", result.content) # -> Retrieved text: Hello, world!
53
55
  else:
54
- print("Error:", result.message)
56
+ print("Error:", result.message) # -> Error: Document not found
55
57
 
56
58
  asyncio.run(main())
57
59
  ```
@@ -1,4 +1,4 @@
1
1
  from .main import Nekobin
2
2
 
3
3
 
4
- __version__ = "2.4"
4
+ __version__ = "2.7"
@@ -1,13 +1,16 @@
1
+ # pylint:disable=C0103, C0114, C0301, R0903, W0718
2
+
3
+
1
4
  import re
2
5
  import json
3
6
  import httpx
4
- import asyncio
5
7
 
6
8
 
7
9
  class Objectify:
8
10
  """
9
11
  A utility class that converts a dictionary into an object.
10
12
  """
13
+
11
14
  def __init__(self, entries):
12
15
  """
13
16
  Initializes the Objectify instance with the given dictionary entries.
@@ -24,11 +27,11 @@ class Objectify:
24
27
  self.__dict__.update(entries)
25
28
 
26
29
 
27
-
28
30
  class Nekobin:
29
31
  """
30
- A wrapper class for the nekobin.com API.
32
+ A wrapper class for the nekobin.com API.
31
33
  """
34
+
32
35
  def __init__(self, **kw):
33
36
  """
34
37
  Initializes the Nekobin instance with the given arguments.
@@ -77,14 +80,13 @@ class Nekobin:
77
80
 
78
81
  return Objectify(x)
79
82
 
80
- else:
81
- x = {
82
- "ok": False,
83
- "message": "Nekobin did not fulfill the request",
84
- "error": Exception("Response is not 200")
85
- }
83
+ x = {
84
+ "ok": False,
85
+ "message": "Nekobin did not fulfill the request",
86
+ "error": Exception("Response is not 200")
87
+ }
86
88
 
87
- return Objectify(x)
89
+ return Objectify(x)
88
90
 
89
91
  async def read(self, url: str, **kw):
90
92
  """
@@ -100,7 +102,6 @@ class Nekobin:
100
102
  if not url.startswith("http"):
101
103
  url = "https://" + url
102
104
 
103
-
104
105
  pattern = r"^(http|https):\/\/nekobin\.com\/[a-z.]{5,20}$"
105
106
 
106
107
  if not re.match(pattern, url):
@@ -140,4 +141,4 @@ class Nekobin:
140
141
  "error": Exception("Document not retrieved")
141
142
  }
142
143
 
143
- return Objectify(x)
144
+ return Objectify(x)
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyNekobin
3
- Version: 2.4
3
+ Version: 2.7
4
4
  Summary: Paste codes to Nekobin.com with python
5
5
  Home-page: https://github.com/Nusab19/pyNekobin
6
- Download-URL: https://github.com/Nusab19/pyNekobin/releases/tag/pyNekobin-2.4
6
+ Download-URL: https://github.com/Nusab19/pyNekobin/releases/tag/pyNekobin-2.7
7
7
  Author: Nusab Taha
8
8
  Author-email: nusabtaha33@gmail.com
9
9
  License: MIT
@@ -25,7 +25,7 @@ License-File: LICENSE
25
25
 
26
26
  This is a Python package that provides a simple wrapper around the [Nekobin](https://nekobin.com/) API, allowing you to easily paste and retrieve text snippets from the popular pastebin service.
27
27
 
28
- <img src="https://img.shields.io/pypi/l/pyNekobin.svg" alt="MIT LICENSE"> <img src="https://img.shields.io/pypi/pyversions/pynekobin.svg" alt="Supported Oython Versions">
28
+ <img src="https://img.shields.io/pypi/l/pyNekobin.svg" alt="MIT LICENSE"> <img src="https://img.shields.io/pypi/pyversions/pynekobin.svg" alt="Supported Python Versions">
29
29
  <img src="https://img.shields.io/pypi/v/pynekobin.svg" alt="PyPy Version">
30
30
  <img src="https://api.codacy.com/project/badge/Grade/99d901eaa09b44b4819aec05c330c968" alt="Code Quality">
31
31
 
@@ -58,10 +58,11 @@ To paste text to Nekobin, you can use the `paste()` method:
58
58
  ```python
59
59
  async def main():
60
60
  result = await nb.paste("Hello, world!")
61
+
61
62
  if result.ok:
62
- print("Pasted text at:", result.url)
63
+ print("Pasted text at:", result.url) # -> Pasted text at: https://nekobin.com/abxajsyas
63
64
  else:
64
- print("Error:", result.message)
65
+ print("Error:", result.message) # Error: Nekobin did not fulfil the request
65
66
 
66
67
  asyncio.run(main())
67
68
  ```
@@ -70,11 +71,12 @@ Similarly, you can use the `read()` method to retrieve text from Nekobin:
70
71
 
71
72
  ```python
72
73
  async def main():
73
- result = await nb.read("https://nekobin.com/abcdefg")
74
+ result = await nb.read("https://nekobin.com/abxajsyas")
75
+
74
76
  if result.ok:
75
- print("Retrieved text:", result.content)
77
+ print("Retrieved text:", result.content) # -> Retrieved text: Hello, world!
76
78
  else:
77
- print("Error:", result.message)
79
+ print("Error:", result.message) # -> Error: Document not found
78
80
 
79
81
  asyncio.run(main())
80
82
  ```
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2023 Nusab19
1
+ # Copyright (c) 2023 Nusab19
2
2
 
3
3
  import os
4
4
  from setuptools import setup, find_packages
@@ -15,10 +15,7 @@ if os.path.isfile("README.md"):
15
15
  big_description = readme.read()
16
16
 
17
17
  else:
18
- big_description = "pyNekobin - Paste Text into Nekobin with Python"
19
-
20
-
21
-
18
+ big_description = "PyNekobin - Paste Text into Nekobin with Python"
22
19
 
23
20
 
24
21
  setup(name="pyNekobin",
@@ -33,12 +30,12 @@ setup(name="pyNekobin",
33
30
  keywords=["Nekobin", "pyNekobin", "Paste Code", "Paste Bin"],
34
31
  long_description=big_description,
35
32
  long_description_content_type="text/markdown",
36
-
33
+
37
34
  package_data={"pyNekobin": ["data/*.json"]},
38
35
  include_package_data=True,
39
-
36
+
40
37
  install_requires=["httpx>=0.23.0"],
41
- python_requires = ">=3.6",
38
+ python_requires=">=3.6",
42
39
  classifiers=[
43
40
  "Development Status :: 5 - Production/Stable",
44
41
  "Intended Audience :: Developers",
@@ -50,4 +47,4 @@ setup(name="pyNekobin",
50
47
  "Programming Language :: Python :: 3.9",
51
48
  "Programming Language :: Python :: 3.10",
52
49
  ],
53
- )
50
+ )
File without changes
File without changes