Skip to content

Commit ca3f6c9

Browse files
committed
Return responses as a class object instead of a dictionary
Delete messages after sending an SMS Do not remove docs directory if version is not bumped Generate CHANGELOG in reverse
1 parent 371c20b commit ca3f6c9

18 files changed

Lines changed: 357 additions & 230 deletions

CHANGELOG

Lines changed: 100 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,167 +1,174 @@
11
Change Log
22
==========
33

4-
0.0.1 (06/07/2020)
4+
0.3.6 (11/10/2021)
55
------------------
6-
- Initial commit
6+
- Return responses as a class object instead of a dictionary
7+
- Delete messages after sending an SMS
8+
- Do not remove docs directory if version is not bumped
9+
- Generate CHANGELOG in reverse
710

8-
0.0.2 (06/08/2020)
11+
0.3.5 (10/16/2021)
912
------------------
10-
- read raw email
13+
- Add project URLs and package requirements to pypi
14+
- Add markdown support to sphinx autodocs
15+
- Add a condition check for version upgrade
16+
- Update docs and changelog
1117

12-
0.0.3 (06/08/2020)
18+
0.3.4 (08/11/2021)
1319
------------------
14-
- decode raw email using email library
20+
- Add new lines to the message start to separate subject and body of the SMS
21+
- Update sphinx documentation to 4.1.2
1522

16-
0.0.4 (06/08/2020)
23+
0.3.3 (08/04/2021)
1724
------------------
18-
- decode body of the email and display only text part
25+
- Fix incorrect HTTP return codes
1926

20-
0.0.5 (06/08/2020)
27+
0.3.2 (07/24/2021)
2128
------------------
22-
- added time when the email was received
29+
- Remove logger module.
30+
- Add exception handlers for Messenger class.
31+
- Update docs and CHANGELOG
32+
- Bump version.
2333

24-
0.0.6 (06/08/2020)
34+
0.3.1 (07/22/2021)
2535
------------------
26-
- pdt to cdt
36+
- Return a dictionary element after sending an email/SMS.
37+
- Add status code and description to return dict.
38+
- Update docs and CHANGELOG
39+
- Bump version.
2740

28-
0.0.7 (06/08/2020)
41+
0.3.0 (07/19/2021)
2942
------------------
30-
- user input condition to read email
43+
- Allow users to add multiple recipients while sending email.
44+
- Add CC and BCC options.
45+
- Check if attachment file is available before trying to attach.
46+
- Wrap recipient, cc and bcc items in a single list before email kick off.
47+
- Remove sender arg and default to the user login email address.
48+
- Fix version number format.
3149

32-
0.0.8 (06/08/2020)
50+
0.2.9 (07/19/2021)
3351
------------------
34-
- include number of unread emails on top
52+
- Add logging
53+
- Remove print statements
54+
- Bump version
3555

36-
0.0.9 (06/08/2020)
56+
0.2.8 (07/19/2021)
3757
------------------
38-
- get user input before showing any content
58+
- Bump version to support github action
59+
- Auto upload to pypi
3960

40-
0.1.0 (06/08/2020)
61+
0.2.7 (07/19/2021)
4162
------------------
42-
- get user input before reading multiple emails
63+
- auto upload to pypi when tagged a release version
4364

44-
0.1.1 (06/08/2020)
65+
0.2.6 (07/19/2021)
4566
------------------
46-
- added comments
67+
- onboard docs.yml but only prints a statement
4768

48-
0.1.2 (06/08/2020)
69+
0.2.5 (07/19/2021)
4970
------------------
50-
- improve coding standards
71+
- Add badges
72+
- Update README.md and CHANGELOG
73+
- Bump version
5174

52-
0.1.3 (06/09/2020)
75+
0.2.4 (07/18/2021)
5376
------------------
54-
- improve coding standards
77+
- Onboard `pypi` module
78+
- Add `setup.py`, `setup.cfg`, `__init__.py`, `CHANGELOG`
79+
- Update README.md and docs
80+
- Move files to `gmailconnector` support package
5581

56-
0.1.4 (06/11/2020)
82+
0.2.3 (07/18/2021)
5783
------------------
58-
- fix typo
84+
- Increase page width and update README.md
5985

60-
0.1.5 (06/27/2020)
86+
0.2.2 (07/18/2021)
6187
------------------
62-
- modify date time type standards instead of using index values
88+
- Onboard send_sms.py and update docs
6389

64-
0.1.6 (06/27/2020)
90+
0.2.1 (07/17/2021)
6591
------------------
66-
- included exception handler
92+
- Onboard sphinx auto generated documentation
6793

68-
0.1.7 (06/28/2020)
94+
0.2.0 (07/17/2021)
6995
------------------
70-
- look for env variables before failing
96+
- Refactor read_email.py and add send_email.py
97+
- Add pre-commit for linting
98+
- Update README.md
99+
100+
0.1.9 (06/28/2020)
101+
------------------
102+
- update README.md
71103

72104
0.1.8 (06/28/2020)
73105
------------------
74106
- add LICENSE
75107

76-
0.1.9 (06/28/2020)
108+
0.1.7 (06/28/2020)
77109
------------------
78-
- update README.md
110+
- look for env variables before failing
79111

80-
0.2.0 (07/17/2021)
112+
0.1.6 (06/27/2020)
81113
------------------
82-
- Refactor read_email.py and add send_email.py
83-
- Add pre-commit for linting
84-
- Update README.md
114+
- included exception handler
85115

86-
0.2.1 (07/17/2021)
116+
0.1.5 (06/27/2020)
87117
------------------
88-
- Onboard sphinx auto generated documentation
118+
- modify date time type standards instead of using index values
89119

90-
0.2.2 (07/18/2021)
120+
0.1.4 (06/11/2020)
91121
------------------
92-
- Onboard send_sms.py and update docs
122+
- fix typo
93123

94-
0.2.3 (07/18/2021)
124+
0.1.3 (06/09/2020)
95125
------------------
96-
- Increase page width and update README.md
126+
- improve coding standards
97127

98-
0.2.4 (07/18/2021)
128+
0.1.2 (06/08/2020)
99129
------------------
100-
- Onboard `pypi` module
101-
- Add `setup.py`, `setup.cfg`, `__init__.py`, `CHANGELOG`
102-
- Update README.md and docs
103-
- Move files to `gmailconnector` support package
130+
- improve coding standards
104131

105-
0.2.5 (07/19/2021)
132+
0.1.1 (06/08/2020)
106133
------------------
107-
- Add badges
108-
- Update README.md and CHANGELOG
109-
- Bump version
134+
- added comments
110135

111-
0.2.6 (07/19/2021)
136+
0.1.0 (06/08/2020)
112137
------------------
113-
- onboard docs.yml but only prints a statement
138+
- get user input before reading multiple emails
114139

115-
0.2.7 (07/19/2021)
140+
0.0.9 (06/08/2020)
116141
------------------
117-
- auto upload to pypi when tagged a release version
142+
- get user input before showing any content
118143

119-
0.2.8 (07/19/2021)
144+
0.0.8 (06/08/2020)
120145
------------------
121-
- Bump version to support github action
122-
- Auto upload to pypi
146+
- include number of unread emails on top
123147

124-
0.2.9 (07/19/2021)
148+
0.0.7 (06/08/2020)
125149
------------------
126-
- Add logging
127-
- Remove print statements
128-
- Bump version
150+
- user input condition to read email
129151

130-
0.3.0 (07/19/2021)
152+
0.0.6 (06/08/2020)
131153
------------------
132-
- Allow users to add multiple recipients while sending email.
133-
- Add CC and BCC options.
134-
- Check if attachment file is available before trying to attach.
135-
- Wrap recipient, cc and bcc items in a single list before email kick off.
136-
- Remove sender arg and default to the user login email address.
137-
- Fix version number format.
154+
- pdt to cdt
138155

139-
0.3.1 (07/22/2021)
156+
0.0.5 (06/08/2020)
140157
------------------
141-
- Return a dictionary element after sending an email/SMS.
142-
- Add status code and description to return dict.
143-
- Update docs and CHANGELOG
144-
- Bump version.
158+
- added time when the email was received
145159

146-
0.3.2 (07/24/2021)
160+
0.0.4 (06/08/2020)
147161
------------------
148-
- Remove logger module.
149-
- Add exception handlers for Messenger class.
150-
- Update docs and CHANGELOG
151-
- Bump version.
162+
- decode body of the email and display only text part
152163

153-
0.3.3 (08/04/2021)
164+
0.0.3 (06/08/2020)
154165
------------------
155-
- Fix incorrect HTTP return codes
166+
- decode raw email using email library
156167

157-
0.3.4 (08/11/2021)
168+
0.0.2 (06/08/2020)
158169
------------------
159-
- Add new lines to the message start to separate subject and body of the SMS
160-
- Update sphinx documentation to 4.1.2
170+
- read raw email
161171

162-
0.3.5 (10/16/2021)
172+
0.0.1 (06/07/2020)
163173
------------------
164-
- Add project URLs and package requirements to pypi
165-
- Add markdown support to sphinx autodocs
166-
- Add a condition check for version upgrade
167-
- Update docs and changelog
174+
- Initial commit

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,28 @@ https://pypi.org/project/gmail-connector/
3333
```python
3434
from gmailconnector.send_sms import Messenger
3535

36-
messenger = Messenger(
36+
response = Messenger(
3737
gmail_user='username@gmail.com',
3838
gmail_pass='<ACCOUNT_PASSWORD>',
3939
phone_number='+11234567890',
4040
message='Test SMS using gmail-connector'
41-
)
42-
print(messenger.send_sms())
41+
).send_sms()
42+
if response.ok:
43+
print(response.json())
4344
```
4445

4546
[Send Email](https://github.com/thevickypedia/gmail-connector/blob/master/gmailconnector/send_email.py)
4647
```python
4748
from gmailconnector.send_email import SendEmail
4849

49-
email_obj = SendEmail(
50+
response = SendEmail(
5051
gmail_user='username@gmail.com',
5152
gmail_pass='<ACCOUNT_PASSWORD>',
5253
recipient='another_username@gmail.com',
5354
subject='Howdy!'
54-
)
55-
print(email_obj.send_email())
55+
).send_email()
56+
if response.ok:
57+
print(response.json())
5658
```
5759
<details>
5860
<summary><strong>More on <a href="https://github.com/thevickypedia/gmail-connector/blob/master/gmailconnector/send_email.py">SendEmail</a></strong></summary>
@@ -83,7 +85,7 @@ ReadEmail(
8385

8486
**Requirement**
8587
<br>
86-
`pip install --no-cache --upgrade sphinx pre-commit`
88+
`pip install --no-cache --upgrade sphinx pre-commit recommonmark`
8789

8890
**Usage**
8991
<br>

docs/README.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,25 +73,27 @@ <h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">
7373
<br><p><a class="reference external" href="https://github.com/thevickypedia/gmail-connector/blob/master/gmailconnector/send_sms.py">Send SMS</a></p>
7474
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">gmailconnector.send_sms</span> <span class="kn">import</span> <span class="n">Messenger</span>
7575

76-
<span class="n">messenger</span> <span class="o">=</span> <span class="n">Messenger</span><span class="p">(</span>
76+
<span class="n">response</span> <span class="o">=</span> <span class="n">Messenger</span><span class="p">(</span>
7777
<span class="n">gmail_user</span><span class="o">=</span><span class="s1">&#39;username@gmail.com&#39;</span><span class="p">,</span>
7878
<span class="n">gmail_pass</span><span class="o">=</span><span class="s1">&#39;&lt;ACCOUNT_PASSWORD&gt;&#39;</span><span class="p">,</span>
7979
<span class="n">phone_number</span><span class="o">=</span><span class="s1">&#39;+11234567890&#39;</span><span class="p">,</span>
8080
<span class="n">message</span><span class="o">=</span><span class="s1">&#39;Test SMS using gmail-connector&#39;</span>
81-
<span class="p">)</span>
82-
<span class="nb">print</span><span class="p">(</span><span class="n">messenger</span><span class="o">.</span><span class="n">send_sms</span><span class="p">())</span>
81+
<span class="p">)</span><span class="o">.</span><span class="n">send_sms</span><span class="p">()</span>
82+
<span class="k">if</span> <span class="n">response</span><span class="o">.</span><span class="n">ok</span><span class="p">:</span>
83+
<span class="nb">print</span><span class="p">(</span><span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">())</span>
8384
</pre></div>
8485
</div>
8586
<p><a class="reference external" href="https://github.com/thevickypedia/gmail-connector/blob/master/gmailconnector/send_email.py">Send Email</a></p>
8687
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">gmailconnector.send_email</span> <span class="kn">import</span> <span class="n">SendEmail</span>
8788

88-
<span class="n">email_obj</span> <span class="o">=</span> <span class="n">SendEmail</span><span class="p">(</span>
89+
<span class="n">response</span> <span class="o">=</span> <span class="n">SendEmail</span><span class="p">(</span>
8990
<span class="n">gmail_user</span><span class="o">=</span><span class="s1">&#39;username@gmail.com&#39;</span><span class="p">,</span>
9091
<span class="n">gmail_pass</span><span class="o">=</span><span class="s1">&#39;&lt;ACCOUNT_PASSWORD&gt;&#39;</span><span class="p">,</span>
9192
<span class="n">recipient</span><span class="o">=</span><span class="s1">&#39;another_username@gmail.com&#39;</span><span class="p">,</span>
9293
<span class="n">subject</span><span class="o">=</span><span class="s1">&#39;Howdy!&#39;</span>
93-
<span class="p">)</span>
94-
<span class="nb">print</span><span class="p">(</span><span class="n">email_obj</span><span class="o">.</span><span class="n">send_email</span><span class="p">())</span>
94+
<span class="p">)</span><span class="o">.</span><span class="n">send_email</span><span class="p">()</span>
95+
<span class="k">if</span> <span class="n">response</span><span class="o">.</span><span class="n">ok</span><span class="p">:</span>
96+
<span class="nb">print</span><span class="p">(</span><span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">())</span>
9597
</pre></div>
9698
</div>
9799
<details>
@@ -122,7 +124,7 @@ <h3>Linting<a class="headerlink" href="#linting" title="Permalink to this headli
122124
<p><code class="docutils literal notranslate"><span class="pre">PreCommit</span></code> will ensure linting, and the doc creation are run on every commit.</p>
123125
<p><strong>Requirement</strong>
124126
<br>
125-
<code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">--no-cache</span> <span class="pre">--upgrade</span> <span class="pre">sphinx</span> <span class="pre">pre-commit</span></code></p>
127+
<code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">--no-cache</span> <span class="pre">--upgrade</span> <span class="pre">sphinx</span> <span class="pre">pre-commit</span> <span class="pre">recommonmark</span></code></p>
126128
<p><strong>Usage</strong>
127129
<br>
128130
<code class="docutils literal notranslate"><span class="pre">pre-commit</span> <span class="pre">run</span> <span class="pre">--all-files</span></code></p>
@@ -212,7 +214,7 @@ <h3>Navigation</h3>
212214
</div>
213215
<div class="footer" role="contentinfo">
214216
&#169; Copyright 2021, Vignesh Sivanandha Rao.
215-
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.2.0.
217+
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.0.
216218
</div>
217219
</body>
218220
</html>

0 commit comments

Comments
 (0)