# Connect to the Label Studio API and check the connection
ls = Client(url=url, api_key=api_key)
ls_status = ls.check_connection()
print(ls_status)
if ls_status['status'] != 'UP':
return '-1'
users = ls.get_users()
projects = ls.get_projects()
for user in users:
print(f'user_id:{user.id}\nuser_first_name:{user.first_name}\nuser_email:{user.email}')
# define filters
user_filters = Filters.create(Filters.AND, [
Filters.item(
Column.annotators,
Operator.CONTAINS,
Type.String,
Filters.value(user.id)
),
Filters.item(
Column.completed_at,
Operator.IN,
Type.Datetime,
Filters.value(
datetime(2023, 3, 1),
datetime(2023, 3, 31),
)
)
])
for project in projects:
project_params = project.get_params()
project_title = project_params['title']
project_members = project.get_members()
user_tasks = project.get_tasks(filters=user_filters)
user_tasks_num = len(user_tasks)
print(f'\tproject_title:{project_title}')
print(f'\tproject_members:{project_members}')
print(f'\tuser_tasks_num:{user_tasks_num}')
# print(f'\t{user_tasks}')
print('\n\n')
Expected behavior
Output the members of project.
Screenshots
{'status': 'UP'}
user_id:1
user_first_name:Tian
......
project_members = project.get_members()
File "/home/tianzx/.virtualenvs/yolov5/lib/python3.7/site-packages/label_studio_sdk/project.py", line 158, in get_members
response = self.make_request('GET', f'/api/projects/{self.id}/members')
File "/home/tianzx/.virtualenvs/yolov5/lib/python3.7/site-packages/label_studio_sdk/client.py", line 347, in make_request
response.raise_for_status()
File "/home/tianzx/.virtualenvs/yolov5/lib/python3.7/site-packages/requests/models.py", line 943, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://localhost:8080/api/projects/7/members
Environment (please complete the following information):
OS:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic
Describe the bug
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://localhost:8080/api/projects/7/members
To Reproduce Steps to reproduce the behavior:
docker run -d -p 8080:8080 -v
pwd:/label-studio/data heartexlabs/label-studio:develop
Run the following code:
Expected behavior
Output the members of project.
Screenshots
Environment (please complete the following information):