Package: gitcoin
Gitcoin Python API ClientThis Python package provides thebountiesendpoint of the Gitcoin API, which allows you to:list all bountieslist all bounties which meet certain conditions (i.e. filter them)retrieve a single bounty by it's primary keyInstall via pypipipinstallgitcoinUsage ExamplesList all bountiesfromgitcoinimportGitcoinapi=Gitcoin()all_bounties=api.bounties.all()List all open bountiesfromgitcoinimportGitcoinapi=Gitcoin()open_bounties=api.bounties.filter(is_open=True).all()List all open "Beginner" bountiesfromgitcoinimportGitcoinapi=Gitcoin()bounties_api=api.bountiesbounties_api.filter(is_open=True)bounties_api.filter(experience_level='Beginner')open_beginner_bounties=bounties_api.all()The example above has been reformatted for easier reading. Afluent interfaceis also available. Please scroll the following code block all the way to the end to see the whole line:fromgitcoinimportGitcoinapi=Gitcoin()open_beginner_bounties=api.bounties.filter(is_open=True,experience_level='Beginner').all()List all open bounties marked for either "Beginner" OR "Intermediate" experience levelFor some filter conditions, multiple different values can be given, which results in a logicalORfor that condition:fromgitcoinimportGitcoinapi=Gitcoin()bounties_api=api.bountiesbounties_api.filter(is_open=True)bounties_api.filter(experience_level='Beginner')bounties_api.filter(experience_level='Intermediate')open_beginner_and_intermediate_bounties=bounties_api.all()The example above has been reformatted for easier reading. Afluent interfaceis also available. Please scroll the following code block all the way to the end to see the whole line:fromgitcoinimportGitcoinapi=Gitcoin()open_beginner_and_intermediate_bounties=api.bounties.filter(is_open=True).filter(experience_level='Beginner').filter(experience_level='Intermediate').all()APIInstantiationCreate aGitcoin()API root object:fromgitcoinimportGitcoinapi=Gitcoin()ThebountiesAPI endpoint is accessible as a property of the API root object:bounties_endpoint=api.bountiesEach access to thebountiesproperty results in a newEndpointobject with no filter conditions or any other parameters (like sorting) set. If you want to keep a specific set of filter conditions, simply store theEndpointobject in a variable instead of referring to thebountiesproperty of the root object.bounties.filter(**kwargs)Limit the list of bounties returned by eitherget_page()orall()to those bounties meeting the filter condition(s). For some filter conditions, multiple different values can be given, which results in a logicalORfor that condition.The condition name is the name of the keyword argument, and the condition value is the value of the keyword argument:open_bounties=api.bounties.filter(is_open=True).all()Conditions with different names can be given in onefilter()call:open_beginnerbounties=api.bounties.filter(is_open=True,experience_level='Beginner').all()Or if preferred, they can also be given in separatefilter()calls:open_beginnerbounties=api.bounties.filter(is_open=True).filter(experience_level='Beginner').all()Giving multiple values for the same filter condition has to be done in separate calls tofilter():beginner_and_intermediate_bounties=api.bounties.filter(experience_level='Beginner').filter(experience_level='Intermediate').all()For the following filter conditions, multiple values can be given to achieve a logicalOR:experience_level (str)project_length (str)bounty_type (str)bounty_owner_address (str)bounty_owner_github_username (str)idx_status (str)network (str)standard_bounties_id (int)github_url (str)raw_data (str)The following filter conditions aresingle value, in other words, multiple values result in the last value overwriting all earlier values:pk__gt (int)started (str)is_open (bool)fulfiller_github_username (str)interested_github_username (str)filter()returns theEndpointobject itself to enable afluent interface.bounties.order_by(sort)Determine the order of the bounties returned by eitherget_page()orall(). Thesortargument is astringcontaining a DB field name to sort by. It can also have an optional "-" prefix for reversing the direction. Choose from these field names:acceptedbalancebounty_owner_addressbounty_owner_emailbounty_owner_github_usernamebounty_owner_namebounty_typecanceled_oncontract_addresscurrent_bountyexperience_levelexpires_datefulfillment_accepted_onfulfillment_started_onfulfillment_submitted_ongithub_commentsgithub_urlidx_experience_levelidx_project_lengthidx_statusinterestedinterested_commentis_openissue_descriptionlast_comment_datemetadatanetworknum_fulfillmentsoverride_statusprivacy_preferencesproject_lengthraw_datasnooze_warnings_for_daysstandard_bounties_idsubmissions_commenttitletoken_addresstoken_nametoken_value_in_usdttoken_value_time_peg_val_usd_dbvalue_in_ethvalue_in_tokenvalue_in_usdtvalue_in_usdt_nowvalue_trueweb3_createdweb3_typeorder_by()returns theEndpointobject itself to enable afluent interface.bounties.get_page(number=1, per_page=25)Returns one page of the (potentiallyfilter()ed)listof bounties with the given 1-based indexnumber (int). The page size can be set withper_page (int). Each bounty is adict, basically the direct output ofrequests'.json()call.bounties.all()Returns the complete (potentiallyfilter()ed)listof bounties. Each bounty is adict, basically the direct output ofrequests'.json()call.bounties.get(primary_key)Returns one (1) bounty as specified byprimary_key (int). It is returned as adict, basically the direct output ofrequests'.json()call.TodoAdd base gitcoin.Gitcoin clientAddbountiesapi filterImplement all filter fields present ingitcoinco/web/app/dashboard/router.pyAdduniverseapi filterImplement all filter fields present ingitcoinco/web/app/external_bounties/router.pyAdd sorting/order_byAdd pagination (page/limit)Add travis-ci.com project and twine/pypi credentials.Add codecov.io project.Cut first release (Tag github release, push changes, and let CI deploy to pypi)Maintain +90% coverage