Neon-tech commited on
Commit
652d184
·
verified ·
1 Parent(s): 5b2c3aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -17
app.py CHANGED
@@ -1,24 +1,42 @@
1
- import pandas as pd
 
 
 
2
 
3
- url = "https://huggingface.co/buckets/Neon-tech/Dataset-arranger/resolve/image-shards/shard_000000.parquet?download=true"
4
 
5
- df = pd.read_parquet(url)
6
 
7
- print("COLUMNS:")
8
- print(df.columns.tolist())
 
 
 
9
 
10
- print("\nSHAPE:")
11
- print(df.shape)
12
 
13
- # copy dataframe for safe display
14
- preview = df.head(10).copy()
15
 
16
- # convert bytes / binary columns to readable placeholders
17
- for col in preview.columns:
18
- if preview[col].dtype == "object":
19
- preview[col] = preview[col].apply(
20
- lambda x: "<BYTES>" if isinstance(x, (bytes, bytearray)) else x
21
- )
22
 
23
- print("\nFIRST 10 ROWS (cleaned):")
24
- print(preview.to_string(index=False))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import asyncio
2
+ import os
3
+ import zipfile
4
+ from pyrogram import Client
5
 
6
+ session_string = os.environ.get("session_string")
7
 
 
8
 
9
+ async def main():
10
+ app = Client(
11
+ name="x",
12
+ session_string=session_string
13
+ )
14
 
15
+ await app.start()
 
16
 
17
+ msg = await app.get_messages("nt123456nt", 203)
 
18
 
19
+ file_path = await msg.download()
20
+ print("Downloaded:", file_path)
 
 
 
 
21
 
22
+ with zipfile.ZipFile(file_path, "r") as z:
23
+ z.extractall("out")
24
+
25
+ print("Extracted to: out")
26
+
27
+ for root, _, files in os.walk("out"):
28
+ for f in files:
29
+ path = os.path.join(root, f)
30
+
31
+ print("\n---", f, "---")
32
+
33
+ try:
34
+ with open(path, "r") as file:
35
+ print(file.read())
36
+ except:
37
+ print("binary/unreadable")
38
+
39
+ await app.stop()
40
+
41
+
42
+ asyncio.run(main())