Package: rs3clans
rs3clans.pyA Python 3 module wrapper for RuneScape 3 APIChange LogRequirements:Python 3.6+requests>=2.21.0Setup with pip:$python3-mpipinstallrs3clansUsage:> PlayersCreating a Player objectAlways check if a player actually exists before doing anything with it>>>fromrs3clansimportplayers>>>player=players.Player(name='nriver')>>>ifplayer.exists:...passWhether the player exists or not>>>player.existsTrueWhether his Runemetrics Profile is Private or not>>>player.private_profileFalseYou can also pass the argument runemetrics asFalseif you don't want their runemetrics info to be setThis will make you unable to use some attributes from the Player class>>>player=players.Player(name='nriver',runemetrics=False)Getting a player's name(if his Runemetrics Profile is private it will return the same name passed when creating object)>>>player.name'NRiver'Getting a player's total Exp (requires Public Runemetrics Profile)>>>player.exp1037291112Getting a player's Total Level (requires Public Runemetrics Profile)>>>player.total_levelGetting a player's Combat Level (requires Public Runemetrics Profile)>>>player.combat_level138Quests information about a player (requires Public Runemetrics Profile)>>>player.quests_not_started32>>>player.quests_started5>>>player.quests_complete198Getting information on a specific skill of the player (requires Public Runemetrics Profile)>>>player.skill('agility').level99Skill name is case-insensitive>>>player.skill('AtTaCk').rank68311Can pass skill names as well as id(8 = Woodcutting for example)>>>player.skill(8).exp14054178.6Getting a player's title>>>player.title'The Liberator'Verifying if a player's title is a suffix or not>>>player.suffixTrueGetting a player's clan>>>player.clan'Atlantis'> ClansCreating a Clan objectAlways check if a clan actually exists before doing anything with it>>>fromrs3clansimportclans>>>try:...clan=clans.Clan('Atlantis')...exceptclans.ClanNotFoundError:...print('Clan not found.')Getting a clan's total Exp>>>clan.exp151349638333Getting information about a specific member in that clanClan.member attribute (dict) (requires case-sensitive name)Clan.get_member() (method) (does not require case-sensitive name)Returns a ClanMember Object>>># Case-sensitive>>>clan.member['NRiver']ClanMember(NRiver,Overseer,1043065027)>>>clan.member['NRiver'].rank'Overseer'>>># Case-insensitive>>>clan.get_member('nriver')ClanMember(NRiver,Overseer,1043065027)>>>clan.get_member('nRiVeR').rank'Overseer'Getting the number of players in a clan>>>clan.count499Getting the average Clan Exp per player in clan>>>clan.avg_exp303305888.44288576Iterate through a Clan>>>formemberinclan:>>>print(f"{member}-{member.name}")ClanMember(Pedim,Owner,1249520826)-PedimClanMember(Acriano,Overseer,1903276564)-AcrianoClanMember(Cogu,Overseer,1829449412)-CoguClanMember(Blackbullet,Overseer,1100767386)-BlackBulletClanMember(NRiver,Overseer,1090093362)-NRiverClanMember(Kurenaii,Overseer,395850997)-Kurenaii...Contributing:Guidelines:Follow Pep8 with the exception ofE501 (line too long)Forkthe repositoryInstall Dev dependenciesWith poetry$python3-mvirtualenv.venv
$poetryshell
$poetryinstallWithout pipenv$python3-mvirtualenv.venv
$source.venv/bin/activate
$pipinstall-rrequirements-dev.txtRun the tests to make sure everything is ok$pytestMake your changes to the code in the directoryrs3clans.py/rs3clans/Add necessary tests to thers3clans.py/tests/directory (pytest docs)Run the tests again$pytestAlso runflake8just to check if the code style is also fine$flake8--ignore=E501rs3clans/If everything went fine then send aPull Request