Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Library that provides its users ability to interact with the REST API of pointercrate.
https://github.com/bretheskevin/pointercrate.py

api api-client geometry-dash python python3

Last synced: 29 days ago
JSON representation

Library that provides its users ability to interact with the REST API of pointercrate.

Awesome Lists containing this project

README

        

[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]





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

* [Python 3.9](https://www.python.org/)

## Getting Started

### Installation

#### Windows

```
python -m pip install pointercratepy
```

#### Linux

```shell
python3 -m pip install pointercratepy
```

## Usage

```python
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

```json
[
{
"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

```json
[
{
"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
  • ```python
    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
  • ```python
    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
  • ```python
    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
  • ```python
    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
  • ```python
    # 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
  • ```python
    # 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
  • ```python
    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
  • ```python
    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
  • ```python
    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](https://github.com/bretheskevin/pointercrate.py/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](https://twitter.com/bretheskevin) - [email protected]

    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](https://github.com/bretheskevin/pointercrate.py)

    [contributors-shield]: https://img.shields.io/github/contributors/bretheskevin/pointercrate.py.svg?style=for-the-badge

    [contributors-url]: https://github.com/bretheskevin/pointercrate.py/graphs/contributors

    [forks-shield]: https://img.shields.io/github/forks/bretheskevin/pointercrate.py.svg?style=for-the-badge

    [forks-url]: https://github.com/bretheskevin/pointercrate.py/network/members

    [stars-shield]: https://img.shields.io/github/stars/bretheskevin/pointercrate.py.svg?style=for-the-badge

    [stars-url]: https://github.com/bretheskevin/pointercrate.py/stargazers

    [issues-shield]: https://img.shields.io/github/issues/bretheskevin/pointercrate.py/pointercrate.py.svg?style=for-the-badge

    [issues-url]: https://github.com/bretheskevin/pointercrate.py/issues

    [license-shield]: https://img.shields.io/github/license/bretheskevin/pointercrate.py.svg?style=for-the-badge

    [license-url]: https://github.com/bretheskevin/pointercrate.py/blob/master/LICENSE

    [linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555

    [linkedin-url]: https://www.linkedin.com/in/bretheskevin