Skip to content

Commit

Permalink
Merge pull request #40 from upwork/v1.3.6
Browse files Browse the repository at this point in the history
v1.3.6
  • Loading branch information
mnovozhylov authored Oct 21, 2019
2 parents 5b28f72 + e23f3e6 commit 19d4c89
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
7 changes: 7 additions & 0 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
README = readme.read()
readme.close()

VERSION = (1, 3, 5, 0, 0)
VERSION = (1, 3, 6, 0, 0)


def get_version():
Expand Down
2 changes: 1 addition & 1 deletion upwork/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""

VERSION = '1.3.5'
VERSION = '1.3.6'


def get_version():
Expand Down
18 changes: 18 additions & 0 deletions upwork/routers/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
Expand Down Expand Up @@ -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)
4 changes: 4 additions & 0 deletions upwork/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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']

Expand Down

0 comments on commit 19d4c89

Please sign in to comment.