Skip to content

Commit

Permalink
feat: Update README and add files for initial publish (#3)
Browse files Browse the repository at this point in the history
* Update README and requirements

* Update README
  • Loading branch information
aditeyabaral authored Apr 18, 2024
1 parent 7aba24a commit 8a01b54
Show file tree
Hide file tree
Showing 20 changed files with 86 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.idea/
.vscode/
__pycache__/
build/
dist/
*.egg-info/
test*
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# PESU Academy API

Python wrapper and APIs for the PESU Academy website.

The wrapper requires the user's credentials to authenticate and provide **read-only** access to all the pages and
information accessible on the PESU Academy website. Without the credentials, the wrapper will only be able to fetch
details from the `Know Your Class and Section` page.

> :warning: **Warning:** This is not an official API and is not endorsed by PESU. Use at your own risk.
## Installation

### Installing from `pip`

```bash
pip install pesuacademy
```

### Installing from source

```bash
git clone https://github.com/HackerSpace-PESU/pesuacademy-py
cd pesuacademy-py
python setup.py install
```

## Usage

```python
from pesuacademy import PESUAcademy

p = PESUAcademy("PRN_or_SRN", "password")
profile = p.profile()
courses = p.courses(semester=2)
attendance = p.attendance()
```
3 changes: 0 additions & 3 deletions pesu_academy/__init__.py

This file was deleted.

3 changes: 3 additions & 0 deletions pesuacademy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
__version__ = "0.0.1"

from .pesuacademy import PESUAcademy
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import requests_html
from bs4 import BeautifulSoup

from pesu_academy.models import Course, Attendance
from pesuacademy.models import Course, Attendance


def get_attendance_in_semester(session: requests_html.HTMLSession, semester_value: Optional[int] = None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import requests_html
from bs4 import BeautifulSoup

from pesu_academy.models import Course
from pesuacademy.models import Course


def get_courses_in_semester(session: requests_html.HTMLSession, semester_id: Optional[int] = None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import requests_html
from bs4 import BeautifulSoup

from pesu_academy.models import Profile
from pesuacademy.models import Profile


def get_profile_page(session: requests_html.HTMLSession) -> Profile:
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 1 addition & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
appdirs==1.4.4
beautifulsoup4==4.12.3
blinker==1.7.0
bs4==0.0.2
certifi==2024.2.2
charset-normalizer==3.3.2
click==8.1.7
cssselect==1.2.0
fake-useragent==1.5.1
Flask==3.0.3
idna==3.6
idna==3.7
importlib_metadata==7.1.0
itsdangerous==2.1.2
Jinja2==3.1.3
lxml==5.2.1
lxml_html_clean==0.1.1
MarkupSafe==2.1.5
parse==1.20.1
pip==23.3.1
pyee==11.1.0
pyppeteer==2.0.0
pyquery==2.0.0
pytz==2024.1
requests==2.31.0
requests-html==0.10.0
setuptools==68.2.2
Expand All @@ -30,6 +23,5 @@ typing_extensions==4.11.0
urllib3==1.26.18
w3lib==2.1.2
websockets==10.4
Werkzeug==3.0.2
wheel==0.41.2
zipp==3.18.1
40 changes: 40 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import setuptools

VERSION = "0.0.1"

DESCRIPTION = "Python wrapper and APIs for the PESU Academy website"

try:
with open("README.md", "r") as fh:
long_description = fh.read()
except FileNotFoundError:
long_description = DESCRIPTION

setuptools.setup(
name="pesuacademy",
version=VERSION,
author="Aditeya Baral",
author_email="[email protected]",
description=DESCRIPTION,
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/HackerSpace-PESU/pesuacademy-py",
packages=setuptools.find_packages(),
install_requires=[
"requests",
"requests-html",
"beautifulsoup4",
"lxml_html_clean"
],
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.9',
keywords=["pesu", "pesu academy", "api", "wrapper", "python"]
)

0 comments on commit 8a01b54

Please sign in to comment.