Skip to main content

Unofficial API for IServ

Project description

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 GitHub Downloads (all assets, all releases) PyPI - Downloads PyPI - Python Version PyPI - Wheel GitHub repo size PyPI - Version GitHub Repo stars

Installation

You can install the IServ Python module using pip:

pip install IServAPI

Basic usage

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

Supported Functionality

Get own User Information

user_info = get_own_user_info()

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

2. Set own User Information

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

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

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

search_users(query)

6. Search users autocomplete

users = search_users_autocomplete(query, limit=50)

Faster than search_users() but may not display all users

7. Fetch notifications

notifications = get_notifications()

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

8. Get general Information about emails

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

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

mail_folders = get_mail_folders()

Retrieves the list of mail folders.

11. Get upcoming events

events = get_upcoming_events()

Retrieves the upcoming events from the IServ calendar API.

12. Get all eventsources

eventsources = get_eventsources()

Retrieves the event sources from the calendar API.

13. Get conference health

health = get_conference_health()

Get the health status of the conference API endpoint.

14. Get badges

badges = get_badges()

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

15. Files

client = file()

Possible functions:

Synchronous methods

# Checking existence of the resource

client.check("dir1/file1")
client.check("dir1")
# Get information about the resource

client.info("dir1/file1")
client.info("dir1/")
# Check free space

free_size = client.free()
# Get a list of resources

files1 = client.list()
files2 = client.list("dir1")
# Create directory

client.mkdir("dir1/dir2")
# Delete resource

client.clean("dir1/dir2")
# Copy resource

client.copy(remote_path_from="dir1/file1", remote_path_to="dir2/file1")
client.copy(remote_path_from="dir2", remote_path_to="dir3")
# Move resource

client.move(remote_path_from="dir1/file1", remote_path_to="dir2/file1")
client.move(remote_path_from="dir2", remote_path_to="dir3")
# Move resource

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

client.upload_sync(remote_path="dir1/file1", local_path="~/Documents/file1")
client.upload_sync(remote_path="dir1/dir2/", local_path="~/Documents/dir2/")
# Publish the resource

link = client.publish("dir1/file1")
link = client.publish("dir2")
# Unpublish resource

client.unpublish("dir1/file1")
client.unpublish("dir2")
# Get the missing files

client.pull(remote_directory='dir1', local_directory='~/Documents/dir1')
# Send missing files

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

Asynchronous methods

# 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)
# 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

16. Read all notifications

read_all_notifications()

Marks all Notification as read.

17. Read a specific Notification

read_notifiaction(notification_id)

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

18. Send Email

send_email(receiver_email:str, subject:str, body:str, html_body:str=None, smtp_server:str=None, smtps_port:int=465, attachments:list=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

get_user_info(user)

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

Logging

Add this

IServAPI.setup_logging("app.log")

after your from IServAPI import IServAPI

To-Do List

  • add search users

  • 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 file for details.

[!IMPORTANT]

DISCLAIMER

I HOLD NO RESPONSIBILITY FOR ANY DAMAGES OR DATALOSS DONE BY THIS PACKAGE.

YOU ARE RESPONSIBLE FOR WHAT YOU DO!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iservapi-1.2.0.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

IServAPI-1.2.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file iservapi-1.2.0.tar.gz.

File metadata

  • Download URL: iservapi-1.2.0.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for iservapi-1.2.0.tar.gz
Algorithm Hash digest
SHA256 f960828ffd09dae109f1bb46a6174fa35be7a35946ebc11033b1ec9fa73b5d30
MD5 7df4d78cecb0310ad37b96a52467c354
BLAKE2b-256 604b31b7511f99ba7dcbb7393963147cd2e189d20213d8ceabaa696e8069a489

See more details on using hashes here.

File details

Details for the file IServAPI-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: IServAPI-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for IServAPI-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e48a646bbd3e0c129dd1fba92f7a79ff44f40f90c78516131c9293aa25cfc2e5
MD5 a5a130eab439e217f4e9271f246ceb85
BLAKE2b-256 c2323d0d00d3403bb82eece752db1aa3881ac3101cffd4565ab1f0d2071bcfd0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page