rs3clans.py
A Python 3 module wrapper for RuneScape 3 API
Requirements:
Setup with pip:
$ python3 -m pip install rs3clans
Usage:
> Players
- Creating a Player object
- Always check if a player actually exists before doing anything with it
>>> from rs3clans import players
>>> player = players.Player(name='nriver')
>>> if player.exists:
... pass
- Whether the player exists or not
>>> player.exists
True
- Whether his Runemetrics Profile is Private or not
>>> player.private_profile
False
- You can also pass the argument runemetrics as
Falseif you don't want their runemetrics info to be set- This 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.exp
1037291112
- Getting a player's Total Level (requires Public Runemetrics Profile)
>>> player.total_level
- Getting a player's Combat Level (requires Public Runemetrics Profile)
>>> player.combat_level
138
- Quests information about a player (requires Public Runemetrics Profile)
>>> player.quests_not_started
32
>>> player.quests_started
5
>>> player.quests_complete
198
- Getting information on a specific skill of the player (requires Public Runemetrics Profile)
>>> player.skill('agility').level
99
- Skill name is case-insensitive
>>> player.skill('AtTaCk').rank
68311
- Can pass skill names as well as id
- (8 = Woodcutting for example)
>>> player.skill(8).exp
14054178.6
- Getting a player's title
>>> player.title
'The Liberator'
- Verifying if a player's title is a suffix or not
>>> player.suffix
True
- Getting a player's clan
>>> player.clan
'Atlantis'
> Clans
- Creating a Clan object
- Always check if a clan actually exists before doing anything with it
>>> from rs3clans import clans
>>> try:
... clan = clans.Clan('Atlantis')
... except clans.ClanNotFoundError:
... print('Clan not found.')
- Getting a clan's total Exp
>>> clan.exp
151349638333
- Getting information about a specific member in that clan
- Clan.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.count
499
- Getting the average Clan Exp per player in clan
>>> clan.avg_exp
303305888.44288576
- Iterate through a Clan
>>> for member in clan:
>>> print(f"{member} - {member.name}")
ClanMember(Pedim, Owner, 1249520826) - Pedim
ClanMember(Acriano, Overseer, 1903276564) - Acriano
ClanMember(Cogu, Overseer, 1829449412) - Cogu
ClanMember(Black bullet, Overseer, 1100767386) - Black Bullet
ClanMember(NRiver, Overseer, 1090093362) - NRiver
ClanMember(Kurenaii, Overseer, 395850997) - Kurenaii
...
Contributing:
-
Guidelines:
- Follow Pep8 with the exception of
E501 (line too long)
- Follow Pep8 with the exception of
-
Fork the repository
-
Install Dev dependencies
- With poetry
$ python3 -m virtualenv .venv $ poetry shell $ poetry install
- Without pipenv
$ python3 -m virtualenv .venv $ source .venv/bin/activate $ pip install -r requirements-dev.txt
- With poetry
-
Run the tests to make sure everything is ok
$ pytest -
Make your changes to the code in the directory
rs3clans.py/rs3clans/ -
Add necessary tests to the
rs3clans.py/tests/directory (pytest docs) -
Run the tests again
$ pytest -
Also run
flake8just to check if the code style is also fine$ flake8 --ignore=E501 rs3clans/
-
If everything went fine then send a Pull Request
Metadata
Release files for rs3clans 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| rs3clans-1.1.3.tar.gz | 11.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rs3clans-1.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.0 kB
Release files / rs3clans-1.1.3.tar.gz
| Download URL | rs3clans-1.1.3.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3cbae1b8304273de0f3ef40b90bcc94db00f574104c20e05e3e96902b08a4bc0
|
|
BLAKE2b-256 checksum How to use checksums |
2e253afa2f89a9d66bfd60e9984a8098df27cc8c4aae4ddfc5055daf43b8edf3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.16 CPython/3.6.7 Linux/4.15.0-1028-gcp
|
Release files / rs3clans-1.1.3-py3-none-any.whl
| Download URL | rs3clans-1.1.3-py3-none-any.whl |
|---|---|
| Size | 10.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8cd17bd526dab3b8d706c5e9cd27e3e65485734c3184ece76e7e5d80323377b2
|
|
BLAKE2b-256 checksum How to use checksums |
2f702144ecb32d0f089f98a072b526748b450f477c4a9ad6fd97641ba8a8c480
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.16 CPython/3.6.7 Linux/4.15.0-1028-gcp
|
Security for rs3clans 1.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.