Metadata-Version: 2.1
Name: cau_services
Version: 0.0.3
Summary: CAU (Central Asian University) Services Python Client, for student projects
Author-email: Timur Urunbaev <urunbaev.timur@gmail.com>
License: # Released under MIT License
        
        Copyright (c) 2024 Timur Urunbaev.
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas
Requires-Dist: tqdm
Requires-Dist: requests
Requires-Dist: importlib-metadata; python_version < "3.12"

# CAU (Central Asian University) Services Python Client

<img src="https://github.com/timur-urunbaev/cau_services/blob/main/centralasian_logo.png" alt="cau_services" style="width:250px;" align="left"/>

This opensource Python Client for services of [Central Asian University](https://centralasian.uz/). With this package you will be able to get timetable, attendance and other stuff, and automate for your purposes, this can be useful for pet-projects.

For now here:
- [timetable](https://cau.edupage.org/timetable/) ([link to code](https://github.com/timur-urunbaev/cau_services/blob/main/cau/Timetable.py))

Comming Soon:
- attendance
- marks

For more information on how Timetable API works, you can take a look to `timetable.ipynb`.

## Usage

### Installation

| I will try to make this README "begginers friendly", trying to explain the whole process of installation in details.

Create Python Environment:

```shell
python3 -m venv .venv
```

Activating python environment (For Linux/UNIX/MacOS):

```shell
source .venv/bin/activate
# OR
. .venv/bin/activate
```

Activating python environment (For Windows PowerShell):

```shell
# for PowerShell
.venv\Scripts\Activate.ps1

# CMD
.venv\Scripts\activate.bat
```

! FOR NOW PACKAGE ISN'T UPLOADED TO ANY PACKAGE REPOSITORY SO USE FOLLOWING INSTRUCTIONS TO INSTALL IT.

```shell
git clone https://github.com/timur-urunbaev/cau_services.git .
```

Inside the cloned repo write this command (so the package will be installed to your virtual environment):

```shell
python -m pip install .
```

Now you can use this package inside of your projects.

### Download

```python
from cau import Timetable

timetable = Timetable()
timetable.download()
```

### Timetable

```python
from cau import Timetable

timetable = Timetable()
timetable.download()
week: dict = timetable.get_week_by_class_id("<class_id>")
```

Then you can turn Python `dict` to `json` using any your preferable tool, e.g. `json` package:

```python
import json
from cau import Timetable

timetable = Timetable()
timetable.download()
week: dict = timetable.get_week_by_class_id("<class_id>")

print(json.dumps(week)) # to see the result
```

## Author

Urunbaev Timur
