Skip to main content

API wrapper for Pointercrate.

Project description

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Pointercrate Python API

pointercratepy is a library that provides its users ability to interact with the api of Pointercrate.
Explore the docs
Report Bug | Request Feature

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Documentation
  5. Roadmap
  6. Contributing
  7. License
  8. Contact
  9. Credits
  10. Changelog

About the project

Built With

Getting Started

Installation

Windows

python -m pip install pointercratepy

Linux

python3 -m pip install pointercratepy

Usage

from pointercratepy import Client

client = Client()

Documentation

pointercratepy allows you searching and interacting with the demons of pointercrate ! You can also get information about the demons that are not in the list anymore.

Demons

function get_demons(**options)

Parameters:

  • limit (Optional [int]) - The maximum amount of object to return. Must lie between 1 and 100 | Default is 50
  • name (Optional [str]) - Filter with the name of the demon [!!!] Case sensitive [!!!]
  • name_contains (Optional [str]) - Check if a demon has the specified string in his name, not case sensitive so it's a good alternative to name filter.
  • after (Optional [int]) - Used for pagination, example below.
  • before (Optional [int]) - Used for pagination, example below.
  • verifier_id (Optional [int]) - Filter with the verifier's id.
  • publisher_id (Optional [int]) - Filter with the publisher's id.
  • publisher_name (Optional [str]) - Filter with the name of the player who uploaded the level. [!!!] Case sensitive [!!!]
  • listed (Optional [bool]) - Sort the levels by their position in the list. | Default is True

Returns: All demons information.

Return type: List of objects

[
  {
    "id": 250,
    "position": 1,
    "name": "Tartarus",
    "requirement": 47,
    "video": "https://www.youtube.com/watch?v=9YYQBbrsV5Y",
    "publisher": {
      "id": 34134,
      "name": "Dolphy",
      "banned": false
    },
    "verifier": {
      "id": 34134,
      "name": "Dolphy",
      "banned": false
    },
    "level_id": 59075347
  },
  {
    "id": 274,
    "position": 2,
    "name": "The Golden",
    "requirement": 50,
    "video": "https://www.youtube.com/watch?v=Aas8_QKLnuc",
    "publisher": {
      "id": 35150,
      "name": "BoBoBoBoBoBoBo",
      "banned": false
    },
    "verifier": {
      "id": 5240,
      "name": "nSwish",
      "banned": false
    },
    "level_id": 60978746
  }
]

 

id

Type: int               The ID of the object in the database.

 

position

Type: int               The position of the demon in the list.

 

name

Type: str               The name of the demon.

 

requirement

Type: int               The requirement % to get your record accepted.

 

video

Type: str               Link of the video of the level.

 

Object publisher: contains information about the player who uploaded the level

              id

               Type: int               Player's ID.

              name

               Type: str               Player's name.

              banned

               Type: bool            If the player is banned from pointercrate or not.

 

Object verifier: contains information about the player who verified the level

              id

               Type: int               Player's ID.

              name

               Type: str               Player's name.

              banned

               Type: bool            If the verifier is banned from pointercrate or not.

 

level_id

Type: int               The ID of the demon.

Players

function get_players_ranked(**options)

Parameters:

  • limit (Optional [int]) - The maximum amount of object to return. Must lie between 1 and 100 | Default is 50
  • name (Optional [str]) - Filter with the name of the player [!!!] Case sensitive [!!!]
  • name_contains (Optional [str]) - Check if a player has the specified string in his name, not case sensitive so it's a good alternative to name filter.
  • nation (Optional [str]) - Filter with the nation of the player.
  • after (Optional [int]) - Used for pagination, example below.
  • before (Optional [int]) - Used for pagination, example below.

Returns: All player's information.

Return type: List of objects

[
  {
    "id": 34124,
    "name": "Wolvez",
    "rank": 1,
    "score": 4466.7859672865025,
    "nationality": {
      "country_code": "SE",
      "nation": "Sweden",
      "subdivision": null
    }
  }
]

 

id

Type: int               The ID of the player.

 

rank

Type: int               The position of the player in the list.

 

score

Type: float               The number of list points that the player has.

 

Object nationality: contains information about the location of the player

              country_code

               Type: str               ISO country code.

              nation

               Type: str               Nation's name.

              subdivision

               Type: str            Subdivision of the nation.

 

Examples

  • limit
  • from pointercratepy import Client
    
    client = Client()
    
    demons = client.get_demons(limit=3)  # [{....}, {....}, {....}]
    # List of 3 objects containing the top 3
    
    
    # demonlist from march 2021 
    print(demons[0].get("name"))  # Tartarus
    print(demons[1].get("name"))  # The Golden
    print(demons[2].get("name"))  # Zodiac
    

     

  • name - CASE SENSITIVE
  • from pointercratepy import Client
    
    client = Client()
    
    demons = client.get_demons(name="Tartarus")  # [{....}]
    # List with one object containing information about the demon named Tartarus
    
    demons = client.get_demons(name="tartarus")  # [] Empty list 
    

     

  • name_contains - NOT CASE SENSITIVE
  • from pointercratepy import Client
    
    client = Client()
    
    demons = client.get_demons(name_contains="blade")  # [{Edge of the Blade's info}, {Blade of Justice's info}....]
    # List of levels containing "edge" in their name
    
    demons = client.get_demons(name_contains="tartarus")  # [{ "Tartarus's info "}]
    # As you can see, it's not case sensitive so it can be a good alternative to "name"
    

     

  • after | before
  • from pointercratepy import Client
    
    client = Client()
    
    demons = client.get_demons(after=5, before=9)  # [{...}, {...}]
    # Demons which are at position 6, 7 and 8
    
    demons = client.get_demons(limit=100)  # [{...}, {...}, ...] List of top 100 demons
    demons = client.get_demons(limit=100, after=100)  # [{...}, {...}, ...] Demons between top 101 and 200
    

     

  • verifier_id
  • # Kugelblitz's id is 598
    from pointercratepy import Client
    
    client = Client()
    
    demons = client.get_demons(verifier_id=598)  # [{SARY NEVER CLEAR's info}] 
    # List of levels that Kugelblitz has verified
    

     

  • publisher_id
  • # Dolphy's id is 34134
    from pointercratepy import Client
    
    client = Client()
    
    demons = client.get_demons(publisher_id=34134)  # [{Tartarus's info}] 
    # List of levels that Dolphy has uploaded
    

     

  • publisher_name - CASE SENSITIVE
  • from pointercratepy import Client
    
    client = Client()
    
    demons = client.get_demons(publisher_name="ViPriN")  # [{...}, {...}, ...] Contains all levels uploaded by "ViPriN"
    demons = client.get_demons(publisher_name="viprin")  # [{}] No results because it's case sensitive
    

     

  • listed
  • from pointercratepy import Client
    
    client = Client()
    
    demons = client.get_demons(listed=True)  # default value, give the demons ordered by position
    demons = client.get_demons(listed=False)  # give the demons disorderly
    

     

  • nation
  • from pointercratepy import Client
    
    client = Client()
    
    players = client.get_players_ranked(limit=2, nation="FR")  # [{....}, {....}]
    players = client.get_players_ranked(limit=2, nation="France")  # [{....}, {....}]
    # This will give the same results since you can filter both by country code and country name
    # List of 2 objects containing the top 2 french players
    
    # demonlist from june 2022
    print(players[0].get("name"))  # GDonut
    print(players[1].get("name"))  # Boodbdog
    

    Roadmap

    See the open issues for a list of proposed features (and known issues).

    Contributing

    Contributions are what make the open source community such an amazing place to be learned, inspire, and create. Any contributions you make are greatly appreciated.

    1. Fork the Project
    2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
    3. Commit your Changes (git commit -m 'Add some AmazingFeature')
    4. Push to the Branch (git push origin feature/AmazingFeature)
    5. Open a Pull Request

    License

    Distributed under the MIT License. See LICENSE for more information.

    Contact

    Hikudo - @bretheskevin - bretheskevin@gmail.com

    Discord - Hikudo#1714

    Credits

  • Thanks to nekitdev, this is my first API wrapper and his work on gd.py helped me to write de documentation and find a description for the project.
  • Thanks to Nimbus who answered my questions about the REST API of pointercrate.
  • Changelog [day/month/year]

    0.0.1 < 1.0.0 (13/03/2021)

  • Setting up pip
  • First release
  • Method get_demons() : Get information about the demons of pointercrate.
  • 1.0.1 & 1.0.2 (13/03/2021)

  • Documentation correction
  • 1.1.0 (06/30/2022)

  • Method get_players_ranked() : Get information about the ranked players of pointercrate.
  • Simplified the code and changed some grammar
  •  

    Project Link: https://github.com/bretheskevin/pointercrate.py

    Project details


    Download files

    Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

    Source Distribution

    pointercratepy-1.1.0.tar.gz (11.1 kB view details)

    Uploaded Source

    Built Distribution

    If you're not sure about the file name format, learn more about wheel file names.

    pointercratepy-1.1.0-py3-none-any.whl (7.9 kB view details)

    Uploaded Python 3

    File details

    Details for the file pointercratepy-1.1.0.tar.gz.

    File metadata

    • Download URL: pointercratepy-1.1.0.tar.gz
    • Upload date:
    • Size: 11.1 kB
    • Tags: Source
    • Uploaded using Trusted Publishing? No
    • Uploaded via: twine/4.0.1 CPython/3.9.4

    File hashes

    Hashes for pointercratepy-1.1.0.tar.gz
    Algorithm Hash digest
    SHA256 702ff823c56ad52e824b066d6dd0d27d30f0f84ac6b2a206f9011dd41fabed24
    MD5 4420d9b89b7cc2760ca4760bebfb490e
    BLAKE2b-256 e8d7c1322ae39ea66aa8b7160a490cc0b7fede6d8842a5d4896e6d06e58e514b

    See more details on using hashes here.

    File details

    Details for the file pointercratepy-1.1.0-py3-none-any.whl.

    File metadata

    • Download URL: pointercratepy-1.1.0-py3-none-any.whl
    • Upload date:
    • Size: 7.9 kB
    • Tags: Python 3
    • Uploaded using Trusted Publishing? No
    • Uploaded via: twine/4.0.1 CPython/3.9.4

    File hashes

    Hashes for pointercratepy-1.1.0-py3-none-any.whl
    Algorithm Hash digest
    SHA256 c7577e7d2dd42490736e14cf028d5b3d0ae62d48419838606d424cfcbc0f9936
    MD5 efbca8834ecb6e9fb3193d85cfc959e5
    BLAKE2b-256 04217b9d3026fc445094bd1855a10a07be689eb3aba7b0b6533b0bc8e46804cb

    See more details on using hashes here.

    Supported by

    AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page