From f8183a956559fa357a1938fd7e1bc8a21b37a0a8 Mon Sep 17 00:00:00 2001 From: Prajwal&Amin Date: Thu, 15 Jun 2023 08:28:40 +0530 Subject: [PATCH 1/3] Session3 assignment --- .../Batman/Batman/__init__.py | 0 .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 144 bytes .../__pycache__/settings.cpython-310.pyc | Bin 0 -> 2364 bytes .../Batman/__pycache__/urls.cpython-310.pyc | Bin 0 -> 990 bytes .../Batman/__pycache__/wsgi.cpython-310.pyc | Bin 0 -> 545 bytes .../Batman/Batman/asgi.py | 16 + .../Batman/Batman/settings.py | 128 + .../Batman/Batman/urls.py | 23 + .../Batman/Batman/wsgi.py | 16 + .../S:\\web_scapping\\python_blogs.html" | 2905 +++++++++++++++++ .../__pycache__/unittest_api.cpython-310.pyc | Bin 0 -> 1525 bytes .../Batman/db.sqlite3 | Bin 0 -> 135168 bytes .../Batman/docker-compose.yml | 30 + .../Batman/dockerfiles/Dockerfile | 20 + .../Batman/manage.py | 22 + .../Batman/members/__init__.py | 0 .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 145 bytes .../members/__pycache__/admin.cpython-310.pyc | Bin 0 -> 745 bytes .../members/__pycache__/apps.cpython-310.pyc | Bin 0 -> 3245 bytes .../__pycache__/models.cpython-310.pyc | Bin 0 -> 1321 bytes .../members/__pycache__/urls.cpython-310.pyc | Bin 0 -> 466 bytes .../members/__pycache__/views.cpython-310.pyc | Bin 0 -> 2570 bytes .../Batman/members/admin.py | 16 + .../Batman/members/apps.py | 124 + .../Batman/members/migrations/0001_initial.py | 40 + .../Batman/members/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-310.pyc | Bin 0 -> 1230 bytes ...02_students_delete_members.cpython-310.pyc | Bin 0 -> 940 bytes .../__pycache__/0003_blog.cpython-310.pyc | Bin 0 -> 868 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 144 bytes .../Batman/members/models.py | 34 + .../Batman/members/myfirst.html | 9 + .../Batman/members/templates/myfirst.html | 9 + .../Batman/members/tests.py | 3 + .../Batman/members/urls.py | 10 + .../Batman/members/views.py | 72 + .../Batman/unittest_api.py | 38 + .../Batman/web_scrapper.py | 103 + 38 files changed, 3618 insertions(+) create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/__init__.py create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/__pycache__/__init__.cpython-310.pyc create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/__pycache__/settings.cpython-310.pyc create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/__pycache__/urls.cpython-310.pyc create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/__pycache__/wsgi.cpython-310.pyc create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/asgi.py create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/settings.py create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/urls.py create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/wsgi.py create mode 100644 "Vivekananda_session3_4VP20CS062_Prajwal/Batman/S:\\web_scapping\\python_blogs.html" create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/__pycache__/unittest_api.cpython-310.pyc create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/db.sqlite3 create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/docker-compose.yml create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/dockerfiles/Dockerfile create mode 100755 Vivekananda_session3_4VP20CS062_Prajwal/Batman/manage.py create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/__init__.py create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/__pycache__/__init__.cpython-310.pyc create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/__pycache__/admin.cpython-310.pyc create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/__pycache__/apps.cpython-310.pyc create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/__pycache__/models.cpython-310.pyc create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/__pycache__/urls.cpython-310.pyc create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/__pycache__/views.cpython-310.pyc create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/admin.py create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/apps.py create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/migrations/0001_initial.py create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/migrations/__init__.py create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/migrations/__pycache__/0001_initial.cpython-310.pyc create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/migrations/__pycache__/0002_students_delete_members.cpython-310.pyc create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/migrations/__pycache__/0003_blog.cpython-310.pyc create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/migrations/__pycache__/__init__.cpython-310.pyc create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/models.py create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/myfirst.html create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/templates/myfirst.html create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/tests.py create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/urls.py create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/views.py create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/unittest_api.py create mode 100644 Vivekananda_session3_4VP20CS062_Prajwal/Batman/web_scrapper.py diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/__init__.py b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/__pycache__/__init__.cpython-310.pyc b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..47459f97903b9d60ea58205e8d91296c7d31485a GIT binary patch literal 144 zcmd1j<>g`kf=B-XQb6=$5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;!Hqenx(7s(wLH zVpe%#j(&N5QFd`geu0smfxc5>Np4~ujEaxX%*!l^kJl@xyv1RYo1apelWGStte6Q% HurL4slCU5v literal 0 HcmV?d00001 diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/__pycache__/settings.cpython-310.pyc b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/__pycache__/settings.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4133c89f3431d17472fa0fb7a792259aa5696830 GIT binary patch literal 2364 zcmb7G-EY%Y6t`0+F=+#(1OlBtH%$yTaZ5xJN3laUKg@D+Z<5>k3*Q^M z`gL#n8_=}zHfev6U-z_sU=L^#J9ZKprAX`S_}ce;{Lb<3o^u_)SS)aG{4)9(-6(S0 zpUGtY5MlBRF8T)yh%-6Fqm0A588gFkID?md;(rx>;|{V1Su=;0%sdiI5oL$Gd2Yy| z+*{r(z&#K5Wh9y_D3J;%kuAUF36ECZ2w+=8Me{s5k1n89bP=tgb#w_`ev>1-c>!HP z8(?<@T}{VN((xMMhl06^uA3Lpr{)^OT!-rtx?x^MpP5(C=Q>xC>=Ms$h1!Ab4Sk7X z#)vnh(!dX;9hHOZD)+>|A`gi!CaufV12m~9}8`p zjiQ|?2gIYeKMwI`<&I-pL+6WIhg+q}B%Xp(fXov3_-6i2oo3VF?Jka8f`2nDW(*dKCN&; zVGqIM+M)-8wdp4-0y-DFJseWm4gxASCzGo04ag93-kf^61R)0>*&&uw8VEa<^@I<2 zXnxQ|j}`+>Q;ep*hgieva+YN0OYeCW!bk1*i(t`3hbZAtb zf-vj`4s@a118?l1S)a(Yv>}bDn#OBsW&Fr2=%7C28TNr(oKstS^_Ch7Eu{%#S64f+*j99XU+X}k&o$kEy+Z34 z;WBI-(es5jPwOtQDLwK-WWnY{P@1sZr8rbrLgkoYow&rYlXiMJvGBv_=~^zYaHhS*pobFiaUy~ zCZ!S=bhX-14eN#aeVnbSJKepws5BbdzFM=AwbJAB^_Fgc2n0}HdR%DMYqf^DuXNOS zrK4$v)$KH@T5C5xXQ<6~Lorl6UftLC>WO`$UR9D(jL+2+LrKEw@l~a3Jhx^wVZBru zbx>+h!NrEs+UqKNs#Vo$Dgf4-s%2_WP9hYNRe!MEigU@6VM68xAXk&<@mfvYRk{ts z0%XnFt*edN?_78bSV)I=x67gLvoh4wAr0(4E>psAdD0snzGZT79E;xo$72USg}(qC z?Z6;#D=Vu@LS9(PWyGvl5DFO~!)JIglX)-vBfJ+@Gx=mbJB4>3y9hdA?)qC;7r+h9 HoS6L=lPf1N literal 0 HcmV?d00001 diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/__pycache__/urls.cpython-310.pyc b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/__pycache__/urls.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..179e622b8fa65e3368bba516a7f079d43b27424a GIT binary patch literal 990 zcmb7D%Z}496m`<{LE1s{3EriVN(>dN3PwD{h>;M8*QT3}8@o+PY)7`kFqK&KYxt#X zS@8=j5Z7rURY*u+DUK5zpL@=^wmLft5sWt%Z`r(u(0BK7Is*830*`SMLrcUw<`dRsup1uyt-lO1=vN=1@Z-BzI8}0! zZ!1l0t|ZXn>;d~Kd7@4)DSrEchY7(}ia;v&>sS<=s@-UebtI9kz#DNKv zHza)Vg$m#@i}13NX`{F)+mJp;@KeSxNY6#7v|V7l(Mn)(yP{>;{yfTT@beb$95@3f z4q+>p&8AT_Ykg%(@EMj=@W+u`M{)SPpvK%=gE4l(`ZpEIW?VZVNu#)v^AfoJM~%ZL z)T|uIH2y=;l}w9@<#G!lH1(V{*WfOnt0ou>QlLE!%cn8kv{5dOaUI){xWGG+Eq2y~ z^3Q75h1wDbu&Wfg9}RC5$Kek+$0+vdK4l`8v0o2cTphUR_ani@nrlP$lXlf?-47Z( zc^%)WhpQDFpw+6r+iC`@R_ALCXB*Yy6C)a~6w>Yv)q%+^uLEbV9-p-Q8`5J3a??*j zT#req>F$OWaS literal 0 HcmV?d00001 diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/__pycache__/wsgi.cpython-310.pyc b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/Batman/__pycache__/wsgi.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa3890cee32ae764b31bab7ff30b55c5c5285ee2 GIT binary patch literal 545 zcmYjP!EO^V5cN7~Qx*yw5NBT_!MdtAA%qHQiGmVSvEm5?I$Sv=$#VFcFww2IZxO#~Rk4*;;tDEm>heviV#%r&T4QLOY)) zyjO|Dpa-UG;xpR + + + + + + + + + + + + + + +Python Insider + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ +
+ +

Wednesday, June 7, 2023

+ +
+ +
+
+ +

+Python 3.11.4, 3.10.12, 3.9.17, 3.8.17, 3.7.17, and 3.12.0 beta 2 are now available +

+
+
+
+
+

Greetings! Time for another combined release of six separate versions of Python!

+

+Before you scroll away to the download links

+

Please test the 3.12 beta! Downloading it and trying it out helps us a + lot in ensuring Python 3.12.0 will be as polished as possible.

+

We welcome 3.10 to the prestigious club of security-only releases. +It’s officially an old version of Python now! If you haven’t rewritten +all your if:elif:else:s with pattern matching yet, are you even still writing Python?

+

At the same time, it looks like 3.7 is reaching end-of-life. Unless +another security release happens in June, 3.7.17 will be the final +release of Python 3.7. I mean, now that I typed it out for all you to +read, I’m sure I jinxed it. But in case I didn’t, I would like to thank +Ned Deily for serving as the release manager of Python 3.6 and Python +3.7. He was my mentor as Release Manager, and continues serving Python +as the provider of Mac installers for new releases. Thank you, Ned!

+

Speaking of installers, Steve Dower used to be the sole provider of +Windows installers for Python releases for years now. His secret was a +well-automated Azure pipeline that let him build, sign, and publish +releases with minimal manual effort. Now he extended the power to press +the blue “Run pipeline” button to more members of the team. Thank you, +Steve! This is an important bus factor increment. In fact, the Windows +installers for both 3.12.0b2 and 3.11.4 were made by me initiated by me. If there’s anything wrong with them, well, I guess that means I pressed the button wrong.

+

+Security fixes in today’s releases

+

Updating is recommended due to security content:

+
  • 3.7 - 3.12: gh-103142: + The version of OpenSSL used in Windows and Mac installers has been +upgraded to 1.1.1u to address CVE-2023-2650, CVE-2023-0465, +CVE-2023-0466, CVE-2023-0464, as well as CVE-2023-0286, CVE-2022-4303, +and CVE-2022-4303 fixed previously in 1.1.1t (gh-101727).
  • 3.7 - 3.11: gh-102153: urllib.parse.urlsplit() + now strips leading C0 control and space characters following the +specification for URLs defined by WHATWG in response to CVE-2023-24329.
  • 3.7 - 3.11: gh-99889: Fixed a security in flaw in uu.decode() that could allow for directory traversal based on the input if no out_file was specified.
  • 3.7 - 3.11: gh-104049: Do not expose the local on-disk location in directory indexes produced by http.client.SimpleHTTPRequestHandler.
  • 3.7 - 3.11: gh-101283: subprocess.Popen now uses a safer approach to find cmd.exe when launching with shell=True.
  • 3.8 - 3.11: gh-103935: trace.__main__ now uses io.open_code() for files to be executed instead of raw open().
  • 3.8 - 3.11: gh-102953: The extraction methods in tarfile, and shutil.unpack_archive(), have a new filter argument that allows limiting tar features than may be surprising or dangerous, such as creating files outside the destination directory. See Extraction filters for details.
  • 3.9: gh-102126: Fixed a deadlock at shutdown when clearing thread states if any finalizer tries to acquire the runtime head lock.
  • 3.9: gh-100892: Fixed a crash due to a race while iterating over thread states in clearing threading.local.

Python 3.12.0 beta 2

+

Get it here: 3.12.0b2

+

116 new commits since 3.12.0 beta 1.

+

Python 3.11.4

+

Get it here: 3.11.4

+

233 new commits.

+

Python 3.10.12

+

Get it here: 3.10.12

+

Security-only release with no binaries. 20 new commits.

+

Python 3.9.17

+

Get it here: 3.9.17

+

Security-only release with no binaries. 26 commits.

+

Python 3.8.17

+

Get it here: 3.8.17

+

Security-only release with no binaries. 24 commits.

+

Python 3.7.17

+

Get it here as it might be the last release of 3.7 ever:
3.7.17

+

Security-only release with no binaries. 21 commits.

+

We hope you enjoy the new releases!

+

Thanks to all of the many volunteers who help make Python Development + and these releases possible! Please consider supporting our efforts by +volunteering yourself or through organization contributions to the Python Software Foundation.

+


+Łukasz Langa @ambv
+on behalf of your friendly release team,

+

Ned Deily @nad
+Steve Dower @steve.dower
+Pablo Galindo Salgado @pablogsal
+Łukasz Langa @ambv
+Thomas Wouters @thomas

 

+
+
+ +
+
+ +
+ + +
+ +

Monday, May 22, 2023

+ +
+ +
+
+ +

+Python 3.12.0 beta 1 released +

+
+
+
+
+

I'm pleased to announce the release of Python 3.12 beta 1 (and feature freeze for Python 3.12).

https://www.python.org/downloads/release/python-3120b1/

This is a beta preview of Python 3.12


Python 3.12 is still in development. This release, 3.12.0b1, is the first of four planned beta release previews of 3.12.

Beta release previews are intended to give the wider community the opportunity to test new features and bug fixes and to prepare their projects to support the new feature release.

We strongly encourage maintainers of third-party Python projects to test with 3.12 during the beta phase and report issues found to [the Python bug tracker (Issues · python/cpython · GitHub) as soon as possible. While the release is planned to be feature complete entering the beta phase, it is possible that features may be modified or, in rare cases, deleted up until the start of the release candidate phase (Monday, 2023-07-31). Our goal is to have no ABI changes after beta 4 and as few code changes as possible after 3.12.0rc1, the first release candidate. To achieve that, it will be extremely important to get as much exposure for 3.12 as possible during the beta phase.

Please keep in mind that this is a preview release and its use is not recommended for production environments.


Major new features of the 3.12 series, compared to 3.11

Some of the new major new features and changes in Python 3.12 are:

  • New type annotation syntax for generic classes (PEP 695).
  • More flexible f-string parsing, allowing many things previously disallowed (PEP 701).
  • Even more improved error messages. More exceptions potentially caused by typos now make suggestions to the user.
  • Many large and small performance improvements (like PEP 709).
  • Support for the Linux perf profiler to report Python function names in traces.
  • The deprecated wstr and wstr_length members of the C implementation of unicode objects were removed, per PEP 623.
  • In the unittest module, a number of long deprecated methods and classes were removed. (They had been deprecated since Python 3.1 or 3.2).
  • The deprecated smtpd and distutils modules have been removed (see PEP 594 and PEP 632. The setuptools package (installed by default in virtualenvs and many other places) continues to provide the distutils module.
  • A number of other old, broken and deprecated functions, classes and methods have been removed.
  • Invalid backslash escape sequences in strings now warn with SyntaxWarning instead of DeprecationWarning, making them more visible. (They will become syntax errors in the future.)
  • The internal representation of integers has changed in preparation for performance enhancements. (This should not affect most users as it is an internal detail, but it may cause problems for Cython-generated code.)
  • (Hey, fellow core developer, if a feature you find important is missing from this list, let Thomas know.)

For more details on the changes to Python 3.12, see What’s new in Python 3.12. The next pre-release of Python 3.12 will be 3.12.0b2, currently scheduled for 2023-05-29.


More resources


PEP 693, the Python 3.12 Release Schedule.
Report bugs via GitHub Issues.


And now for something completely different

As the first beta release marks the point at which we fork off the release branch from the main development branch, here’s a poem about forks in the road.

Two roads diverged in a yellow wood,
And sorry I could not travel both
And be one traveler, long I stood
And looked down one as far as I could
To where it bent in the undergrowth;

Then took the other, as just as fair,
And having perhaps the better claim,
Because it was grassy and wanted wear;
Though as for that the passing there
Had worn them really about the same,

And both that morning equally lay
In leaves, no step had trodden black.
Oh, I kept the first for another day!
Yet knowing how way leads on to way,
I doubted if I should ever come back.

I shall be telling this with a sigh
Somewhere ages and ages hence:
Two roads diverged in a wood, and I —
I took the one less traveled by,
And that has made all the difference.

The Road Not Taken, by Robert Frost.

Enjoy the new release


Thanks to all of the many volunteers who help make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation.

Your release team,
Thomas Wouters
Ned Deily
Steve Dower
+
+
+ +
+
+ +
+ + +
+ +

Wednesday, April 5, 2023

+ +
+ +
+
+ +

+Python 3.11.3, Python 3.10.11 and 3.12.0 alpha 7 are available +

+
+
+
+
+


It's time for another set of Python releases! Python 3.11.3, 3.10.11 and 3.12 alpha 7 are now available.

Python 3.12.0 alpha 7

The final alpha release of Python 3.12! The next release will be beta 1, which is also the feature freeze. Last chance to get your new features and API changes into 3.12!

https://www.python.org/downloads/release/python-3120a7/

246 new commits since 3.12.0a6.

Python 3.11.3

More bugfixes and security fixes for the best Python version (so far).

https://www.python.org/downloads/release/python-3113/

167 new commits since 3.11.2

Python 3.10.11

The final regular bugfix release for Python 3.10! It is now entering security-fix-only mode. This also means this is the last version for which we will ship Windows and macOS installers. If you rely on these binary releases, it's time to upgrade to Python 3.11.

https://www.python.org/downloads/release/python-31011/

121 new commits since 3.10.10.

We hope you enjoy the new releases!

Thanks to all of the many volunteers who help make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation.

https://www.python.org/psf/

From the release team,

Thomas Wouters
Pablo Galindo Salgado
Łukasz Langa
Ned Deily
Steve Dower

 

+
+
+ +
+
+ +
+ + +
+ +

Tuesday, March 7, 2023

+ +
+ +
+
+ +

+Python 3.12.0 alpha 6 released +

+
+
+
+
+

I'm pleased to announce the release of Python 3.12 alpha 6.

https://www.python.org/downloads/release/python-3120a6/

This is an early developer preview of Python 3.12.

Major new features of the 3.12 series, compared to 3.11


Python 3.12 is still in development. This release, 3.12.0a6 is the sixth of seven planned alpha releases.

Alpha releases are intended to make it easier to test the current state of new features and bug fixes and to test the release process.

During the alpha phase, features may be added up until the start of the beta phase (2023-05-08) and, if necessary, may be modified or deleted up until the release candidate phase (2023-07-31). Please keep in mind that this is a preview release and its use is not recommended for production environments.

Many new features for Python 3.12 are still being planned and written. Among the new major new features and changes so far:
  • Even more improved error messages. More exceptions potentially caused by typos now make suggestions to the user.
  • Support for the Linux perf profiler to report Python function names in traces.
  • The deprecated wstr and wstr_length members of the C implementation of unicode objects were removed, per PEP 623.
  • In the unittest module, a number of long deprecated methods and classes were removed. (They had been deprecated since Python 3.1 or 3.2).
  • The deprecated smtpd and distutils modules have been removed (see PEP 594 and PEP 632). The setuptools package (installed by default in virtualenvs and many other places) continues to provide the distutils module.
  • A number of other old, broken and deprecated functions, classes and methods have been removed.
  • Invalid backslash escape sequences in strings now warn with SyntaxWarning instead of DeprecationWarning, making them more visible. (They will become syntax errors in the future.)
  • The internal representation of integers has changed in preparation for performance enhancements. (This should not affect most users as it is an internal detail, but it may cause problems for Cython-generated code.)
  • (Hey, fellow core developer, if a feature you find important is missing from this list, let Thomas know.)

For more details on the changes in Python 3.12, see What's New In Python 3.12. The next pre-release of Python 3.12 will be 3.12.0a7, currently scheduled for 2023-04-03.

More resources



And now for something completely different


Let me not to the marriage of true minds
Admit impediments. Love is not love
Which alters when it alteration finds,
Or bends with the remover to remove:
O, no! it is an ever-fixed mark,
That looks on tempests and is never shaken;
It is the star to every wandering bark,
Whose worth’s unknown, although his height be taken.
Love’s not Time’s fool, though rosy lips and cheeks
Within his bending sickle’s compass come;
Love alters not with his brief hours and weeks,
But bears it out even to the edge of doom.

If this be error, and upon me prov’d,
I never writ, nor no man ever lov’d.

Sonnet 116, by William Shakespeare.

Enjoy the new releases



Thanks to all of the many volunteers who help make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation.


Your release team,
Thomas Wouters
Ned Deily
Steve Dower

 

+
+
+ +
+
+ +
+ + +
+ +

Wednesday, February 8, 2023

+ +
+ +
+
+ +

+Python 3.11.2, Python 3.10.10 and 3.12.0 alpha 5 are available +

+
+
+
+
+

Hi everyone,

I am happy to report that after solving some last-time problems we have a bunch of fresh releases for you!

Python 3.12.0 alpha 5

Check the new alpha of 3.12 with some Star Trek vibes:

https://www.python.org/downloads/release/python-3120a5/

210 new commits since 3.12.0a4 last month


Python 3.11.2

A shipment of bugfixes and security releases for the newest Python!

https://www.python.org/downloads/release/python-3112/

194 new commits since 3.11.1


Python 3.10.10

Your trusty Python3.10 just got more stable and secure!

https://www.python.org/downloads/release/python-31010/

131 new commits since 3.10.9


We hope you enjoy the new releases!

Thanks to all of the many volunteers who help make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation.

https://www.python.org/psf/ 

Your friendly release team,

Ned Deily @nad
Steve Dower @steve.dower
Pablo Galindo Salgado @pablogsal
Łukasz Langa @ambv
Thomas Wouters @thomas

+
+
+ +
+
+ +
+ + +
+ +

Tuesday, January 10, 2023

+ +
+ +
+
+ +

+Python 3.12.0 alpha 4 released +

+
+
+
+
+

I'm pleased to announce the release of Python 3.12 alpha 4.

https://www.python.org/downloads/release/python-3120a4/

This is an early developer preview of Python 3.12.

Major new features of the 3.12 series, compared to 3.11


Python 3.12 is still in development. This release, 3.12.0a4 is the fourth of seven planned alpha releases.

Alpha releases are intended to make it easier to test the current state of new features and bug fixes and to test the release process.

During the alpha phase, features may be added up until the start of the beta phase (2023-05-08) and, if necessary, may be modified or deleted up until the release candidate phase (2023-07-31). Please keep in mind that this is a preview release and its use is not recommended for production environments.

Many new features for Python 3.12 are still being planned and written. Among the new major new features and changes so far:
  • Even more improved error messages. More exceptions potentially caused by typos now make suggestions to the user.
  • Support for the Linux perf profiler to report Python function names in traces.
  • The deprecated wstr and wstr_length members of the C implementation of unicode objects were removed, per PEP 623.
  • In the unittest module, a number of long deprecated methods and classes were removed. (They had been deprecated since Python 3.1 or 3.2).
  • The deprecated smtpd and distutils modules have been removed (see PEP 594 and PEP 632). The setuptools package (installed by default in virtualenvs and many other places) continues to provide the distutils module.
  • A number of other old, broken and deprecated functions, classes and methods have been removed.
  • (Hey, fellow core developer, if a feature you find important is missing from this list, let Thomas know.)

For more details on the changes in Python 3.12, see What's New In Python 3.12. The next pre-release of Python 3.12 will be 3.12.0a4, currently scheduled for 2023-02-06.

More resources



And now for something completely different


Two haikus apt, as Python's development springs ever forward.

I write, erase, rewrite
Erase again, and then
A poppy blooms.

Haiku by Katsushika Hokusai.

O snail
Climb Mount Fuji,
But slowly, slowly!

Haiku by Kobayashi Issa.


Enjoy the new releases



Thanks to all of the many volunteers who help make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation.


Your release team,
Thomas Wouters
Ned Deily
Steve Dower

+
+
+ +
+
+ +
+ + +
+ +

Tuesday, December 6, 2022

+ +
+ +
+
+ +

+ Python 3.11.1, 3.10.9, 3.9.16, 3.8.16, 3.7.16, and 3.12.0 alpha 3 are now available +

+
+
+
+
+

Greetings! We bring you a slew of releases this fine Saint Nicholas / + Sinterklaas day. Six simultaneous releases has got to be some record. +There’s one more record we broke this time, you’ll see below.

+

In any case, updating is recommended due to security content:

+
  • 3.7 - 3.12: gh-98739: Updated bundled libexpat to 2.5.0 to fix CVE-2022-43680 (heap use-after-free).
  • 3.7 - 3.12: gh-98433: The IDNA codec decoder used on DNS hostnames by socket or asyncio related name resolution functions no longer involves a quadratic algorithm to fix CVE-2022-45061. + This prevents a potential CPU denial of service if an out-of-spec +excessive length hostname involving bidirectional characters were +decoded. Some protocols such as urllib http 3xx redirects potentially allow for an attacker to supply such a name.
  • 3.7 - 3.12: gh-100001: python -m http.server no longer allows terminal control characters sent within a garbage request to be printed to the stderr server log.
  • 3.8 - 3.12: gh-87604: Avoid publishing list of active per-interpreter audit hooks via the gc module.
  • 3.9 - 3.10 (already released in 3.11+ before): gh-97514: On Linux the multiprocessing + module returns to using filesystem backed unix domain sockets for +communication with the forkserver process instead of the Linux abstract +socket namespace. Only code that chooses to use the “forkserver” start +method is affected. This prevents Linux CVE-2022-42919 + (potential privilege escalation) as abstract sockets have no +permissions and could allow any user on the system in the same network +namespace (often the whole system) to inject code into the multiprocessing + forkserver process. This was a potential privilege escalation. +Filesystem based socket permissions restrict this to the forkserver +process user as was the default in Python 3.8 and earlier.
  • 3.7 - 3.10: gh-98517: Port XKCP’s fix for the buffer overflows in SHA-3 to fix CVE-2022-37454.
  • 3.7 - 3.9 (already released in 3.10+ before): gh-68966: + The deprecated mailcap module now refuses to inject unsafe text +(filenames, MIME types, parameters) into shell commands to address CVE-2015-20107. Instead of using such text, it will warn and act as if a match was not found (or for test commands, as if the test failed).
+

+Python 3.12.0 alpha 3

+

Get it here, read the change log, sing a GPT-3-generated Sinterklaas song:

https://www.python.org/downloads/release/python-3120a3/

216 new commits since 3.12.0 alpha 2 last month.

+

+Python 3.11.1

+

Get it here, see the change log, read the recipe for quark soup:

https://www.python.org/downloads/release/python-3111/

A whopping 495 new commits since 3.11.0. This is a +massive increase of changes comparing to 3.10 at the same stage in the +release cycle: there were “only” 339 commits between 3.10.0 and 3.10.1.

+

+Python 3.10.9

+

Get it here, read the change log, see circular patterns:

https://www.python.org/downloads/release/python-3109/

165 new commits.

+

+Python 3.9.16

+

Get it here, read the change log, consider upgrading to a newer version:

https://www.python.org/downloads/release/python-3916/

Security-only release with no binaries. 10 commits.

+

+Python 3.8.16

+

Get it here, see the change log, definitely upgrade to a newer version:

https://www.python.org/downloads/release/python-3816/

Security-only release with no binaries. 9 commits.

+

+Python 3.7.16

+

Get it here, read the change log, check PEP 537 to confirm EOL is coming to this version in June 2023:

https://www.python.org/downloads/release/python-3716/

Security-only release with no binaries. 8 commits.

+

+We hope you enjoy the new releases!

+

Thanks to all of the many volunteers who help make Python Development + and these releases possible! Please consider supporting our efforts by +volunteering yourself or through organization contributions to the +Python Software Foundation.

https://www.python.org/psf/

Your friendly release team,

+

Ned Deily @nad
+Steve Dower @steve.dower
+Pablo Galindo Salgado @pablogsal
+Łukasz Langa @ambv
+Thomas Wouters @thomas

 

 

 

 

 

 

 

+
+
+ +
+
+ +
+ +
+
+ +Older Posts + +Home +
+
+
+ +
+
+
+
+ +
 
+
+ + + + + \ No newline at end of file diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/__pycache__/unittest_api.cpython-310.pyc b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/__pycache__/unittest_api.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..13d28e6d37f0bd2e0ed4d41f14019ec0522efd36 GIT binary patch literal 1525 zcma)6%WfMt6eT$ijUHAWNa6EiynrjEA%>Wi%s` zoZ1oOm9p;-WMMD+C;bL)yYer%DAIdpEH?rYpd{`YKE!*k&befyMpeJ&_9PWWRM~*ngfFX z>=l^)1;Bt$!RGAuwG%oc-;+1(6E>r#)UX+wQ{k+VGfK%}fNR3V@vjiyg+6yEjCROF zqBo9U9s6rATnoLyv@3s;x#3x{ulwfMSejhWo~5nOv2HPux%H0J&`9fOqe3V4j660v zZto2<$&1~QOpSGM?GK`wkm$umq>92sM}>N;CrK(J4X2|r9~vXI;mKs!pS-ipi5k{X zfli{4-3|@tE!v^$|EM-hm-v7=VPG%7^csL9z$zzSyx!ID( zshprwZLe)#MRq@5fl1!a}ZRj#hrPi@0q{@=1S1A(vDlrF1K5aF>ee%uMkGCFf zJwC^h3H`W{2mwTC>(?~It-YawO3st9w9PEJ9LD~**o8|Gw^fm4JTFmspxUq1ii1TB zOz;1%N_nJKAihGr!$4ib@pXh72sZ&@cchD4-NN~8ggXGCqgLTl*Uu1YNqvP|cr!my zxOXL10;w(%<9mg=lp0;>bpS?}yZ^WUu@!XTs$R)|Z(05?cpQYD4R}Qw=eEW9xDX{g zA>4L2$FfE`IahZv(;mWqIaebrP1ONF(>_2z0@ewtwa|-$#S>F=g-?hLFtzOjt_~jh XoJSixs}p&SkA=n;0^HKTxzqR;BMfz( literal 0 HcmV?d00001 diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/db.sqlite3 b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/db.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..11336fb309b985908d1b413a221376134bdafc47 GIT binary patch literal 135168 zcmeI5TWllOdB%R1%XdcoV@{k57TC_z|v`LGkK+~k?C4ifvwu=<5 z3nT%0&Tz;XUUc!=iL z9LIU-zd`!1`gxWv2-Ow(m$xkMx9H`@mS@|UG5J2TaaaEAXO8V400JNY0w4eaAOHd& z00JNY0w4eaA3cG-UMF?h+d06Iza*a{2{P#V2iGsUCY(QXe#yD*40OHK^=8*|U8g#~ z+WA`NEoz1j2!H?xfB*=900@8p2t2X`q~3O}e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K)nmItR`=36l z!KvDMOz+h@tgJ_`)^8q$b8mUpO-HpTU*0g!X}T0WF^BfXoAP|g zSWHez@tUAYN3&#jqQ3R+Z`g2iUe&YZY}Qf`BVZn`((%G)?Cv-%%)P@3W6)OAh^(mz zpXEM|#&SP?v(4*^(+2XZEY1 z{Twvvt=O^lq%Y}B3G@GlU14EA2!H?xfB*=900@8p2!H?xfB*yC z*vS@0-X{M@zC!+(yh&cCtN4Hb2!H?xfB*=900@8p2!H?xfB*=5XaYTUf$Q(De`#KC zhrpffH{QfnH2(It3*7K|L6P+ z-$QVU7dZD>{WT`^l`-^HQ-xi2{V%xQ;K*N)Me;aZzy}0C00ck)1V8`;KmY_l00ck) z1b$ou$~?Ug`k0wwFf6cGIwL?8o3AjbiSi&=m~3PUi1CZpd2KczG$ O)edA@F%ytrVE_Q}h#x`# literal 0 HcmV?d00001 diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/__pycache__/admin.cpython-310.pyc b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/__pycache__/admin.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2770c9cfc42ecb9704a55c3aabe2d08ec5e9a5ab GIT binary patch literal 745 zcmZ`%J#X7E5GD0x`4ffFkD+r1E%6^HinIvODPFQ^VQJsRkxPm0kw%fZ`62C?ACf=8 zwNvH*9XjbPYfVH8qvyHN&yL^ zCTY_;ZL>O);-i2J@*4p;%5DBFtqaZ+FyPGKn2FEw`w%l6{79rYvJ{KRpu7;(@SblG zl?=Itw(0J5GLDUJzI)$XpAZ6h!%+9t) zmG@D)D#GZpA?H=6TMR>^AH#tLAapK_$r_`&eY-*mMQc}$!BDJ7ck8Q4(vq*QBRZ;<1OQeXDkMDfT>!}8F$ozd4}+_THZc%)lFvFRRuzgdvAe(}}PXSdU9 zT)4*LqQ%&OTlAKk?5=6RFU0TiP%xAtlcnr)|Mi7pA$u@B+eZHm2IL|4jpvajga)-k z1=_O{E3Qz!VN(jd_g9v}WKG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IzIT3>kr}2^W(?9|yU>-w@MQ)JGP?Bjth*^c65z#Th=|}@2(&0Nufi#~twW#Vhg2vj%m|}HI3NOrGtRiMPR?$TvR$*yA#@iM) zMWaBUL-@~$(x`8uI7USLFr`L+v0+(Xrlc#Ru9BjI*Vjl#3VIYoi^i><*Yk7a4Mr!D2QWkjU HlgsH3QU@kg literal 0 HcmV?d00001 diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/__pycache__/urls.cpython-310.pyc b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/__pycache__/urls.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4f6501e86150d064f8c0d33cf7c592866d304ab6 GIT binary patch literal 466 zcmZXQzfQw25XSBNY15{yK!SytrAxh6RfTu}79<8Qkz1QIC9$KkOVvnBu<`(GF!D-S znfeN_aA~EA3R^z=XPxi+e5T*;5*%+YxqPC8d^PZQL7>^%laB+W@dIi*B;($BrZ z=RPHh%0T(c;63~x&mK~EM6DxgBei5CJFh-wc9GiqcWKBY8Q+p&Z;M)FNb8^!Zm~sM z4TO)GTHET(x|LMgSvJYE8-vNUnO2>{ZFPP)POO9R41}I9ru@P>0WK*wZeesX%T1ct zIfydTDQ`K*QU#5o7KN(1psZs}4!aq4>R2v?PR(cqxdjj1)C2v~l XMy_%-ZJJ_FF!V@|4*UV#&*4)^N=K+6MYfuKwqcn>#{D}cw{9Ttha5& zr=G#Cte9x}eZlWNBWTz<*j6*fCrWC1qpbI!JNib}liOTQ>xtxGw{t0WQ+}UUQw3(P z;%dKUDdTx9GF1!om`$fr2dt3OOy&F7GRZ2Qx5s62h#+W*&y;5lI|I znG4&cjKFq%-EOvq+a2W;ro1QtC|JLOD*phnXD#Xc%)%BOWsS+$Uf7HrkR_e87LM3# z+8kzM+Yi>{G_|13d2p3j_$kU9Ovw|Qxy(DTJ?lqn+q#Ed-37gA{j|CC7T(x}ioZV8 z0BQ?r$owbX(qFhw+YA2?Qhj#|yafx_cx$0II7>LfIEuO~)5)yb;TSV-M`V+HUwgY* zQF3-maay7`2~fu@p|yV@80?u<*7xNyWtZ3ZR%<`ijFGhU`8`tE~^#BVw@Wtqy3EO8N9 zpI_b*b*;AU)#7IWQO>tyq4-wCFhqpQL7&Vw*03}LAGrFdBArTiE-Con3HJz^M z?jey^6aw030f4E+LQKDM#uUJF?DM6^MgxD12HqMCd^KA8kg(_gm;yX^ShpZ-W92vQ zjb5Lq4LHX9bXJyw-GY})4lqZBK%f~sX}VGdmeW|kI?zWOiyF&S_Sjk23ui%rMce~;E)>A$sds2CJzykYA7G^ZGFSw_L;)~S z08A7B6M0YQvbFGmiCTt3IJ}Uf-T~ zZh#jA$q<1&f+&7~9zR6!5sKGhbqKv!C0?+=ifn;a4!88UppLx;YZz4pbajX?nau#J z%mMO&x755n-bh@55%Y_;RE;g2zFchsk7I zx0^xxN=?n8`uzH|;ql)NImG`Z!bdk}n;|n*lyYr|z&{DvS{(y9z=YClXf3zLG@*lQ aD|Yz;18kTovU((HzR>BD@KT>doBsp1flng< literal 0 HcmV?d00001 diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/admin.py b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/admin.py new file mode 100644 index 0000000..3158773 --- /dev/null +++ b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/admin.py @@ -0,0 +1,16 @@ +from django.contrib import admin +from .models import Students, Blog + +class DjStudentAdmin(admin.ModelAdmin): + list_display = ("first_name", "last_name", "address", "roll_number", "mobile", "branch") + list_filter = ("branch",) + +class DjBlogAdmin(admin.ModelAdmin): + list_display = ("title", "release_date", "blog_time", "author", "created_date") + list_filter = ("author",) + + +# Register your models here. +admin.site.register(Blog, DjBlogAdmin) +admin.site.register(Students, DjStudentAdmin) + diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/apps.py b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/apps.py new file mode 100644 index 0000000..1e85ca8 --- /dev/null +++ b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/apps.py @@ -0,0 +1,124 @@ +from django.apps import AppConfig +import psycopg2 +import requests +import re +from bs4 import BeautifulSoup, element +import datetime +from dateutil.parser import parse + + +db_name = 'member_db2' +db_user = 'postgres' +db_pass = '123456' +db_host = 'psql-db2.0' +db_port = '5432' + +conn = psycopg2.connect(dbname=db_name, user=db_user, password=db_pass, host=db_host, port=db_port) + + +def add_row_to_blog(title, author, date, time): + sql = """INSERT INTO members_blog (title, release_date, blog_time, author, created_date) VALUES (%s, %s::DATE, %s::TIME, %s, NOW())""" + + with conn: + with conn.cursor() as curs: + curs.execute(sql, (title, date, time, author, content, recommended, html)) + + +def truncate_table(): + print("Truncating contents all the tables") + with conn: + with conn.cursor() as curs: + curs.execute("TRUNCATE members_blog CASCADE;") + + +def start_extraction(start_date=None, end_date=None, no_of_articles=None, start_id=None): + print("Extraction started") + url = "https://blog.python.org/" + + data = requests.get(url) + page_soup = BeautifulSoup(data.text, 'html.parser') + + if start_date: + start_date = parse(start_date) + if end_date: + end_date = parse(end_date) + + blogs = page_soup.select('div.date-outer') + truncate_table() + article_count = 0 + counter = 1 + for blog in blogs: + article_count += 1 + if start_id and article_count < int(start_id): + continue + if no_of_articles and counter > int(no_of_articles): + continue + date = blog.select('.date-header span')[0].get_text() + + converted_date = parse(date) + + if start_date and converted_date < start_date: + continue + if end_date and converted_date > end_date: + continue + + post = blog.select('.post')[0] + + title = "" + title_bar = post.select('.post-title') + if len(title_bar) > 0: + title = title_bar[0].text + else: + title = post.select('.post-body')[0].contents[0].text + + # getting the author and blog time + post_footer = post.select('.post-footer')[0] + + author = post_footer.select('.post-author span')[0].text + + time = post_footer.select('abbr')[0].text + + post_header = post.select('.post-header')[0] + + '''contents = page_soup.find_all('div',class_='date-posts') + #print(contents) + for con in contents:''' + content = post.select('.post-body')[0].text + html = 'S:\web_scapping\python_blogs.html' + with open(html, 'w', encoding='utf-8') as f: + f.write(data.text) + + + #con = content.find('p', class_='post-body entry-content').p.text + + #contents =post_header.select('div', class_='post-body entry-content') + google = page_soup.find_all('div', class_='widget LinkList', id='LinkList1') + # print(google) + for gg in google: + recommended = gg.select('.widget-content')[0].li.a['href'] + #rem2 = gg.find('div', class_='widget-content') + #print(rem2) + + #print(rem2) + # Inserting data into database + add_row_to_blog(title, date, time, author, content, recommended, html) + print("\nTitle:", title.strip('\n')) + print(f'''Posted date: {date} + Posted time: {time} + Author: {author} + Content: {content} + Recommended this on google: {recommended} + HTML saved to: {html}''') + + # print("Number of blogs read:", count) + print( + "\n---------------------------------------------------------------------------------------------------------------\n") + counter += 1 + + +if __name__ == "__main__": + start_extraction() + + +class MembersConfig(AppConfig): + name = 'members' diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/migrations/0001_initial.py b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/migrations/0001_initial.py new file mode 100644 index 0000000..e535259 --- /dev/null +++ b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/migrations/0001_initial.py @@ -0,0 +1,40 @@ +# Generated by Django 4.2.1 on 2023-06-15 01:26 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Blog', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=500)), + ('release_date', models.DateTimeField(verbose_name='Realse Date')), + ('blog_time', models.CharField(max_length=50)), + ('author', models.CharField(max_length=200)), + ('created_date', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Created Date')), + ('content', models.CharField(max_length=20000)), + ('recommended', models.CharField(max_length=800)), + ('html', models.CharField(max_length=500)), + ], + ), + migrations.CreateModel( + name='Students', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('first_name', models.CharField(max_length=200)), + ('last_name', models.CharField(max_length=200)), + ('address', models.CharField(max_length=200)), + ('roll_number', models.IntegerField()), + ('mobile', models.CharField(max_length=10)), + ('branch', models.CharField(choices=[('BA', 'BA'), ('B.COM', 'B.COM'), ('MBA', 'MBA'), ('CA', 'CA')], max_length=10, null=True)), + ], + ), + ] diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/migrations/__init__.py b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/migrations/__pycache__/0001_initial.cpython-310.pyc b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/migrations/__pycache__/0001_initial.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ae4ebfec3256302d55b0a8bb0d1502e88a941d4 GIT binary patch literal 1230 zcmZuxOK;pZ5T+>YL%Uih&BJ{++r}xNi`Q)ew1=XI?I1-Cc7Z0Ry$D*(SWAZzH>9?y zb4^YKeDAUCt$(EGZ{W2j9}5&HnnTbbCBq3&5~BEV$eC|uI8>9#h*A4}`6K+)XY5Z0 zUT+bByY!h)X#fU+WK}Q^Dn91{`-TCB@CAbqgX8ddI1eFu$kN^!?PV#qqe_%IZ-lCi z?N`x;n$~~y^kF#8GQ0<08`?4(=jXu&Th%)32ae# zZ`t_ZJg$#yv?o<*xq$nYKe(4hHp$nG$_kBngJ8!iEvj6fWRLO0#s;;>rFe!m`5yH` z8O-XuLfdOZBT@WKDM$lKTmC~Pu`ZjXO*Bf(X&;cfXXEcMmjpAN{3Mq@~$k}|8;)dID< znF}HD%oT#|FLYiP%QPbGd~a9Zq{WoK?Covue|w;}JhI^dNp7`szQ3zoZKRL0S|ZJpEPJxfrQ=U%AZpQ2W^4kua(>o@AU&K^*l`=Q z16MwpoTs4fiE@{ceBZfk+v&vR6~g~ z(*5~A(W_|VLNcQD&4B+Ky&C@IwH(s5jo~=2OSKIP@3!~U3ood)vpZzX4!>$6`8C~G LW*n2td^7wHTzgay literal 0 HcmV?d00001 diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/migrations/__pycache__/0002_students_delete_members.cpython-310.pyc b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/migrations/__pycache__/0002_students_delete_members.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..42c8527aea5450911751f38a4da874e14af6f7b7 GIT binary patch literal 940 zcmY*YJ9E=O5WYLfFIi3kgajB$hCxjns2L`SGs&cIfC-ffZe;I9mZOKclY!7e>y{em z_#HI-hHI%(Q;~wOC!0xfH@mZ+_V&FhIvtPEdHv!g{BRiiWx>_s64)Zr4~YQ-p0bRG zJQJbdY@dMu=Mw`5`PljBgbuhzEU2B)TNVi8Wl5}}GAVLx>RADp>Y-I#JskpDMEWx^ zWFZF@3g9sh9dySv8vyI$2Do%

06MJr>ZUZ%t@{H{*ob*N}e=b+G=W^_9`9rRw|g z!e+&yn8A&29G2ncOdN~20k>v?qI$3jw`V*SVH?({pmo#g|F49~YGjxVP-)|DZf-u7 zNuHERl$z#IIR(s1ZA1dE_KY~#4P4_#)3T65g;9xM+7p#zkvf$pcxqZ26&WTU(D-jr z4GN7ik1{mgaiVlt$!9;QEdi%iM(<^cd0dW6D~%Rf(}(~RYHix8NK=_lZDO|9gCxZ> zJ6cm8s3;$f0+%uuJKJjAIuz%%osHh}zPeK(c0ZzN}BjIMUs6f-%O*_8e0T7!JIlZOvtk!OVjRE z{ps5kQM884_&Z6wO`Y4bp-ihciqu^65AqUYT%h(YrdVQSXuM*Ai*@_X)FX0JvGe_| zDvGlEu23g>5)HAdlM=g&A$Bi!v`gcBBK2a5l5!!}a`A3sa;oglP$$w4h&7pT+zYoR z_^Mdq_IgCCT>NqWy1wA7u|Zw}W@h44_t${HE*NgmJt?W7 z^9<=8N%?86GH2`%;0z0@(bW!SaGgA{BnY6-D+mF%R*o~-fFQhBZ*6dQdVGih+ zO%h!uJpb132)-_sd9&BJxbgpXZ)?kA>SG8~RV3vWjO$El^0o4gOLKch9&PtkQg`k0wwFf6cGIwL?8o3AjbiSi&=m~3PUi1CZpd + + + +

Hello World!

+

Welcome to my first Django project!

+ + + diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/templates/myfirst.html b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/templates/myfirst.html new file mode 100644 index 0000000..ef1398d --- /dev/null +++ b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/templates/myfirst.html @@ -0,0 +1,9 @@ + + + + +

Hello World!

+

Welcome to my first Django project!

+ + + diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/tests.py b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/urls.py b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/urls.py new file mode 100644 index 0000000..0b9923f --- /dev/null +++ b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/urls.py @@ -0,0 +1,10 @@ +from django.urls import path +from . import views + +urlpatterns = [ + path('students/', views.StudentView.as_view()), + path('students/', views.StudentView.as_view()), + path('students/', views.StudentView.as_view()), + path('start_python_blog_scraping', views.python_blog_scrap, name='triger'), + path('rest/blog/', views.BlogView.as_view()), + ] diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/views.py b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/views.py new file mode 100644 index 0000000..72d49ca --- /dev/null +++ b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/members/views.py @@ -0,0 +1,72 @@ +from django.views import View +from .models import Students, Blog +from django.http import JsonResponse +from django.views.decorators.csrf import csrf_exempt +from django.utils.decorators import method_decorator +from . import apps + + +@method_decorator(csrf_exempt, name='dispatch') +class StudentView(View): + + def get(self, request, rolno=None, branch=None): + student_model_list = [] + try: + if rolno: + student_model_list = Students.objects.filter(roll_number=rolno) + elif branch: + student_model_list = Students.objects.filter(branch=branch) + except Students.DoesNotExist: + return JsonResponse({'status': 'failed', "students": None}, status=400) + students = [] + for student in student_model_list: + data = { + "first_name" : student.first_name, + "last_name": student.last_name, + "address": student.address, + "roll_number": student.roll_number, + "mobile": student.mobile, + "branch": student.branch + } + students.append(data) + return JsonResponse({'status': 'success', "students": students}, status=200) + def post(self, request): + if not request.POST.get('first_name') or not request.POST.get('last_name') or not request.POST.get('address') or not request.POST.get('roll_number') or not request.POST.get('mobile'): + return JsonResponse({'status': 'failed', "message" : "all fields required"}, status=500) + Students.objects.create( + first_name= request.POST.get('first_name'), + last_name= request.POST.get('last_name'), + address= request.POST.get('address'), + roll_number= request.POST.get('roll_number'), + mobile= request.POST.get('mobile'), + branch= request.POST.get('branch')) + return JsonResponse({'status': 'sucess'}, status=200) + + +@method_decorator(csrf_exempt, name='dispatch') +class BlogView(View): + def post(self, request): + start_date = request.POST.get('start_date', None) + end_date = request.POST.get('end_date', None) + no_of_articles = request.POST.get('no_of_articles', None) + start_id = request.POST.get('start_id', None) + + apps.start_extraction(start_date=start_date, end_date=end_date, no_of_articles=no_of_articles, start_id=start_id) + + blog_model_list = Blog.objects.filter() + + blogs = [] + for blog in blog_model_list: + data = { + "Title": blog.title, + "Release Date": blog.release_date, + "Author": blog.author, + "Blog time": blog.blog_time + } + blogs.append(data) + + return JsonResponse({'status': 'success', "students": blogs}, status=200) +def python_blog_scrap(request): + apps.start_extraction() + return JsonResponse({'status': 'sucess', "message" : "Extracted and populated the table."}, status=200) + \ No newline at end of file diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/unittest_api.py b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/unittest_api.py new file mode 100644 index 0000000..b3402ef --- /dev/null +++ b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/unittest_api.py @@ -0,0 +1,38 @@ +import unittest +import requests + + +def print_log( *texts ): + with open("event_logs.txt", "a") as file_object: + for text in texts: + file_object.write(str(text) + " ") + file_object.write("\n") + + +class Test(unittest.TestCase): + + def test_get_student_branch(self): + try: + result = requests.get("http://0.0.0.0:8000/members/students/B.COM") + self.assertEqual(result.status_code, 200) + self.assertNotEqual(result, None) + except requests.exceptions.ConnectionError: + print('connection error occurred') + + def test_get_all_students_for_branch(self): + try: + required = {'status': 'success', + 'students': [{'address': 'derla', + 'branch': 'B.COM', + 'first_name': 'rathan', + 'last_name': 'derla', + 'mobile': ' 987456165', + 'roll_number': 2}]} + + result = requests.get("http://0.0.0.0:8000/members/students/2") + self.assertEqual(result.status_code, 200) + result = result.json() + self.assertEqual(result, required) + except requests.exceptions.ConnectionError: + print('connection error occurred') + diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/web_scrapper.py b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/web_scrapper.py new file mode 100644 index 0000000..399987d --- /dev/null +++ b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/web_scrapper.py @@ -0,0 +1,103 @@ +import requests +import re +from bs4 import BeautifulSoup, element +import psycopg2 + +# For the credentials mentioned below, you may refer the docker-compose.yml present in myworld . +db_name = 'member_db2' +db_user = 'postgres' +db_pass = '123456' +db_host = 'psql-db2.0' +db_port = '5432' + +# This will create the connection the to postgres database. +conn = psycopg2.connect(dbname=db_name, user=db_user, password=db_pass, host=db_host, port=db_port) + + +def add_row_to_blog(title, date, time, author, content, recommended, html): + # This function will add the entry to database + sql = """INSERT INTO members_blog (title, release_date, blog_time, author,created_date, content, recommended, html) VALUES (%s, %s::DATE, %s::TIME, %s, NOW(), %s, %s, %s)""" + + with conn: + with conn.cursor() as curs: + time=time.replace('\u202f',"") + curs.execute(sql, (title, date, time, author, content, recommended, html)) + + +def truncate_table(): + # This function will delete the existing entries from the database. + with conn: + with conn.cursor() as curs: + curs.execute("TRUNCATE members_blog CASCADE;") + + +def start_extraction(): + print("Extraction started") + url = "https://blog.python.org/" + data = requests.get(url) + page_soup = BeautifulSoup(data.text, 'html.parser') + + blogs = page_soup.select('div.date-outer') + + for blog in blogs: + date = blog.select('span', class_='date-header')[0].get_text() + + post = blog.select('.post')[0] + # print(post) + # post_time = blog.find('abbr', class_='published') + + # title = blog.h3.a.text + #print(title) + + title = "" + title_bar = post.select('.post-title') + if len(title_bar) > 0: + title = title_bar[0].text + else: + title = post.select('.post-body')[0].contents[0].text + + # getting the author and blog time + post_footer = post.select('.post-footer')[0] + + author = post_footer.select('.post-author span')[0].text + + time = post_footer.select('abbr')[0].text + + post_header = post.select('.post-header')[0] + + '''contents = page_soup.find_all('div',class_='date-posts') + #print(contents) + for con in contents:''' + content = post.select('.post-body')[0].text + html = 'S:\web_scapping\python_blogs.html' + with open(html, 'w', encoding='utf-8') as f: + f.write(data.text) + + + #con = content.find('p', class_='post-body entry-content').p.text + + #contents =post_header.select('div', class_='post-body entry-content') + google = page_soup.find_all('div', class_='widget LinkList', id='LinkList1') + # print(google) + for gg in google: + recommended = gg.select('.widget-content')[0].li.a['href'] + #rem2 = gg.find('div', class_='widget-content') + #print(rem2) + + #print(rem2) + # Inserting data into database + add_row_to_blog(title, date, time, author, content, recommended, html) + print("\nTitle:", title.strip('\n')) + print(f'''Posted date: {date} + Posted time: {time} + Author: {author} + Content: {content} + Recommended this on google: {recommended} + HTML saved to: {html}''') + + # print("Number of blogs read:", count) + print("\n---------------------------------------------------------------------------------------------------------------\n") + + +if __name__ == "__main__": + start_extraction() From 2a56a7be5601f941bd3633e166dca807ca554152 Mon Sep 17 00:00:00 2001 From: Prajwal U R <92009354+Prajwal7Amin@users.noreply.github.com> Date: Fri, 16 Jun 2023 20:50:28 +0530 Subject: [PATCH 2/3] Update web_scrapper.py --- .../Batman/web_scrapper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/web_scrapper.py b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/web_scrapper.py index 399987d..e690417 100644 --- a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/web_scrapper.py +++ b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/web_scrapper.py @@ -65,9 +65,9 @@ def start_extraction(): post_header = post.select('.post-header')[0] - '''contents = page_soup.find_all('div',class_='date-posts') + #contents = page_soup.find_all('div',class_='date-posts') #print(contents) - for con in contents:''' + #for con in contents: content = post.select('.post-body')[0].text html = 'S:\web_scapping\python_blogs.html' with open(html, 'w', encoding='utf-8') as f: From 03ad926bcb09a55d9eb3d9c4ea785395cc5da13c Mon Sep 17 00:00:00 2001 From: Prajwal U R <92009354+Prajwal7Amin@users.noreply.github.com> Date: Sun, 18 Jun 2023 19:23:45 +0530 Subject: [PATCH 3/3] Update web_scrapper.py --- Vivekananda_session3_4VP20CS062_Prajwal/Batman/web_scrapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/web_scrapper.py b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/web_scrapper.py index e690417..8613f59 100644 --- a/Vivekananda_session3_4VP20CS062_Prajwal/Batman/web_scrapper.py +++ b/Vivekananda_session3_4VP20CS062_Prajwal/Batman/web_scrapper.py @@ -69,7 +69,7 @@ def start_extraction(): #print(contents) #for con in contents: content = post.select('.post-body')[0].text - html = 'S:\web_scapping\python_blogs.html' + html = 'S:\web_scraping\python_blogs.html' with open(html, 'w', encoding='utf-8') as f: f.write(data.text)