Skip to content

Commit

Permalink
Update docs to fix incorrect demo and add some more info
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoni-Czaplicki committed Jul 6, 2024
1 parent 864bf5a commit 8c4989d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 45 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# USOS API for python, in development
# USOS API for python, in development

This is a python library for USOS API. It is in development, so it is not recommended to use it in production.

Visit [documentation](https://usos-api.readthedocs.io) for more information.
4 changes: 2 additions & 2 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Here's a basic example of how to use the USOS API to fetch user data:
async with USOSClient(api_base_address, consumer_key, consumer_secret) as client:
load_access_token("access_token", "access_token_secret")
user = await client.get_user()
user = await client.user_service.get_user()
print(user)
Expand All @@ -88,7 +88,7 @@ You can also use the USOSClient without the context manager, but remember to clo
client = USOSClient(api_base_address, consumer_key, consumer_secret)
await client.open()
load_access_token("access_token", "access_token_secret")
user = await client.get_user()
user = await client.user_service.get_user()
print(user)
await client.close()
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[tool.poetry]
name = "usos-api"
version = "0.1.0"
version = "0.1.1"
description = "Asynchronous USOS API for Python"
authors = ["Antoni-Czaplicki <[email protected]>"]
readme = "README.md"
homepage = "https://github.com/Antoni-Czaplicki/usos-api"
repository = "https://github.com/Antoni-Czaplicki/usos-api"
documentation = "https://usos-api.readthedocs.io"

[tool.poetry.dependencies]
python = "^3.12"
Expand Down
42 changes: 1 addition & 41 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,47 +32,7 @@ async def fetch_data(api_base_address: str, consumer_key: str, consumer_secret:

user = await client.user_service.get_user()
if user:
fields = [
"id",
"first_name",
"middle_names",
"last_name",
"previous_names",
"sex",
"titles",
"student_status",
"staff_status",
"email_access",
"email",
"email_url",
"has_email",
"homepage_url",
"profile_url",
"phone_numbers",
"mobile_numbers",
"office_hours",
"interests",
"has_photo",
"photo_urls",
"student_number",
"pesel",
"birth_date",
"revenue_office_id",
"citizenship",
"room",
"student_programmes",
"employment_functions",
"employment_positions",
"course_editions_conducted",
"postal_addresses",
"alt_email",
"can_i_debug",
"external_ids",
"phd_student_status",
"library_card_id",
]
for field in fields:
print(f"{field}: {getattr(user, field)}")
print(user)
else:
print("User not found")

Expand Down

0 comments on commit 8c4989d

Please sign in to comment.