IServAPI


NameIServAPI JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/Leo-Aqua/IServAPI
SummaryUnofficial API for IServ
upload_time2024-04-01 14:54:25
maintainerNone
docs_urlNone
authorLeo Aqua
requires_python>=3.6
licenseNone
keywords iserv iservapi iserv api iserv-api api leo-aqua
VCS
bugtrack_url
requirements requests logging bs4 lxml webdavclient urllib pandas
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Unofficial IServ API

This Python module allows you to interact with IServ school servers using only login data for authentication. No API key is required.

![GitHub commit activity](https://img.shields.io/github/commit-activity/m/Leo-Aqua/IServAPI) ![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/Leo-Aqua/IServAPI/total?label=GitHub%20Downloads)
 ![PyPI - Downloads](https://img.shields.io/pypi/dm/IServAPI?label=PyPi%20Downloads)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/IServAPI) ![PyPI - Wheel](https://img.shields.io/pypi/wheel/IServAPI) ![GitHub repo size](https://img.shields.io/github/repo-size/Leo-Aqua/IServAPI) ![PyPI - Version](https://img.shields.io/pypi/v/IServAPI?label=version)
![GitHub Repo stars](https://img.shields.io/github/stars/Leo-Aqua/IServAPI)



## Installation

You can install the IServ Python module using pip:

```bash
pip install IServAPI
```

## Basic usage

```python
from IServAPI import IServAPI

# Initialize IServ instance with login credentials
api = IServAPI(username="YOUR_ISERV_USERNAME",password="YOUR_ISERV_PASSWORD", iserv_url="some_iserv_url.de")

# Example: Get the current user's information
user_info = api.get_own_user_info()

print(user_info)
```

## List of functions

1. [Get own User Information](#1-get-own-user-information)
2. [Set own User Information](#2-set-own-user-information)
3. [Get user avatar](#3-get-user-avatar)
4. [Get emails](#4-get-emails)
5. [Search users](#5-search-users)
6. [Search users autocomplete](#6-search-users-autocomplete)
7. [Fetch notifications](#7-fetch-notifications)
8. [Get general Information about emails](#8-get-general-information-about-emails)
9. [Get email source](#9-get-email-source)
10. [Get all mail folders](#10-get-all-mail-folders)
11. [Get upcoming events](#11-get-upcoming-events)
12. [Get all eventsources](#12-get-all-eventsources)
13. [Get conference health](#13-get-conference-health)
14. [Get badges](#14-get-badges)
15. [Files](#15-files)
16. [Read all notifications](#16-read-all-notifications)
17. [Read a specific Notification](#17-read-a-specific-notification)
18. [Send Email](#18-send-email)
19. [Get other users information](#19-get-other-users-information)



## Supported Functionality

### Get own User Information

```python
user_info = get_own_user_info()
```

This method retrieves information about the currently logged-in user.

### 2. Set own User Information

```python
set_own_user_info(key=value)
```

This method sets your personal information

Available keys are:

`title`

`company`

`birthday`

`nickname`

`_class`

`street`

`zipcode`

`city`

`country`

`phone`

`mobilePhone`

`fax`

`mail`

`homepage`

`icq`

`jabber`

`msn`

`skype`

`note`


### 3. Get user avatar

```python
get_user_profile_picture(user, output_folder)
```

This method retrieves the avatar of any user on the network

It saves the avatar in the folder followed by the username,


### 4. Get emails

```python
emails = get_emails(path = 'INBOX', length = 50, start = 0, order = 'date', dir = 'desc')
```

Retrieves emails from a specified path with optional parameters for length, start, order, and direction.

### 5. Search users

```python
search_users(query)
```



### 6. Search users autocomplete

```python
users = search_users_autocomplete(query, limit=50)
```

Faster than `search_users()` but may not display all users

### 7. Fetch notifications

```python
notifications = get_notifications()
```

Retrieves notifications from the specified URL and returns them as a JSON object.


### 8. Get general Information about emails

```python
email_info = get_email_info(path="INBOX", length=0, start=0, order="date", dir="desc")
```

Retrieves email information from the specified path in the mailbox. For example: unread emails.


### 9. Get email source

```python
email_source = get_email_source(uid, path="INBOX")
```

Retrieves the source code of an email message from the specified email path and message ID.


### 10. Get all mail folders

```python
mail_folders = get_mail_folders()
```

Retrieves the list of mail folders.


### 11. Get upcoming events

```python
events = get_upcoming_events()
```

Retrieves the upcoming events from the IServ calendar API.


### 12. Get all eventsources

```python
eventsources = get_eventsources()
```

Retrieves the event sources from the calendar API.


### 13. Get conference health

```python
health = get_conference_health()
```

Get the health status of the conference API endpoint.


### 14. Get badges

```python
badges = get_badges()
```

Retrieves the badges from the IServ server. (Badges=numbers on sidebar)


### 15. Files

```python
client = file()

```

Possible functions:

**Synchronous methods**

```python
# Checking existence of the resource

client.check("dir1/file1")
client.check("dir1")
```

```python
# Get information about the resource

client.info("dir1/file1")
client.info("dir1/")
```

```python
# Check free space

free_size = client.free()
```

```python
# Get a list of resources

files1 = client.list()
files2 = client.list("dir1")
```

```python
# Create directory

client.mkdir("dir1/dir2")
```

```python
# Delete resource

client.clean("dir1/dir2")
```

```python
# Copy resource

client.copy(remote_path_from="dir1/file1", remote_path_to="dir2/file1")
client.copy(remote_path_from="dir2", remote_path_to="dir3")
```

```python
# Move resource

client.move(remote_path_from="dir1/file1", remote_path_to="dir2/file1")
client.move(remote_path_from="dir2", remote_path_to="dir3")
```

```python
# Move resource

client.download_sync(remote_path="dir1/file1", local_path="~/Downloads/file1")
client.download_sync(remote_path="dir1/dir2/", local_path="~/Downloads/dir2/")
```

```python
# Unload resource

client.upload_sync(remote_path="dir1/file1", local_path="~/Documents/file1")
client.upload_sync(remote_path="dir1/dir2/", local_path="~/Documents/dir2/")
```

```python
# Publish the resource

link = client.publish("dir1/file1")
link = client.publish("dir2")
```

```python
# Unpublish resource

client.unpublish("dir1/file1")
client.unpublish("dir2")
```

```python
# Get the missing files

client.pull(remote_directory='dir1', local_directory='~/Documents/dir1')
```

```python
# Send missing files

client.push(remote_directory='dir1', local_directory='~/Documents/dir1')
```

**Asynchronous methods**

```python
# Load resource

kwargs = {
 'remote_path': "dir1/file1",
 'local_path':  "~/Downloads/file1",
 'callback':    callback
}
client.download_async(**kwargs)

kwargs = {
 'remote_path': "dir1/dir2/",
 'local_path':  "~/Downloads/dir2/",
 'callback':    callback
}
client.download_async(**kwargs)
```

```python
# Unload resource

kwargs = {
 'remote_path': "dir1/file1",
 'local_path':  "~/Downloads/file1",
 'callback':    callback
}
client.upload_async(**kwargs)

kwargs = {
 'remote_path': "dir1/dir2/",
 'local_path':  "~/Downloads/dir2/",
 'callback':    callback
}
client.upload_async(**kwargs)
```

For further informations visit [CloudPolis/webdav-client-python](https://github.com/CloudPolis/webdav-client-python)


### 16. Read all notifications

```python
read_all_notifications()
```

Marks all Notification as read.


### 17. Read a specific Notification


```python
read_notifiaction(notification_id)
```

Marks a specified Message as read. Note: notification_id can be returned from get_notifications()


### 18. Send Email


```python
send_email(receiver_email:str, subject:str, body:str, html_body:str=None, smtp_server:str=None, smtps_port:int=465, sender_name:str=None, attachments:list=None, sender_email:str=None)
```

Sends an email. Note all variables defaulting to none get defined later so don't worry.

sender_email must be a valid name present in the iserv network.


### 19. Get other users information


```python
get_user_info(user)
```

Get someone else's public information this includes everything they heve set in 'Personal Information'

### Logging

Add this
```python
IServAPI.setup_logging("app.log")
```
after your `from IServAPI.IServAPI import IServAPI`


### To-Do List

- [x] add search users

- [x] more functionality

- [ ] make wiki

## Contribution

Contributions are welcome! If you'd like to contribute to this project, please fork the repository and submit

a pull request. Make sure to follow the existing code style and add appropriate tests for new functionality.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

> [!IMPORTANT]
> ## DISCLAIMER
> I HOLD NO RESPONSIBILITY FOR ANY DAMAGES OR DATALOSS DONE BY THIS > PACKAGE. >YOU ARE RESPONSIBLE FOR YOUR DATA!

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Leo-Aqua/IServAPI",
    "name": "IServAPI",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "IServ, IServAPI, iserv api, iserv-api, API, Leo-Aqua",
    "author": "Leo Aqua",
    "author_email": "contact@leoaqua.de",
    "download_url": "https://files.pythonhosted.org/packages/e9/4e/c15d4a5a14dcddb7530d89aa4e167180f564f9057a1ad17e2ef3c18c3b80/IServAPI-1.0.1.tar.gz",
    "platform": null,
    "description": "# Unofficial IServ API\n\nThis Python module allows you to interact with IServ school servers using only login data for authentication. No API key is required.\n\n![GitHub commit activity](https://img.shields.io/github/commit-activity/m/Leo-Aqua/IServAPI) ![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/Leo-Aqua/IServAPI/total?label=GitHub%20Downloads)\n ![PyPI - Downloads](https://img.shields.io/pypi/dm/IServAPI?label=PyPi%20Downloads)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/IServAPI) ![PyPI - Wheel](https://img.shields.io/pypi/wheel/IServAPI) ![GitHub repo size](https://img.shields.io/github/repo-size/Leo-Aqua/IServAPI) ![PyPI - Version](https://img.shields.io/pypi/v/IServAPI?label=version)\n![GitHub Repo stars](https://img.shields.io/github/stars/Leo-Aqua/IServAPI)\n\n\n\n## Installation\n\nYou can install the IServ Python module using pip:\n\n```bash\npip install IServAPI\n```\n\n## Basic usage\n\n```python\nfrom IServAPI import IServAPI\n\n# Initialize IServ instance with login credentials\napi = IServAPI(username=\"YOUR_ISERV_USERNAME\",password=\"YOUR_ISERV_PASSWORD\", iserv_url=\"some_iserv_url.de\")\n\n# Example: Get the current user's information\nuser_info = api.get_own_user_info()\n\nprint(user_info)\n```\n\n## List of functions\n\n1. [Get own User Information](#1-get-own-user-information)\n2. [Set own User Information](#2-set-own-user-information)\n3. [Get user avatar](#3-get-user-avatar)\n4. [Get emails](#4-get-emails)\n5. [Search users](#5-search-users)\n6. [Search users autocomplete](#6-search-users-autocomplete)\n7. [Fetch notifications](#7-fetch-notifications)\n8. [Get general Information about emails](#8-get-general-information-about-emails)\n9. [Get email source](#9-get-email-source)\n10. [Get all mail folders](#10-get-all-mail-folders)\n11. [Get upcoming events](#11-get-upcoming-events)\n12. [Get all eventsources](#12-get-all-eventsources)\n13. [Get conference health](#13-get-conference-health)\n14. [Get badges](#14-get-badges)\n15. [Files](#15-files)\n16. [Read all notifications](#16-read-all-notifications)\n17. [Read a specific Notification](#17-read-a-specific-notification)\n18. [Send Email](#18-send-email)\n19. [Get other users information](#19-get-other-users-information)\n\n\n\n## Supported Functionality\n\n### Get own User Information\n\n```python\nuser_info = get_own_user_info()\n```\n\nThis method retrieves information about the currently logged-in user.\n\n### 2. Set own User Information\n\n```python\nset_own_user_info(key=value)\n```\n\nThis method sets your personal information\n\nAvailable keys are:\n\n`title`\n\n`company`\n\n`birthday`\n\n`nickname`\n\n`_class`\n\n`street`\n\n`zipcode`\n\n`city`\n\n`country`\n\n`phone`\n\n`mobilePhone`\n\n`fax`\n\n`mail`\n\n`homepage`\n\n`icq`\n\n`jabber`\n\n`msn`\n\n`skype`\n\n`note`\n\n\n### 3. Get user avatar\n\n```python\nget_user_profile_picture(user, output_folder)\n```\n\nThis method retrieves the avatar of any user on the network\n\nIt saves the avatar in the folder followed by the username,\n\n\n### 4. Get emails\n\n```python\nemails = get_emails(path = 'INBOX', length = 50, start = 0, order = 'date', dir = 'desc')\n```\n\nRetrieves emails from a specified path with optional parameters for length, start, order, and direction.\n\n### 5. Search users\n\n```python\nsearch_users(query)\n```\n\n\n\n### 6. Search users autocomplete\n\n```python\nusers = search_users_autocomplete(query, limit=50)\n```\n\nFaster than `search_users()` but may not display all users\n\n### 7. Fetch notifications\n\n```python\nnotifications = get_notifications()\n```\n\nRetrieves notifications from the specified URL and returns them as a JSON object.\n\n\n### 8. Get general Information about emails\n\n```python\nemail_info = get_email_info(path=\"INBOX\", length=0, start=0, order=\"date\", dir=\"desc\")\n```\n\nRetrieves email information from the specified path in the mailbox. For example: unread emails.\n\n\n### 9. Get email source\n\n```python\nemail_source = get_email_source(uid, path=\"INBOX\")\n```\n\nRetrieves the source code of an email message from the specified email path and message ID.\n\n\n### 10. Get all mail folders\n\n```python\nmail_folders = get_mail_folders()\n```\n\nRetrieves the list of mail folders.\n\n\n### 11. Get upcoming events\n\n```python\nevents = get_upcoming_events()\n```\n\nRetrieves the upcoming events from the IServ calendar API.\n\n\n### 12. Get all eventsources\n\n```python\neventsources = get_eventsources()\n```\n\nRetrieves the event sources from the calendar API.\n\n\n### 13. Get conference health\n\n```python\nhealth = get_conference_health()\n```\n\nGet the health status of the conference API endpoint.\n\n\n### 14. Get badges\n\n```python\nbadges = get_badges()\n```\n\nRetrieves the badges from the IServ server. (Badges=numbers on sidebar)\n\n\n### 15. Files\n\n```python\nclient = file()\n\n```\n\nPossible functions:\n\n**Synchronous methods**\n\n```python\n# Checking existence of the resource\n\nclient.check(\"dir1/file1\")\nclient.check(\"dir1\")\n```\n\n```python\n# Get information about the resource\n\nclient.info(\"dir1/file1\")\nclient.info(\"dir1/\")\n```\n\n```python\n# Check free space\n\nfree_size = client.free()\n```\n\n```python\n# Get a list of resources\n\nfiles1 = client.list()\nfiles2 = client.list(\"dir1\")\n```\n\n```python\n# Create directory\n\nclient.mkdir(\"dir1/dir2\")\n```\n\n```python\n# Delete resource\n\nclient.clean(\"dir1/dir2\")\n```\n\n```python\n# Copy resource\n\nclient.copy(remote_path_from=\"dir1/file1\", remote_path_to=\"dir2/file1\")\nclient.copy(remote_path_from=\"dir2\", remote_path_to=\"dir3\")\n```\n\n```python\n# Move resource\n\nclient.move(remote_path_from=\"dir1/file1\", remote_path_to=\"dir2/file1\")\nclient.move(remote_path_from=\"dir2\", remote_path_to=\"dir3\")\n```\n\n```python\n# Move resource\n\nclient.download_sync(remote_path=\"dir1/file1\", local_path=\"~/Downloads/file1\")\nclient.download_sync(remote_path=\"dir1/dir2/\", local_path=\"~/Downloads/dir2/\")\n```\n\n```python\n# Unload resource\n\nclient.upload_sync(remote_path=\"dir1/file1\", local_path=\"~/Documents/file1\")\nclient.upload_sync(remote_path=\"dir1/dir2/\", local_path=\"~/Documents/dir2/\")\n```\n\n```python\n# Publish the resource\n\nlink = client.publish(\"dir1/file1\")\nlink = client.publish(\"dir2\")\n```\n\n```python\n# Unpublish resource\n\nclient.unpublish(\"dir1/file1\")\nclient.unpublish(\"dir2\")\n```\n\n```python\n# Get the missing files\n\nclient.pull(remote_directory='dir1', local_directory='~/Documents/dir1')\n```\n\n```python\n# Send missing files\n\nclient.push(remote_directory='dir1', local_directory='~/Documents/dir1')\n```\n\n**Asynchronous methods**\n\n```python\n# Load resource\n\nkwargs = {\n 'remote_path': \"dir1/file1\",\n 'local_path':  \"~/Downloads/file1\",\n 'callback':    callback\n}\nclient.download_async(**kwargs)\n\nkwargs = {\n 'remote_path': \"dir1/dir2/\",\n 'local_path':  \"~/Downloads/dir2/\",\n 'callback':    callback\n}\nclient.download_async(**kwargs)\n```\n\n```python\n# Unload resource\n\nkwargs = {\n 'remote_path': \"dir1/file1\",\n 'local_path':  \"~/Downloads/file1\",\n 'callback':    callback\n}\nclient.upload_async(**kwargs)\n\nkwargs = {\n 'remote_path': \"dir1/dir2/\",\n 'local_path':  \"~/Downloads/dir2/\",\n 'callback':    callback\n}\nclient.upload_async(**kwargs)\n```\n\nFor further informations visit [CloudPolis/webdav-client-python](https://github.com/CloudPolis/webdav-client-python)\n\n\n### 16. Read all notifications\n\n```python\nread_all_notifications()\n```\n\nMarks all Notification as read.\n\n\n### 17. Read a specific Notification\n\n\n```python\nread_notifiaction(notification_id)\n```\n\nMarks a specified Message as read. Note: notification_id can be returned from get_notifications()\n\n\n### 18. Send Email\n\n\n```python\nsend_email(receiver_email:str, subject:str, body:str, html_body:str=None, smtp_server:str=None, smtps_port:int=465, sender_name:str=None, attachments:list=None, sender_email:str=None)\n```\n\nSends an email. Note all variables defaulting to none get defined later so don't worry.\n\nsender_email must be a valid name present in the iserv network.\n\n\n### 19. Get other users information\n\n\n```python\nget_user_info(user)\n```\n\nGet someone else's public information this includes everything they heve set in 'Personal Information'\n\n### Logging\n\nAdd this\n```python\nIServAPI.setup_logging(\"app.log\")\n```\nafter your `from IServAPI.IServAPI import IServAPI`\n\n\n### To-Do List\n\n- [x] add search users\n\n- [x] more functionality\n\n- [ ] make wiki\n\n## Contribution\n\nContributions are welcome! If you'd like to contribute to this project, please fork the repository and submit\n\na pull request. Make sure to follow the existing code style and add appropriate tests for new functionality.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n> [!IMPORTANT]\n> ## DISCLAIMER\n> I HOLD NO RESPONSIBILITY FOR ANY DAMAGES OR DATALOSS DONE BY THIS > PACKAGE. >YOU ARE RESPONSIBLE FOR YOUR DATA!\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Unofficial API for IServ",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/Leo-Aqua/IServAPI"
    },
    "split_keywords": [
        "iserv",
        " iservapi",
        " iserv api",
        " iserv-api",
        " api",
        " leo-aqua"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "53a162abb483e60183ce0f823a3f106e1e5221432a5e00bcc254746d3fb68500",
                "md5": "5ff97dd844a0a24bcb3216d9f3806064",
                "sha256": "21c3d23e35b92a41341f1140922efeed25cd39af50f5bdaecd3ef9fb34ad7c8c"
            },
            "downloads": -1,
            "filename": "IServAPI-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5ff97dd844a0a24bcb3216d9f3806064",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 13738,
            "upload_time": "2024-04-01T14:54:24",
            "upload_time_iso_8601": "2024-04-01T14:54:24.505158Z",
            "url": "https://files.pythonhosted.org/packages/53/a1/62abb483e60183ce0f823a3f106e1e5221432a5e00bcc254746d3fb68500/IServAPI-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e94ec15d4a5a14dcddb7530d89aa4e167180f564f9057a1ad17e2ef3c18c3b80",
                "md5": "0831c6600c126ce9cf8cf77852ee67d5",
                "sha256": "9392a56125c9a9be44284bf04892cda8fa3d62f18f997713b6b6cf1d5876fb35"
            },
            "downloads": -1,
            "filename": "IServAPI-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0831c6600c126ce9cf8cf77852ee67d5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 16430,
            "upload_time": "2024-04-01T14:54:25",
            "upload_time_iso_8601": "2024-04-01T14:54:25.602383Z",
            "url": "https://files.pythonhosted.org/packages/e9/4e/c15d4a5a14dcddb7530d89aa4e167180f564f9057a1ad17e2ef3c18c3b80/IServAPI-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-01 14:54:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Leo-Aqua",
    "github_project": "IServAPI",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "requests",
            "specs": []
        },
        {
            "name": "logging",
            "specs": []
        },
        {
            "name": "bs4",
            "specs": []
        },
        {
            "name": "lxml",
            "specs": []
        },
        {
            "name": "webdavclient",
            "specs": []
        },
        {
            "name": "urllib",
            "specs": []
        },
        {
            "name": "pandas",
            "specs": []
        }
    ],
    "lcname": "iservapi"
}
        
Elapsed time: 0.73704s