Skip to content

neverlosecc/api-wrapper

Repository files navigation

Contributors Forks Stargazers Issues PyPi


Logo

Neverlose.cc web API wrapper

Table of Contents

Getting Started

Prerequisites

First of all you need to install:

  • python3
sudo apt-get install python3-pip

Installation

  1. Install from pip
sudo pip3 install neverlose

Usage

from neverlose import Client
from neverlose.models.events import BalanceTransfer
from neverlose.models.events import ItemPurchase


app = Client(
  secret='my_secret', # Can be found on https://neverlose.cc/market/api
  user_id=739 # Can be found on https://neverlose.cc/market/api
)


@app.on_item_purchase()
async def my_purchase_handler(data: ItemPurchase):
    print(f'{data.username} just bought {data.item_id}')


@app.on_balance_transfer()
async def my_balance_transfer_handler(data: BalanceTransfer):
    print(f'{data.username} ty for {data.amount}')


if __name__ == '__main__':
    app.transfer_money(1.0, 'soufivw')
    app.give_market_item('soufivw', 'IS6raE')
    app.run_web()

Contributing

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.md for more information.

Contact

Arsenii Esenin - me@es3n.in

Project Link: https://github.com/neverlosecc/api-wrapper