Skip to main content

a lite python wrapper for habitica api

Project description

habil

a lite wrapper for habitica api

currently, it does not support any community features

requirements

requests

examples

setting up a client

method 1: using username and password

from habil import HabiClient

client = HabiClient.login(
    username="xxxxxxxxxxxxx",
    password="`xxxxxxxxxxxxxx"
)

get tasks

method 1

for task in client.tasks:
    print(task)

"""
HabiHabit(a2e4ab47-6eb0-44f9-90f2-e9fecfb93d8d)
HabiHabit(9e3f908c-5c66-45b0-8a56-9873356f13e2)
HabiDaily(336ba8f2-948e-4d14-ab8d-87b61c7034be)
HabiDaily(ed1d2801-2676-440a-b967-7c6284d9d117)
HabiDaily(a428340d-a035-4008-b8d1-5f5c246a9b82)
HabiTodo(d98ca9fb-c8a4-4b79-a9bc-2c08aecede61)
HabiTodo(8735fc9e-803c-480e-8ddb-351b74fe56bf)
HabiReward(cea84120-a3a4-4da8-a8a7-fbf0438fe37e)
"""

update stats

-1 hp in exchange for 1 gold

# assuming current hp 50 and gold 0
stats = client.stats.update(gold=1, hp=-1)
# expected hp 49 and gold 1

get tags

for tag in client.tags:
    print(tag.name)

"""
Work
Exercise
Health + Wellness
School
Teams
Chores
Creativity

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

habil-0.1.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

habil-0.1.0-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file habil-0.1.0.tar.gz.

File metadata

  • Download URL: habil-0.1.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.2

File hashes

Hashes for habil-0.1.0.tar.gz
Algorithm Hash digest
SHA256 552b246339f53dcc31ce8fc0192852ddf8f4b35ef518c185df118a396943f256
MD5 60e97525442b820d64abd55f29ba5031
BLAKE2b-256 ebf3756d6a9a44e200cbde481e66782b97c1491622f8a307b1d0cda4e66025dc

See more details on using hashes here.

File details

Details for the file habil-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: habil-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.2

File hashes

Hashes for habil-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4683a850f2086b21096687a14df3c31960ef2164e81286db98a20faf73b5670c
MD5 82806b5f5e4cc00f674b653a15e6e167
BLAKE2b-256 ad8f2cae5f3b8d9eb5eccd610706afb73c545bcf9447ab2edc59323b07e6df52

See more details on using hashes here.

Supported by

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