freelancehunt package¶
freelancehunt.client module¶
Main file of FreelanceHunt API framework.
-
class
freelancehunt.client.
FreelanceHuntClient
(token, **kwargs)¶ Bases:
freelancehunt.core.FreelancehuntObject
Basic API client for FreelanceHunt.
- Parameters
token (str) – Token for access to Freelancehunt API (https://freelancehunt.com/my/api)
-
property
is_token_valid
¶ Check that is token valid.
- Return type
bool
-
property
left_time_limit_update
¶ Second to update remaining API limits.
- Return type
int
-
property
remaining_limit
¶ Current remaining requests limitation.
- Return type
int
Module contents¶
Package initialization and import control.
-
class
freelancehunt.
Cities
(country_id, token=None, **kwargs)¶ Bases:
freelancehunt.core.FreelancehuntObject
Provide operations with Cities API part.
Note
This module contains static content. It may be update(), but loaded info does not change on the API side.
Warning
For directly usage please set token argument.
- Parameters
token (str) – your API token, optional
country_id (int) – API-related country identifier to get cities of it
-
find
(text)¶ Find the names of the cities that contain the desired text.
- Parameters
text (
str
) – the desired text that need to be in an city name.- Return type
List
[City
]- Returns
list of cities with an text in name.
-
get
(city_id)¶ Get the desired city by city_id.
- Parameters
city_id (
int
) – id of the desired city (https://apidocs.freelancehunt.com/?version=latest#65a2a9b4-b52d-4706-8c54-990600b58c2b).- Return type
- Returns
the desired city.
-
update
()¶ Update static information from API.
- Return type
None
-
class
freelancehunt.
Contests
(token=None, **kwargs)¶ Bases:
freelancehunt.core.FreelancehuntObject
Provide operations with Contests API part.
Note
NOT IMPLEMENTED YET!
Warning
For directly usage please set token argument.
- Parameters
token (str) – your API token, optional
-
class
freelancehunt.
Countries
(token=None, **kwargs)¶ Bases:
freelancehunt.core.FreelancehuntObject
Provide operations with Countries API part.
Note
This module contains static content. It may be update(), but loaded info does not change on the API side.
Warning
For directly usage please set token argument.
- Parameters
token (str) – your API token, optional
-
property
cities
¶ Cities linked to this Country.
- Return type
- Returns
object for manipulate with Cities API part
-
find
(text)¶ Find countries with the desired text.
- Parameters
text (
str
) – text in country name- Raises
ValueError – No countries found
- Return type
List
[Country
]- Returns
list of countries with an text in name
-
get
(country_id=None, iso_code=None)¶ Get the filtered country.
- Parameters
country_id (
Optional
[int
]) – the desired API-related country id, defaults to Noneiso_code (
Optional
[str
]) – the desired ISO code of country, defaults to None
- Raises
AttributeError – No one of parameters filled
ValueError – Contry not found
- Return type
- Returns
the desired country
-
update
()¶ Update static information from API.
-
class
freelancehunt.
Feed
(token=None, **kwargs)¶ Bases:
freelancehunt.core.FreelancehuntObject
Provide operations with Feed API part.
Warning
For directly usage please set token argument.
- Parameters
token (str) – your API token, optional
-
property
contests
¶ Get all messages with linked contest in feed.
- Return type
List
[FeedMessage
]
-
get_new
()¶ Get all new notifications in feed.
- Return type
List
[FeedMessage
]
-
property
list
¶ Get all feed messages.
- Return type
List
[FeedMessage
]
-
property
projects
¶ Get all messages with linked project in feed.
- Return type
List
[FeedMessage
]
-
read
()¶ Mark feed as read.
-
update
()¶ Get latest feed information.
-
class
freelancehunt.
FreelanceHuntClient
(token, **kwargs)¶ Bases:
freelancehunt.core.FreelancehuntObject
Basic API client for FreelanceHunt.
- Parameters
token (str) – Token for access to Freelancehunt API (https://freelancehunt.com/my/api)
-
property
is_token_valid
¶ Check that is token valid.
- Return type
bool
-
property
left_time_limit_update
¶ Second to update remaining API limits.
- Return type
int
-
property
remaining_limit
¶ Current remaining requests limitation.
- Return type
int
-
class
freelancehunt.
Profiles
(token=None, **kwargs)¶ Bases:
freelancehunt.core.FreelancehuntObject
Provide operations with Profiles API part.
Warning
For directly usage please set token argument.
- Parameters
token (str) – your API token, optional
-
get_employer_datails
(profile_id)¶ Get information about employer by identifier.
- Parameters
profile_id (
int
) – the desired profile identifier- Return type
-
get_employers_list
(country_id=None, city_id=None, login=None, pages=1)¶ Get filtered employer profiles.
- Parameters
country_id (
Optional
[int
]) – employer from country (API-related Country identifier), defaults to Nonecity_id (
Optional
[int
]) – employer from city (API-related City identifier), defaults to Nonelogin (
Optional
[str
]) – with the desired login, defaults to Nonepages (
Union
[int
,Tuple
[int
],List
[int
],None
]) – number of pages, defaults to 1
- Return type
List
[Employer
]- Returns
list of filtered employer profiles
-
get_freelancer_datails
(profile_id)¶ Get information about freelancer by identifier.
- Parameters
profile_id (
int
) – the desired profile identifier- Return type
-
get_freelancers_list
(country_id=None, city_id=None, skill_id=None, login=None, pages=1)¶ Get filtered freelancer profiles.
- Parameters
country_id (
Optional
[int
]) – freelancer from country (API-related Country identifier), defaults to Nonecity_id (
Optional
[int
]) – freelancer from city (API-related City identifier), defaults to Noneskill_id (
Optional
[int
]) – freelancer skill (API-related Skill identifier), defaults to Nonelogin (
Optional
[str
]) – with the desired login, defaults to Nonepages (
Union
[int
,Tuple
[int
],List
[int
],None
]) – number of pages, defaults to 1
- Return type
List
[Freelancer
]- Returns
list of filtered freelancer profiles
-
property
my_profile
¶ Get my profile information.
- Return type
Union
[Employer
,Freelancer
]- Returns
information of your account
-
class
freelancehunt.
Projects
(token=None, **kwargs)¶ Bases:
freelancehunt.core.FreelancehuntObject
Provide operations with Projects API part.
Warning
For directly usage please set token argument.
- Parameters
token (str) – your API token, optional
-
create_project
(information)¶ Create new project on site.
TBD: Implement a convenient way to create a project.
- Parameters
information (
dict
) – required and optional params of new project (link: https://apidocs.freelancehunt.com/?version=latest#ff11ae15-05af-4ee8-ae7c-155cd137506f)- Return type
- Returns
representation of created project.
-
get_list
(pages=1, only_for_plus=False, skills=None, employer_id=None)¶ Get projects with filter and from multiple pages.
- Parameters
skills (
Union
[int
,str
,Skill
,List
[Skill
],List
[int
],Tuple
[Skill
],Tuple
[int
],None
]) – filter by skillsemployer_id (
Optional
[int
]) – projects from employer with idonly_for_plus (
bool
) – filter only for plus if False, get otherwise, defaults is Falsepages (
Union
[int
,Tuple
[int
],List
[int
]]) – number of pages to get, defaults - 1
- Return type
List
[Project
]
-
get_project
(project_id)¶ Get specific project by id.
- Parameters
project_id (
int
) – id of the desired project.- Return type
- Returns
the desired project object.
-
class
freelancehunt.
Requester
(token, language='en', **kwargs)¶ Bases:
object
Provides requests to API. Singleton.
-
classmethod
get_requester
(token=None, **kwargs)¶
-
limit
= None¶
-
request
(request_type, url, filters=None, payload=None)¶ Make request to API and handle results.
- Args:
request_type (str): “POST”, “GET”, “PATCH” or “DEL”.
- Return:
dict: JSON responce data in dict
-
request_date
= None¶
-
token
= None¶
-
classmethod
-
class
freelancehunt.
Reviews
(token=None, **kwargs)¶ Bases:
freelancehunt.core.FreelancehuntObject
Provide operations with Reviews API part.
Warning
For directly usage please set token argument.
- Parameters
token (str) – your API token, optional
-
class
freelancehunt.
Skills
(token=None, **kwargs)¶ Bases:
freelancehunt.core.FreelancehuntObject
Provide operations with Skills API part.
Note
This module contains static content. It may be update(), but loaded info does not change on the API side.
Warning
For directly usage please set token argument.
- Parameters
token (str) – your API token, optional
-
find
(text)¶ Find the names of the skill that contain the desired text.
- Parameters
text (
str
) – the desired text that need to be in an skill name.- Raises
ValueError – Skill not found.
- Return type
List
[Skill
]- Returns
list of skills with an text in name.
-
get
(skill_id)¶ Get the desired skill by API-related identifier.
- Parameters
skill_id (
int
) – identifier of the desired skill.- Return type
- Returns
the desired skill
-
update
()¶ Update static information from API.
-
class
freelancehunt.
Threads
(token=None, **kwargs)¶ Bases:
freelancehunt.core.FreelancehuntObject
Provide operations with Threads API part.
Warning
For directly usage please set token argument.
- Parameters
token (str) – your API token, optional
-
create_thread
(to_profile_id, subject, message_html)¶ Create new thread.
- Parameters
to_profile_id (int) – recipient profile id
subject (str) – thread subject
message_html (str) – the first thread’s message
- Return type
- Returns
created thread