Tonviewer 1.0__py3-none-any.whl

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.
Tonviewer/Ton.py ADDED
@@ -0,0 +1,43 @@
1
+ from bs4 import BeautifulSoup
2
+ from main import Wallet
3
+
4
+ class Coin(Wallet):
5
+ def __init__(self , coin: str):
6
+ self.coin = coin
7
+ self.url = "https://www.coingecko.com/en/coins/"
8
+ super().__init__(wallet=coin)
9
+ self.html = self.scraper.get(self.url + self.coin).text
10
+ self.soup = BeautifulSoup(self.html, "html.parser")
11
+
12
+ def price(self) -> str:
13
+ try:
14
+ price_div = self.soup.find("div",
15
+ class_="tw-font-bold tw-text-gray-900 dark:tw-text-moon-50 tw-text-3xl md:tw-text-4xl tw-leading-10")
16
+ if price_div:
17
+ span = price_div.find("span", attrs={"data-converter-target": "price"})
18
+ if span:
19
+ print(span.text.strip())
20
+
21
+ except Exception as e:
22
+ print(" Error fetching price:", e)
23
+ return None
24
+
25
+ def about(self):
26
+ try:
27
+ about_section = self.soup.find('div', class_="coin-page-editorial-content")
28
+ if about_section:
29
+ first_paragraph = about_section.find('p')
30
+ if first_paragraph:
31
+ print(first_paragraph.text.strip())
32
+ else:
33
+ print("❌ not found.")
34
+ else:
35
+ print("❌ About section not found.")
36
+ except Exception as e:
37
+ print("❌ Error extracting about text:", e)
38
+
39
+
40
+
41
+
42
+
43
+
Tonviewer/__init__.py ADDED
@@ -0,0 +1,4 @@
1
+ from .main import Wallet
2
+ from .Ton import Coin
3
+
4
+ __all__ = ["Wallet" , "Coin"]
Tonviewer/main.py ADDED
@@ -0,0 +1,24 @@
1
+ import cloudscraper
2
+ from bs4 import BeautifulSoup
3
+
4
+ class Wallet:
5
+ def __init__(self , wallet: str):
6
+ self.scraper = cloudscraper.create_scraper()
7
+ self.wallet: str = wallet
8
+ self.response = self.scraper.get(f"https://tonviewer.com/{self.wallet}")
9
+ self.soup = BeautifulSoup(self.response.text, 'html.parser')
10
+
11
+ def Balance(self):
12
+ try:
13
+ if self.response.status_code == 200:
14
+ ton = self.soup.find("div", class_="bdtytpm b1249k0b")
15
+ usdt = self.soup.find("div", class_="bdtytpm b1ai646e")
16
+ if ton and usdt:
17
+ print(ton.text.strip() ,usdt.text.strip())
18
+ else:
19
+ print("Failed to retrieve data.")
20
+ except Exception as e :
21
+ print(e)
22
+
23
+
24
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 deep
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the “Software”), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21
+ DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,102 @@
1
+ Metadata-Version: 2.1
2
+ Name: Tonviewer
3
+ Version: 1.0
4
+ Summary: TON Crypto Info Scraper is a Python library that allows you to fetch real-time data from the TON blockchain and CoinGecko without needing any APIs
5
+ Author: deep
6
+ Author-email: asyncpy@proton.me
7
+ License: MIT
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.6
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+
15
+ <p align="center">
16
+ <img align="center" width="350" src="https://github.com/user-attachments/assets/779356f9-84af-4247-83f0-32be2229c569" />
17
+
18
+ <h1 align="center">TonViewer</h1>
19
+ <h3 align="center"></h3>
20
+ </p>
21
+
22
+
23
+ <p align="center">
24
+
25
+ <a href="https://pypi.org/project/Tonviewer/">
26
+ <img src="https://img.shields.io/pypi/v/censys?color=red&logo=pypi&logoColor=red">
27
+ </a>
28
+
29
+ <a href="https://t.me/Pycodz">
30
+ <img src="https://img.shields.io/badge/Telegram-Channel-blue.svg?logo=telegram">
31
+ </a>
32
+
33
+ <a href="https://t.me/DevZ44d" target="_blank">
34
+ <img alt="Telegram Owner" src="https://img.shields.io/badge/Telegram-Owner-red.svg?logo=telegram" />
35
+ </a>
36
+ </p>
37
+
38
+ #### 🚀 Quick Start
39
+ ```python
40
+ ## Prints TON and USDT balance of wallet
41
+ from Tonviewer import Wallet , Coin
42
+ wallet = Wallet("") #wallet_address_here
43
+ wallet.Balance()
44
+
45
+ # Prints live price
46
+ coin = Coin("") #ex: "toncoin" , "bitcoin" , ...
47
+ coin.price() # Prints live price
48
+ coin.about() # Prints description of the coin
49
+ ```
50
+
51
+ ### Installation and Development 🚀
52
+
53
+ ### Via PyPi ⚡️
54
+ ```shell
55
+ # via PyPi
56
+ pip install Tonviewer -U
57
+ ```
58
+
59
+ ### 💎 TON Crypto Info Scraper
60
+
61
+ - TON Crypto Info Scraper is a Python library that allows you to fetch real-time data from the TON blockchain and CoinGecko without needing any APIs.
62
+
63
+ - It enables users to view wallet balances and live coin information with ease, making it perfect for TON developers, analysts, and bot creators.
64
+
65
+
66
+ ### ⚙️ What This Library Can Do ?
67
+
68
+ - Retrieve the current **TON and USDT balance** from any TON wallet address.
69
+ - Get the **live price** of any coin listed on CoinGecko.
70
+
71
+
72
+
73
+ ### ✨ Features
74
+
75
+ - Real-time TON wallet balance fetching
76
+ - Live cryptocurrency price lookup
77
+ - Instant coin description extraction
78
+ - Fast and lightweight scraping
79
+ - No API keys or authentication needed
80
+ - Simple and clean object-oriented design
81
+
82
+
83
+ ### 💡 Why Use This?
84
+ - ✅ No API rate limits .
85
+
86
+ - ✅ No API keys .
87
+
88
+ - ✅ Fully customizable .
89
+
90
+ - ✅ Great for bots, dashboards, or automation .
91
+
92
+
93
+ ### 🧠 Author's Note
94
+ - This tool was crafted with **[deep](https://t.me/ddllId)** for developers in the TON ecosystem who want a fast and API-free way to monitor wallets and market data.
95
+
96
+ - New Features coming soon .
97
+ -
98
+ ## 💬 Help & Support .
99
+ - Follow updates via the **[Telegram Channel](https://t.me/Pycodz)**.
100
+ - For general questions and help, join our **[Telegram chat](https://t.me/PyChTz)**.
101
+
102
+
@@ -0,0 +1,8 @@
1
+ Tonviewer/Ton.py,sha256=6KuokqxzuEcdp7uiKyoSOdHc7FSqFYjh5vc-DVwUlnM,1440
2
+ Tonviewer/__init__.py,sha256=hm8SwZhe0hkwR2ElaeIRRHWRCSj2ISCVTZA6fyY0ov0,80
3
+ Tonviewer/main.py,sha256=pXl_JDxfyJGkifM_b6VfQArHo3ux2W-6KKRdWYX8Yno,813
4
+ Tonviewer-1.0.dist-info/LICENSE,sha256=0vMAz5b-tUdIoFIHl7t1RbdaRnZEEWdYRRreugTT4KA,1090
5
+ Tonviewer-1.0.dist-info/METADATA,sha256=cXZHbN_idJBKpjfeyTJANmImBMp7zwXyMP9WAqFm7vI,3023
6
+ Tonviewer-1.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
7
+ Tonviewer-1.0.dist-info/top_level.txt,sha256=aB2GOuixmaiLqU8o1Q9LTEzB8AMar6MK6pkigMhVv08,10
8
+ Tonviewer-1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (75.3.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ Tonviewer