From e23f3e6fc92cb10e0286a357b4d1eb365d06ae7a Mon Sep 17 00:00:00 2001 From: Maksym Novozhylov Date: Mon, 21 Oct 2019 13:44:11 +0200 Subject: [PATCH] v1.3.6 --- changelog.rst | 7 +++++++ setup.py | 2 +- upwork/__init__.py | 2 +- upwork/routers/provider.py | 18 ++++++++++++++++++ upwork/tests.py | 4 ++++ 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/changelog.rst b/changelog.rst index bdc3e62..78fb799 100644 --- a/changelog.rst +++ b/changelog.rst @@ -5,6 +5,13 @@ Changelog *************** +.. _1.3.6: + +Version 1.3.6 +------------- +* Add Specialties API +* Add Skills V2 API + .. _1.3.5: Version 1.3.5 diff --git a/setup.py b/setup.py index e3ab31c..86fa910 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ README = readme.read() readme.close() -VERSION = (1, 3, 5, 0, 0) +VERSION = (1, 3, 6, 0, 0) def get_version(): diff --git a/upwork/__init__.py b/upwork/__init__.py index 8339dac..9c105ac 100644 --- a/upwork/__init__.py +++ b/upwork/__init__.py @@ -13,7 +13,7 @@ """ -VERSION = '1.3.5' +VERSION = '1.3.6' def get_version(): diff --git a/upwork/routers/provider.py b/upwork/routers/provider.py index 7ca1dbe..0a3acf3 100644 --- a/upwork/routers/provider.py +++ b/upwork/routers/provider.py @@ -89,6 +89,15 @@ def get_reasons_metadata(self, reason_type): result = self.get(url, data) return result.get('reasons', result) + def get_specialties_metadata(self): + """ + Returns list of all specialties available for job/contractor profiles. + + """ + url = 'metadata/specialties' + result = self.get(url) + return result.get('specialties', result) + class Provider_V2(Namespace): api_url = 'profiles/' @@ -338,3 +347,12 @@ def search_jobs(self, data=None, page_offset=0, page_size=20): result = self.get(url, data=search_data) return result.get('jobs', result) + + def get_skills_metadata(self): + """ + Returns list of all V2 skills available for job/contractor profiles. + + """ + url = 'metadata/skills' + result = self.get(url) + return result.get('skills', result) diff --git a/upwork/tests.py b/upwork/tests.py index fb42b8c..bc1c2c1 100644 --- a/upwork/tests.py +++ b/upwork/tests.py @@ -787,6 +787,7 @@ def test_job_data_no_category(): 'jobs': {'test': 'test'}, 'otherexp': 'experiences', 'skills': 'skills', + 'specialties': 'specialties', 'tests': 'tests', 'certificates': 'certificates', 'employments': 'employments', @@ -821,6 +822,9 @@ def test_provider(): result = pr.get_skills_metadata() assert result == provider_dict['skills'] + result = pr.get_specialties_metadata() + assert result == provider_dict['specialties'] + result = pr.get_regions_metadata() assert result == provider_dict['regions']