Skip to content

deadend-g4mes/PyUp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyUp

a Python Library for easy usage of the LifeUp API.

Table of Contents

Getting Started

installing the package

Install the PyUp library using the follow command.

  pip install PyUp-LifeUp-API

You will also need to install requests since the requirements.txt isn't working currently.

pip install requests

Setup

Once pip finishes installing the PyUp Library, initialize the PyUp API like so

The PyUp class will be used as the basis for all API interactions. You can add the other modules by adding , module-name after from pyup import PyUp.

for a more in-depth understand of the API, check it the official LifeUp API documentation.

General Class

The General class is a class of the pyup library that focuses on the most basic LifeUp API interactions.

from pyup import PyUp, General

pyup = PyUp('host_ip', 'port')
up_gen = General(pyup)

General.toast

a method for sending custom pop-up messages to the LifeUp API

returns request.Response

---code example---

from pyup import PyUp, General

pyup = PyUp('host_ip', 'port')
up_gen = General(pyup)

popup_result = up_gen.toast(text='example text')

---parameters---

text

the message that appears on the prompt.
str

(optional) type

a number from 0-6 defining the text style.
str

(optional) isLong

display duration, True = long, False = short.
str

General.reward

a method for sending a custom reward to the LifeUp API

returns request.Response

---code example---

from pyup import PyUp, General

pyup = PyUp('host_ip', 'port')
up_gen = General(pyup)

reward_result = up_gen.reward(content='example text', type='coin', number=10)

---parameters---

content

text that appears on the reward notification
str

type

reward type (must be either 'coin', 'exp' or 'item').
str

number

amount of reward given.
int

(optional) skills

array of numbers greater than 0. dicates what skills recieve the exp reward.
list

(optional) item_id

the numerical id of the item the user recieves as a reward.
int

(optional) item_name

the name of the item the user recieves as a reward.
str

(optional) silent

wether the UI notification appears or not.
bool

General.penalty

a method for sending a custom Penalty to the LifeUp API

returns request.Response

---code example---

from pyup import PyUp, General

pyup = PyUp('host_ip', 'port')
up_gen = General(pyup)
popup_result = up_gen.penality(content='example text', type='coin', number=10)

---parameters---

content

text that appears on the penalty notification
str

type

penality type (must be either 'coin', 'exp' or 'item').
str

number

amount of penality taken.
int

(optional) skills

array of numbers greater than 0. dicates what skills recieve the exp penality.
list

(optional) item_id

the numerical id of the item the user recieves as a penality.
int

(optional) item_name

the name of the item the user recieves as a penality.
str

(optional) silent

wether the UI notification appears or not.
bool

Task Class

The Task class is a class of the pyup library that focuses on task related API calls for the LifeUp API.

from pyup import PyUp, Task

pyup = PyUp('host_ip', 'port')
up_task = Task(pyup)

Task.add_task

description

returns request.Response

---code example---

from pyup import PyUp, Task

pyup = PyUp('host_ip', 'port')
up_task = Task(pyup)

up_task.add_task()

---parameters--

Task.complete_task

description

returns request.Response

---code example---

from pyup import PyUp, Task

pyup = PyUp('host_ip', 'port')
up_task = Task(pyup)

up_task.complete_task()

---parameters--

Task.give_up_task

description

returns request.Response

---code example---

from pyup import PyUp, Task

pyup = PyUp('host_ip', 'port')
up_task = Task(pyup)

up_task.give_up_task()

---parameters--

Task.freeze_task

description

returns request.Response

---code example---

from pyup import PyUp, Task

pyup = PyUp('host_ip', 'port')
up_task = Task(pyup)

up_task.freeze_task()

---parameters--

Task.unfreeze_task

description

returns request.Response

---code example---

from pyup import PyUp, Task

pyup = PyUp('host_ip', 'port')
up_task = Task(pyup)

up_task.unfreeze_task()

---parameters--

Task.delete_task

description

returns request.Response

---code example---

from pyup import PyUp, Task

pyup = PyUp('host_ip', 'port')
up_task = Task(pyup)

up_task.delete_task()

---parameters--

Shop Class

The Shop class is a class of the pyup library that focuses on shop related API calls for the LifeUp API.

from pyup import PyUp, Shop

pyup = PyUp('host_ip', 'port')
up_shop = Shop(pyup)

Shop.add_item

description

returns request.Response

---code example---

from pyup import PyUp, Shop

pyup = PyUp('host_ip', 'port')
up_shop = Shop(pyup)

up_shop.add_item()

---parameters---

Shop.edit_item

description

returns request.Response

---code example---

from pyup import PyUp, Shop

pyup = PyUp('host_ip', 'port')
up_shop = Shop(pyup)

up_shop.edit_item()

---parameters---

Shop.use_item

description

returns request.Response

---code example---

from pyup import PyUp, Shop

pyup = PyUp('host_ip', 'port')
up_shop = Shop(pyup)

up_shop.use_item()

---parameters---

Shop.edit_loot_box

description

returns request.Response

---code example---

from pyup import PyUp, Shop

pyup = PyUp('host_ip', 'port')
up_shop = Shop(pyup)

up_shop.edit_loot_box()

---parameters---

ATM Class

The ATM class is a class of the pyup library that focuses on ATM related API calls for the LifeUp API.

from pyup import PyUp, ATM

pyup = PyUp('host_ip', 'port')
up_atm = ATM(pyup)

ATM.deposit

description

returns request.Response

---code example---

from pyup import PyUp, ATM

pyup = PyUp('host_ip', 'port')
up_atm = ATM(pyup)

up_atm.deposit()

---parameters---

ATM.withdraw

description

returns request.Response

---code example---

from pyup import PyUp, ATM

pyup = PyUp('host_ip', 'port')
up_atm = ATM(pyup)

up_atm.withdraw()

---parameters---

Pomodoro Class

The Pomodoro class is a class of the pyup library that focuses on Pomodoro related API calls for the LifeUp API.

from pyup import PyUp, Pomodoro

pyup = PyUp('host_ip', 'port')
up_pomo = Pomodoro(pyup)

Pomodoro.add_record

description

returns request.Response

---code example---

from pyup import PyUp, Pomodoro

pyup = PyUp('host_ip', 'port')
up_pomo = Pomodoro(pyup)

up_pomo.add_record()

---parameters---

Pomodoro.edit_pomodoro

description

returns request.Response

---code example---

from pyup import PyUp, Pomodoro

pyup = PyUp('host_ip', 'port')
up_pomo = Pomodoro(pyup)

up_pomo.edit_pomodoro()

---parameters---

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages