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 contests

The Contests part of Freelancehunt API.

Return type

Contests

property countries

The Countries part of Freelancehunt API.

Return type

Countries

property feed

The Feed part of Freelancehunt API.

Return type

Feed

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 profiles

The Profiles part of Freelancehunt API.

Return type

Profiles

property projects

The Projects part of Freelancehunt API.

Return type

Projects

property remaining_limit

Current remaining requests limitation.

Return type

int

property skills

The Skills part of Freelancehunt API.

Return type

Skills

property threads

The Threads part of Freelancehunt API.

Return type

Threads

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

City

Returns

the desired city.

property list

Get list of all cities.

Return type

List[City]

Returns

list of cities.

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

Cities

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 None

  • iso_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

Country

Returns

the desired country

property list

Get list of all countries.

Return type

List[Country]

Returns

list of countries

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 contests

The Contests part of Freelancehunt API.

Return type

Contests

property countries

The Countries part of Freelancehunt API.

Return type

Countries

property feed

The Feed part of Freelancehunt API.

Return type

Feed

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 profiles

The Profiles part of Freelancehunt API.

Return type

Profiles

property projects

The Projects part of Freelancehunt API.

Return type

Projects

property remaining_limit

Current remaining requests limitation.

Return type

int

property skills

The Skills part of Freelancehunt API.

Return type

Skills

property threads

The Threads part of Freelancehunt API.

Return type

Threads

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

Employer

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 None

  • city_id (Optional[int]) – employer from city (API-related City identifier), defaults to None

  • login (Optional[str]) – with the desired login, defaults to None

  • pages (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

Freelancer

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 None

  • city_id (Optional[int]) – freelancer from city (API-related City identifier), defaults to None

  • skill_id (Optional[int]) – freelancer skill (API-related Skill identifier), defaults to None

  • login (Optional[str]) – with the desired login, defaults to None

  • pages (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

Project

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 skills

  • employer_id (Optional[int]) – projects from employer with id

  • only_for_plus (bool) – filter only for plus if False, get otherwise, defaults is False

  • pages (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

Project

Returns

the desired project object.

my_projects(pages=1)

Get my projects list (10 objects).

Parameters

pages (Union[int, Tuple[int], List[int]]) – number of pages, defaults to 1

Raises

BadRequest – raises when you are not Employer.

Return type

List[Project]

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
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

get_my_reviews()

Get reviews of my profile.

Return type

List[Type[Review]]

Returns

profile reviews

get_reviews(profile_type, profile_id)

Get reviews of the desired profile.

Parameters
  • profile_type (str) – type of the desired profile, can be “freelancer” or “employer”

  • profile_id (int) – identifier of the desired profile

Return type

List[Type[Review]]

Returns

profile reviews

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

Skill

Returns

the desired skill

property list

Get list of all skills.

Return type

List[Skill]

Returns

list of skills

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

Thread

Returns

created thread

get_threads(pages=1)

Get list of threads.

Parameters

Tuple[int], List[int]] pages (Union[int,) – count of pages to get, defaults to 1

Return type

List[Thread]