Skip to content

Commit

Permalink
Updates the Getting Started in README to reflect changes in 2.0.0
Browse files Browse the repository at this point in the history
- Updates the Getting Started in README.md to reflect changes in 2.0.0
  • Loading branch information
isFakeAccount committed Jun 17, 2024
1 parent cf0f9fa commit a6fceac
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Retrieve User Information, Trophies, Game and Store data from the PlayStation Ne
[![Documentation Status](https://readthedocs.org/projects/psnawp/badge/?version=latest)](https://psnawp.readthedocs.io/en/latest/?badge=latest)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/license/MIT)

<!-- Pytest Coverage Comment:Begin -->
<a href="https://github.com/isFakeAccount/psnawp/blob/main/README.md"><img alt="Coverage" src="https://img.shields.io/badge/Coverage-91%25-brightgreen.svg" /></a><details><summary>Coverage Report </summary><table><tr><th>File</th><th>Stmts</th><th>Miss</th><th>Cover</th><th>Missing</th></tr><tbody><tr><td colspan="5"><b>src/psnawp_api</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/__init__.py">__init__.py</a></td><td>2</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/psnawp.py">psnawp.py</a></td><td>40</td><td>2</td><td>2</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/psnawp.py#L 95%"> 95%</a></td></tr><tr><td colspan="5"><b>src/psnawp_api/core</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/core/__init__.py">__init__.py</a></td><td>4</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/core/authenticator.py">authenticator.py</a></td><td>129</td><td>19</td><td>19</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/core/authenticator.py#L 85%"> 85%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/core/psnawp_exceptions.py">psnawp_exceptions.py</a></td><td>11</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/core/request_builder.py">request_builder.py</a></td><td>65</td><td>9</td><td>9</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/core/request_builder.py#L 86%"> 86%</a></td></tr><tr><td colspan="5"><b>src/psnawp_api/models</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/__init__.py">__init__.py</a></td><td>7</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/client.py">client.py</a></td><td>73</td><td>2</td><td>2</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/client.py#L 97%"> 97%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/game_title.py">game_title.py</a></td><td>26</td><td>2</td><td>2</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/game_title.py#L 92%"> 92%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/group.py">group.py</a></td><td>53</td><td>8</td><td>8</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/group.py#L 85%"> 85%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/search.py">search.py</a></td><td>150</td><td>42</td><td>42</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/search.py#L 72%"> 72%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/title_stats.py">title_stats.py</a></td><td>75</td><td>3</td><td>3</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/title_stats.py#L 96%"> 96%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/user.py">user.py</a></td><td>79</td><td>2</td><td>2</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/user.py#L 97%"> 97%</a></td></tr><tr><td colspan="5"><b>src/psnawp_api/models/listing</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/listing/__init__.py">__init__.py</a></td><td>2</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/listing/pagination_iterator.py">pagination_iterator.py</a></td><td>56</td><td>4</td><td>4</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/listing/pagination_iterator.py#L 93%"> 93%</a></td></tr><tr><td colspan="5"><b>src/psnawp_api/models/trophies</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/__init__.py">__init__.py</a></td><td>6</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy.py">trophy.py</a></td><td>130</td><td>9</td><td>9</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy.py#L 93%"> 93%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy_constants.py">trophy_constants.py</a></td><td>30</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy_group.py">trophy_group.py</a></td><td>92</td><td>3</td><td>3</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy_group.py#L 97%"> 97%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy_summary.py">trophy_summary.py</a></td><td>27</td><td>1</td><td>1</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy_summary.py#L 96%"> 96%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy_titles.py">trophy_titles.py</a></td><td>88</td><td>2</td><td>2</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy_titles.py#L 98%"> 98%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/utility_functions.py">utility_functions.py</a></td><td>7</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td colspan="5"><b>src/psnawp_api/utils</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/utils/__init__.py">__init__.py</a></td><td>3</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/utils/endpoints.py">endpoints.py</a></td><td>2</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/utils/misc.py">misc.py</a></td><td>5</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td><b>TOTAL</b></td><td><b>1162</b></td><td><b>108</b></td><td><b>91%</b></td><td>&nbsp;</td></tr></tbody></table></details>
<!-- Pytest Coverage Comment:End -->
<!-- Pytest Coverage Comment:Begin -->
<a href="https://github.com/isFakeAccount/psnawp/blob/main/README.md"><img alt="Coverage" src="https://img.shields.io/badge/Coverage-91%25-brightgreen.svg" /></a><details><summary>Coverage Report </summary><table><tr><th>File</th><th>Stmts</th><th>Miss</th><th>Cover</th><th>Missing</th></tr><tbody><tr><td colspan="5"><b>src/psnawp_api</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/__init__.py">__init__.py</a></td><td>2</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/psnawp.py">psnawp.py</a></td><td>40</td><td>2</td><td>2</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/psnawp.py#L 95%"> 95%</a></td></tr><tr><td colspan="5"><b>src/psnawp_api/core</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/core/__init__.py">__init__.py</a></td><td>4</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/core/authenticator.py">authenticator.py</a></td><td>129</td><td>19</td><td>19</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/core/authenticator.py#L 85%"> 85%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/core/psnawp_exceptions.py">psnawp_exceptions.py</a></td><td>11</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/core/request_builder.py">request_builder.py</a></td><td>65</td><td>9</td><td>9</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/core/request_builder.py#L 86%"> 86%</a></td></tr><tr><td colspan="5"><b>src/psnawp_api/models</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/__init__.py">__init__.py</a></td><td>7</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/client.py">client.py</a></td><td>73</td><td>2</td><td>2</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/client.py#L 97%"> 97%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/game_title.py">game_title.py</a></td><td>26</td><td>2</td><td>2</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/game_title.py#L 92%"> 92%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/group.py">group.py</a></td><td>53</td><td>8</td><td>8</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/group.py#L 85%"> 85%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/search.py">search.py</a></td><td>150</td><td>42</td><td>42</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/search.py#L 72%"> 72%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/title_stats.py">title_stats.py</a></td><td>75</td><td>3</td><td>3</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/title_stats.py#L 96%"> 96%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/user.py">user.py</a></td><td>79</td><td>2</td><td>2</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/user.py#L 97%"> 97%</a></td></tr><tr><td colspan="5"><b>src/psnawp_api/models/listing</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/listing/__init__.py">__init__.py</a></td><td>2</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/listing/pagination_iterator.py">pagination_iterator.py</a></td><td>56</td><td>4</td><td>4</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/listing/pagination_iterator.py#L 93%"> 93%</a></td></tr><tr><td colspan="5"><b>src/psnawp_api/models/trophies</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/__init__.py">__init__.py</a></td><td>6</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy.py">trophy.py</a></td><td>130</td><td>9</td><td>9</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy.py#L 93%"> 93%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy_constants.py">trophy_constants.py</a></td><td>30</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy_group.py">trophy_group.py</a></td><td>92</td><td>3</td><td>3</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy_group.py#L 97%"> 97%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy_summary.py">trophy_summary.py</a></td><td>27</td><td>1</td><td>1</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy_summary.py#L 96%"> 96%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy_titles.py">trophy_titles.py</a></td><td>88</td><td>2</td><td>2</td><td><a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/trophy_titles.py#L 98%"> 98%</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/models/trophies/utility_functions.py">utility_functions.py</a></td><td>7</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td colspan="5"><b>src/psnawp_api/utils</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/utils/__init__.py">__init__.py</a></td><td>3</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/utils/endpoints.py">endpoints.py</a></td><td>2</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/isFakeAccount/psnawp/blob/main/src/psnawp_api/utils/misc.py">misc.py</a></td><td>5</td><td>0</td><td>100%</td><td>&nbsp;</td></tr><tr><td><b>TOTAL</b></td><td><b>1162</b></td><td><b>108</b></td><td><b>91%</b></td><td>&nbsp;</td></tr></tbody></table></details>
<!-- Pytest Coverage Comment:End -->

## How to install

Expand Down Expand Up @@ -47,8 +47,10 @@ Following is the quick example on how to use this library

```py
from psnawp_api import PSNAWP
from psnawp_api.models import SearchDomain
from psnawp_api.models.trophies import PlatformType

psnawp = PSNAWP('<64 character npsso code>')
psnawp = PSNAWP("<64 character npsso code>")

# Your Personal Account Info
client = psnawp.me()
Expand Down Expand Up @@ -76,11 +78,15 @@ available_to_play = client.available_to_play()
for user in available_to_play:
print(f"Available to Play: {user} \n")

# Your trophies (PS4)
for trophy in client.trophies("NPWR22810_00", PlatformType.PS4):
print(trophy)

# Your Chat Groups
groups = client.get_groups()
first_group_id = None # This will be used later to test group methods
first_group_id = None # This will be used later to test group methods
for id, group in enumerate(groups):
if id == 0: # Get the first group ID
if id == 0: # Get the first group ID
first_group_id = group.group_id

group_info = group.get_group_information()
Expand All @@ -98,7 +104,7 @@ for title in titles_with_stats:


# Other User's
example_user_1 = psnawp.user(online_id="VaultTec-Co") # Get a PSN player by their Online ID
example_user_1 = psnawp.user(online_id="VaultTec-Co") # Get a PSN player by their Online ID
print(f"User 1 Online ID: {example_user_1.online_id}")
print(f"User 1 Account ID: {example_user_1.account_id}")

Expand All @@ -114,9 +120,9 @@ print(f"User Account ID: {user_account_id.online_id}")


# Messaging and Groups Interaction
group = psnawp.group(group_id=first_group_id) # This is the first group ID we got earlier - i.e. the first group in your groups list
group = psnawp.group(group_id=first_group_id) # This is the first group ID we got earlier - i.e. the first group in your groups list
print(group.get_group_information())
print(group.get_conversation(10)) # Get the last 10 messages in the group
print(group.get_conversation(10)) # Get the last 10 messages in the group
print(group.send_message("Hello World"))
print(group.change_name("API Testing 3"))
# print(group.leave_group()) # Uncomment to leave the group
Expand All @@ -128,9 +134,10 @@ print(new_group.get_group_information())
# You can use the same above methods to interact with the new group - i.e. send messages, change name, etc.

# Searching for Game Titles
search = psnawp.search()
print(search.get_title_id(title_name="GTA 5"))
print(search.universal_search("GTA 5"))
search = psnawp.search(search_query="GTA 5", search_domain=SearchDomain.FULL_GAMES)
for search_result in search:
print(search_result["result"]["invariantName"])

```

**Note: If you want to create multiple instances of psnawp you need to get npsso code from separate PSN accounts. If you generate a new npsso with same account your previous npsso will expire immediately.**
Expand Down

0 comments on commit a6fceac

Please sign in to comment.