PKDevTools 0.13.20250213.231__tar.gz → 0.13.20250213.233__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/GmailReader.py +18 -8
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/NSEMarketStatus.py +4 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/UserSubscriptions.py +7 -1
- pkdevtools-0.13.20250213.233/PKDevTools/classes/__init__.py +1 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools.egg-info/PKG-INFO +2 -2
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKG-INFO +2 -2
- pkdevtools-0.13.20250213.231/PKDevTools/classes/__init__.py +0 -1
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/LICENSE +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/LICENSE.txt +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/README.txt +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/__init__.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/Archiver.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/ColorText.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/Committer.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/CookieHelper.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/DBManager.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/Environment.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/Fetcher.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/FunctionTimeouts.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/MarketHours.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/MenuOptions.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/OutputControls.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/PKDateUtilities.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/PKGitFolderDownloader.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/PKJoinableQueue.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/PKMultiProcessorClient.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/PKPickler.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/PKTimer.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/Pikey.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/Singleton.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/SuppressOutput.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/System.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/Telegram.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/Utils.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/WorkflowManager.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/githubutilities.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/log.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/multiprocessing_logging.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/pubsub/__init__.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/pubsub/events.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/pubsub/publisher.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/pubsub/subscriber.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/squash.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/updater.py +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/release.md +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/requirements.txt +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools.egg-info/SOURCES.txt +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools.egg-info/dependency_links.txt +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools.egg-info/entry_points.txt +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools.egg-info/not-zip-safe +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools.egg-info/requires.txt +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools.egg-info/top_level.txt +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/README.md +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/setup.cfg +0 -0
- {pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/setup.py +0 -0
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/GmailReader.py
RENAMED
@@ -31,26 +31,30 @@ from PKDevTools.classes.Environment import PKEnvironment
|
|
31
31
|
class PKGmailReader:
|
32
32
|
|
33
33
|
@classmethod
|
34
|
-
def getTransactions(self,user=None, password=None, label=None,senderEmail=None,forNthDayFromToday=0):
|
34
|
+
def getTransactions(self,user=None, password=None, label=None,senderEmail=None,forNthDayFromToday=0,utr=None):
|
35
35
|
imap_url = 'imap.gmail.com'
|
36
36
|
try:
|
37
37
|
mail = imaplib.IMAP4_SSL(imap_url)
|
38
38
|
mail.login(user, password)
|
39
|
-
|
39
|
+
## Make sure emails can be modified (not read-only)
|
40
|
+
mail.select(label,readonly=False) # Connect to the labeled inbox.
|
40
41
|
today = datetime.date.today()
|
41
42
|
pastDate = (today - datetime.timedelta(forNthDayFromToday))
|
42
43
|
date = pastDate.strftime("%d-%b-%Y")
|
43
44
|
|
44
45
|
# result, data = mail.search(None,f'FROM "{senderEmail}"',"UNSEEN")
|
45
46
|
# result, data = mail.uid('search', None, "UNSEEN") # (ALL/UNSEEN)
|
46
|
-
|
47
|
+
# Search for UNSEEN emails from the sender on a specific date
|
48
|
+
result, data = mail.uid('search', None, f'UNSEEN FROM "{senderEmail}" (SENTON %s)' % date)
|
47
49
|
|
48
50
|
i = len(data[0].split())
|
49
51
|
transactions = {}
|
52
|
+
# if result == "OK":
|
50
53
|
for x in range(i):
|
51
54
|
latest_email_uid = data[0].split()[x]
|
52
55
|
result, email_data = mail.uid('fetch', latest_email_uid, '(RFC822)')
|
53
|
-
# result
|
56
|
+
# if result == "OK":
|
57
|
+
# result, email_data = conn.store(num,'+FLAGS','\\Seen')
|
54
58
|
# this might work to set flag to seen, if it doesn't already
|
55
59
|
raw_email = email_data[0][1]
|
56
60
|
raw_email_string = raw_email.decode('utf-8')
|
@@ -80,6 +84,11 @@ class PKGmailReader:
|
|
80
84
|
# that identifies each Unified Payments Interface (UPI) transaction.
|
81
85
|
# It's also known as the Unique Transaction Reference (UTR) number.
|
82
86
|
transactionNumber = transactionInfo.split("/")[2]
|
87
|
+
|
88
|
+
if utr is not None and str(transactionNumber) == str(utr):
|
89
|
+
# Mark email as read if UTR matches
|
90
|
+
mail.uid('store', latest_email_uid, '+FLAGS', '\\Seen')
|
91
|
+
|
83
92
|
senderName = transactionInfo.split("/")[3]
|
84
93
|
senderBank = transactionInfo.split("/")[-1]
|
85
94
|
transactions[transactionNumber] = {"UTR":transactionNumber,"dateAndTime":dateAndTime,"amountPaid":amountCredited,
|
@@ -100,22 +109,23 @@ class PKGmailReader:
|
|
100
109
|
return transactions
|
101
110
|
|
102
111
|
@classmethod
|
103
|
-
def getTransactionsDict(self,forNthDayFromToday=0):
|
112
|
+
def getTransactionsDict(self,forNthDayFromToday=0,utr=None):
|
104
113
|
secrets = PKEnvironment().allSecrets
|
105
114
|
trans = PKGmailReader.getTransactions(secrets["MCU"],
|
106
115
|
secrets["MCAP"],
|
107
116
|
secrets["MCL"],
|
108
117
|
secrets["MS"],
|
109
|
-
forNthDayFromToday=forNthDayFromToday
|
118
|
+
forNthDayFromToday=forNthDayFromToday,
|
119
|
+
utr=utr)
|
110
120
|
return trans
|
111
121
|
|
112
122
|
@classmethod
|
113
123
|
def matchUTR(self,utr=None):
|
114
124
|
if utr is not None and len(str(utr)) > 1:
|
115
125
|
foundTransaction = None
|
116
|
-
for days in [0,1]:
|
126
|
+
for days in [0,1,2,3]:
|
117
127
|
try:
|
118
|
-
transactions = PKGmailReader.getTransactionsDict(forNthDayFromToday=days)
|
128
|
+
transactions = PKGmailReader.getTransactionsDict(forNthDayFromToday=days,utr=utr)
|
119
129
|
if str(utr) in transactions.keys():
|
120
130
|
foundTransaction = transactions.get(str(utr))
|
121
131
|
break
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/NSEMarketStatus.py
RENAMED
@@ -22,6 +22,7 @@
|
|
22
22
|
SOFTWARE.
|
23
23
|
|
24
24
|
"""
|
25
|
+
import sys
|
25
26
|
import multiprocessing
|
26
27
|
if __name__ == '__main__':
|
27
28
|
multiprocessing.freeze_support()
|
@@ -85,6 +86,9 @@ class NSEMarketStatus(SingletonMixin, metaclass=SingletonType):
|
|
85
86
|
return shouldFetch, next_bell, filePath, modifiedDateTime
|
86
87
|
|
87
88
|
def getNextBell(self):
|
89
|
+
if not 'pytest' in sys.modules:
|
90
|
+
return '2025-02-14T09:15:00+05:30'
|
91
|
+
|
88
92
|
next_bell = self.marketStatus.get("next_bell")
|
89
93
|
if next_bell is not None:
|
90
94
|
return next_bell
|
@@ -67,12 +67,18 @@ class PKUserSusbscriptions:
|
|
67
67
|
pass
|
68
68
|
|
69
69
|
@classmethod
|
70
|
-
def updateSubscription(self,userID,subscription:PKSubscriptionModel=PKSubscriptionModel.No_Subscription):
|
70
|
+
def updateSubscription(self,userID,subscription:PKSubscriptionModel=PKSubscriptionModel.No_Subscription,subValue=0):
|
71
71
|
dbManager = DBManager()
|
72
72
|
user = None
|
73
73
|
dbUsers = dbManager.getUserByID(userID=userID)
|
74
74
|
if len(dbUsers) > 0:
|
75
75
|
user = dbUsers[0]
|
76
|
+
if subValue > 0 and (subscription.value != subValue or subscription.value < PKSubscriptionModel.All_Scans_1_Day.value):
|
77
|
+
# Update the balance instead of the standard subscription
|
78
|
+
toppedUp = dbManager.topUpAlertSubscriptionBalance(userID=userID,topup=subValue)
|
79
|
+
if not toppedUp:
|
80
|
+
print(f"Could not top-up alert balance {subValue} for user:{userID}")
|
81
|
+
return
|
76
82
|
user.subscriptionmodel = str(subscription.value)
|
77
83
|
else:
|
78
84
|
user = PKUser.userFromDBRecord([userID,"","","","","","",str(subscription.value),0])
|
@@ -0,0 +1 @@
|
|
1
|
+
VERSION='0.13.20250213.233'
|
@@ -1,9 +1,9 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: PKDevTools
|
3
|
-
Version: 0.13.20250213.
|
3
|
+
Version: 0.13.20250213.233
|
4
4
|
Summary: A general day-to-day toolset for PKScreener repos
|
5
5
|
Home-page: https://github.com/pkjmesra/PKDevTools
|
6
|
-
Download-URL: https://github.com/pkjmesra/PKDevTools/archive/v0.13.20250213.
|
6
|
+
Download-URL: https://github.com/pkjmesra/PKDevTools/archive/v0.13.20250213.233.zip
|
7
7
|
Author: pkjmesra
|
8
8
|
Author-email: pkjmesra@gmail.com
|
9
9
|
License: OSI Approved (MIT)
|
@@ -1,9 +1,9 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: PKDevTools
|
3
|
-
Version: 0.13.20250213.
|
3
|
+
Version: 0.13.20250213.233
|
4
4
|
Summary: A general day-to-day toolset for PKScreener repos
|
5
5
|
Home-page: https://github.com/pkjmesra/PKDevTools
|
6
|
-
Download-URL: https://github.com/pkjmesra/PKDevTools/archive/v0.13.20250213.
|
6
|
+
Download-URL: https://github.com/pkjmesra/PKDevTools/archive/v0.13.20250213.233.zip
|
7
7
|
Author: pkjmesra
|
8
8
|
Author-email: pkjmesra@gmail.com
|
9
9
|
License: OSI Approved (MIT)
|
@@ -1 +0,0 @@
|
|
1
|
-
VERSION='0.13.20250213.231'
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/Archiver.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/ColorText.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/Committer.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/CookieHelper.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/DBManager.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/Environment.py
RENAMED
File without changes
|
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/FunctionTimeouts.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/MarketHours.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/MenuOptions.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/OutputControls.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/PKDateUtilities.py
RENAMED
File without changes
|
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/PKJoinableQueue.py
RENAMED
File without changes
|
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/PKPickler.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/Singleton.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/SuppressOutput.py
RENAMED
File without changes
|
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/Telegram.py
RENAMED
File without changes
|
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/WorkflowManager.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/githubutilities.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/pubsub/__init__.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/pubsub/events.py
RENAMED
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools/classes/pubsub/publisher.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools.egg-info/entry_points.txt
RENAMED
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools.egg-info/not-zip-safe
RENAMED
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools.egg-info/requires.txt
RENAMED
File without changes
|
{pkdevtools-0.13.20250213.231 → pkdevtools-0.13.20250213.233}/PKDevTools.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|