philadams-zz / habitica Goto Github PK
View Code? Open in Web Editor NEWCommand-line interface to HabitRPG
License: MIT License
Command-line interface to HabitRPG
License: MIT License
Getting this error
0:44: execution error: "https://habitica.com/#/tasks" doesn’t understand the “open location” message. (-1708)
70:78: execution error: Can’t get application "firefox". (-1728)
Having seen this in a couple commandline tools (and a couple that are significantly more frequently maintained than my little Habitica wrapper), I suspect this is due to a change in the OS and/or underlying Python libs. Will investigate.
Because sometimes a procrastinated task is really hurting me, and I need to get on it, but by default in hrpg
there's no visible difference between a just added task and a really really overdue one.
Responce data isn't returned after POST
requests, because it is documented wrong in the Habitica's apidoc. See HabitRPG/habitica#8865
Please consider merging #51 .
For example hrpg todos add learn more about the yotaphone
is better than hrpg todos add 'learn more about the yotaphone'
.
Probably just some docopt flag.
The error is:
habitica status
Traceback (most recent call last):
File "/usr/bin/habitica", line 13, in <module>
habitica.cli()
File "/usr/lib/python3.6/site-packages/habitica/core.py", line 320, in cli
clct = content['quests'][quest_key][qt].values()[0]
TypeError: 'dict_values' object does not support indexing
Hi Phil,
I use checklists a lot with habitica so it'd be really useful to have this CLI for it support them.
I've actually already developed this feature and will be posting a pull request for it soon.
Is that something you'd be interested in accepting?
Thanks,
Rob
I ~/.config/habitica habitica --debug status 3359ms
DEBUG:root:Command line args: {'--version': 'False', '--help': 'False', '<command>': 'status', '<args>': '[]', '--difficulty': 'easy', '--verbose': 'False', '--debug': 'True', '--checklists': 'False'}
DEBUG:root:Loading habitica auth data from /home/pancake/.config/habitica/auth.cfg
DEBUG:root:Loading cached config data (/home/pancake/.config/habitica/cache.cfg)...
DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): habitica.com
DEBUG:requests.packages.urllib3.connectionpool:https://habitica.com:443 "GET /api/v3/user HTTP/1.1" 200 None
DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): habitica.com
DEBUG:requests.packages.urllib3.connectionpool:https://habitica.com:443 "GET /api/v3/groups?type=party HTTP/1.1" 200 206
DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): habitica.com
DEBUG:requests.packages.urllib3.connectionpool:https://habitica.com:443 "GET /api/v3/groups/523d2eb1-9944-4286-a9a5-c4493fbe0a0e HTTP/1.1" 200 None
INFO:root:Updating quest information...
DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): habitica.com
DEBUG:requests.packages.urllib3.connectionpool:https://habitica.com:443 "GET /api/v3/content HTTP/1.1" 200 None
DEBUG:root: On a boss/hp type of quest
DEBUG:root:Updating (and caching) config data (/home/pancake/.config/habitica/cache.cfg)...
DEBUG:root:Loading cached config data (/home/pancake/.config/habitica/cache.cfg)...
Traceback (most recent call last):
File "/home/pancake/.local/bin/habitica", line 13, in <module>
habitica.cli()
File "/home/pancake/.local/lib/python3.6/site-packages/habitica/core.py", line 335, in cli
quest_title=str(quest_title))
File "/home/pancake/.local/lib/python3.6/site-packages/habitica/core.py", line 115, in update_quest_cache
cache.write(f)
File "/usr/lib/python3.6/configparser.py", line 916, in write
self._defaults.items(), d)
File "/usr/lib/python3.6/configparser.py", line 923, in _write_section
fp.write("[{}]\n".format(section_name))
TypeError: a bytes-like object is required, not 'str'
It would be great if you could add attributes to tasks when you create them for task-based allocation: http://habitica.wikia.com/wiki/Task_Attributes
Consider:
Fresh install on OSX using sudo pip install habitica
and a configured auth.cfg.
These commands work:
All other commands fail. They fail with the same error. Here's one:
`
$ habitica --debug status
DEBUG:root:Command line args: {'': '[]', '--checklists': 'False', '--verbose': 'False', '--difficulty': 'easy', '--debug': 'True', '': 'status', '--version': 'False', '--help': 'False'}
DEBUG:root:Loading habitica auth data from /Users/jkeroes/.config/habitica/auth.cfg
DEBUG:root:Loading cached config data (/Users/jkeroes/.config/habitica/cache.cfg)...
INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): habitica.com
DEBUG:requests.packages.urllib3.connectionpool:"GET /api/v3/user HTTP/1.1" 200 2457
Traceback (most recent call last):
File "/usr/local/bin/habitica", line 13, in
habitica.cli()
File "/Library/Python/2.7/site-packages/habitica/core.py", line 286, in cli
user = hbt.user()
File "/Library/Python/2.7/site-packages/habitica/api.py", line 82, in call
return res.json()["data"]
TypeError: 'dict' object is not callable
`
When running `habitica status' on, say, a Monday, I get ALL my dailies, even if they don't need to be done that day. i.e. on a Monday I'll be seeing sunday's tasks along with monday's tasks.
Hi,
It would be nice if we can import tasks from a text file containing something such as:
+ Gimnasio [médium]
+ Hice una nota con las cosas buenas del día [easy]
+/- Llegué a tiempo / Tarde [hard]
What do you think?
Thanks in advance!
When I write habitica server, I get a good response. However, when I try to see my status, I get this error
Traceback (most recent call last):
File "/usr/local/bin/habitica", line 13, in
habitica.cli()
File "/usr/local/lib/python2.7/dist-packages/habitica/core.py", line 279, in cli
quest_progress = qp_tmp.values()[0]['count']
TypeError: 'int' object has no attribute 'getitem'
I created the auth.cfg file where it has to be and completed the fields. Any of what is happening?
when using python3, print_task_list
makes for ugliness.
$ habitica dailies
[ ] 1 b'[x] Meh'
which comes from task['text'].encode('utf8')
. we could use task['text'].encode('utf8').decode()
, but that seems terrible. I'm not even entirely convinced by 1b4f7b2, but my python is really rusty.
Hey,
I'm currently trying to use your Python wrapper to create a Python utility that can sync between Todoist and Habitica, but the API update issue means that the master copy won't work as is. While I'm developing it, I don't have an issue using syntacktic's version with the API update (see the pull request), but it'd be awesome if by the time I finish this thing I can direct people straight to pip install habitica for the API wrapper and then whatever I wind up naming the syncer program. I think it'd be simpler. I know it's been a super short timeframe and not sure if this project is being very tightly monitored at this time, but I wanted to let you know before I did anything.
Otherwise, how would you like me to cite your work when I finish my project? I'll default to linking your work here, obviously, with all attribution attached.
Cheers,
Erin
Whether downloading from this Github for "bleeding edge", or downloading simply using pip install, I'm kicked back by the Habitica API because supposedly this uses version 2. Am I correct in saying the program is currently non-functional? I don't see a ticket simply expressing this, so am creating this -- apologies if I am somehow duplicating or cluttering.
On my selfhosted habitica installation I get :
Traceback (most recent call last):
File "/home/arthur/.virtualenvs/habitica/bin/habitica", line 6, in <module>
exec(compile(open(__file__).read(), __file__, 'exec'))
File "/home/arthur/local/habitica/bin/habitica", line 13, in <module>
habitica.cli()
File "/home/arthur/local/habitica/habitica/core.py", line 188, in cli
if party['quest'] and party['quest']['active']:
TypeError: 'NoneType' object has no attribute '__getitem__'
maybe it's because I'm using an "older" version of the API or that I have no active quest ? I'm running habitica v1.1.0
We're looking for Habitica developers to try out the upcoming version 3 of the API. We are hoping that we will be ready to start testing within the next two weeks, but we're collecting testers now so that we can hit the ground running. Thanks very much for considering it, and feel free to let me know if you have any questions!
Sign Up! |
---|
I ran into an installation issue here:
! Installing the dependencies failed: Module 'Method::Signatures' is not installed, Module 'JSON::XS::Boolean' is not installed
! Bailing out the installation for WebService-HabitRPG-0.22.
21 distributions installed
And I think this is why I'm unable to actually run "hrpg" from the command line. Here's what I've got:
Malformed config file at ~/.hrpgrc
Traceback (most recent call last):
File "//anaconda/bin/hrpg", line 13, in
hrpg.cli()
File "//anaconda/lib/python2.7/site-packages/hrpg/core.py", line 133, in cli
config = load_config(CONFIG_FILE)
File "//anaconda/lib/python2.7/site-packages/hrpg/core.py", line 44, in load_config
raise ValueError(err.msg)
AttributeError: 'exceptions.ValueError' object has no attribute 'msg'
The "habits", "todos" and "dailies" commands accurately report my tasks:
XX:~ yyy$ habitica habits
[] 1 stay off internet till 9
[] 2 stay off internet till 10
[****] 3 stay off internet till 11
[...]
But when I try to execute "status":
XX:~ yyy$ habitica status
Traceback (most recent call last):
File "/usr/local/bin/habitica", line 13, in
habitica.cli()
File "/usr/local/lib/python2.7/site-packages/habitica/core.py", line 281, in cli
party = hbt.groups.party()
File "/usr/local/lib/python2.7/site-packages/habitica/api.py", line 84, in call
res.raise_for_status()
File "/usr/local/lib/python2.7/site-packages/requests/models.py", line 862, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://habitica.com/api/v3/groups/party
That was when I was not in a party. Now I try it again after forming a party of one:
Health: 50/50
XP: 199/740
Mana: 3/72
Pet: Dragon-Golden (0 food items)
Mount: Dragon-Ghost
Quest: Not currently on a quest
In the output of habitica status
:
Party: Not currently in a party
While I am currently in a party of 4.
Hey Phil,
Thanks for getting all those PRs merged and mine tidied up.
The next thing I'd like to add would be editing checklists. Probably just adding new ones and checking off existing ones.
Here's the commands I was thinking of adding:
check t <task-id> Show a single todo and its full checklist
check t <task-id> <ids> Check off the provided items within a single todo
check t <task-id> <name> Add a checklist item to a single todo with the provided name
check d <task-id> Show a single daily and its full checklist
check d <task-id> <ids> Check off the provided items within a single daily
check d <task-id> <name> Add a checklist item to a single daily with the provided name
also I'd try to add this as a separate module instead of cramming it into core. partly because i don't want to clutter core and also because i prefer to GPL my code and this way I can just apply it to the checklist module.
Does all this sound alright?
Thanks,
Robert
Thank you for creating this - I have a lot of uses in mind, but I am struggling to configure on a windows box. I have tried to find the solution, but have so far failed.
I have installed it successfully with pip install habitica, but I don't know where to save the auth.cfg file and I cannot find the auth.cfg.sample file.
Any guidance would be much appreciated, thank you.
$ hrpg status
Traceback (most recent call last):
File "/usr/bin/hrpg", line 13, in <module>
hrpg.cli()
File "/usr/lib/python2.6/site-packages/hrpg/core.py", line 164, in cli
quest = party['quest']['key']
KeyError: 'key'
Traceback (most recent call last):
File "/usr/bin/hrpg", line 13, in <module>
hrpg.cli()
File "/usr/lib/python2.6/site-packages/hrpg/core.py", line 171, in cli
pet = '%s (%d food items)' % (items['currentPet'], food_count)
KeyError: 'currentPet'
Traceback (most recent call last):
File "/usr/bin/hrpg", line 13, in <module>
hrpg.cli()
File "/usr/lib/python2.6/site-packages/hrpg/core.py", line 173, in cli
mount = items['currentMount']
KeyError: 'currentMount'
All of these are occurring with a new character. This character doesn't have a party quest, pet, or mount.
Traceback (most recent call last):
File "/Users/philadams/homebrew/bin/habitica", line 13, in <module>
habitica.cli()
File "/Users/philadams/homebrew/lib/python2.7/site-packages/habitica/core.py", line 331, in cli
quest_progress = qp_tmp.values()[0]['count']
TypeError: 'int' object has no attribute '__getitem__'
Now it looks like this:
habitica habits
[*****] 1 b'\xd0\x9f\xd1\x80\xd0\xbe\xd1\x85\xd0\xbe\xd0\xb4\xd0\xb8\xd1\x82\xd1\x8c \xd0\xbd\xd0\xb5 \xd0\xbc\xd0\xb5\xd0\xbd\xd0\xb5\xd0\xb5 10000 \xd1\x88\xd0\xb0\xd0\xb3\xd0\xbe\xd0\xb2'
[*****] 2 b'\xd0\x9d\xd0\xb5 \xd0\xb5\xd1\x81\xd1\x82\xd1\x8c \xd0\xbf\xd0\xbe \xd0\xbd\xd0\xbe\xd1\x87\xd0\xb0\xd0\xbc'
[****] 3 b'\xd0\x9f\xd0\xbb\xd0\xbe\xd0\xb4\xd0\xbe\xd1\x82\xd0\xb2\xd0\xbe\xd1\x80\xd0\xbd\xd0\xb0\xd1\x8f \xd1\x80\xd0\xb0\xd0\xb1\xd0\xbe\xd1\x82\xd0\xb0 (\xd0\xbd\xd0\xb0\xd0\xb6\xd0\xbc\xd0\xb8\xd1\x82\xd0\xb5 \xd0\xb7\xd0\xbd\xd0\xb0\xd1\x87\xd0\xbe\xd0\xba \xd0\xba\xd0\xb0\xd1\x80\xd0\xb0\xd0\xbd\xd0\xb4\xd0\xb0\xd1\x88\xd0\xb0 \xd0\xb4\xd0\xbb\xd1\x8f \xd0\xbf\xd1\x80\xd0\xb0\xd0\xb2\xd0\xba\xd0\xb8)'
[****] 4 b'\xd0\x9d\xd0\xb5\xd0\xb7\xd0\xb4\xd0\xbe\xd1\x80\xd0\xbe\xd0\xb2\xd0\xbe\xd0\xb5 \xd0\xbf\xd0\xb8\xd1\x82\xd0\xb0\xd0\xbd\xd0\xb8\xd0\xb5 (\xd0\xbd\xd0\xb0\xd0\xb6\xd0\xbc\xd0\xb8\xd1\x82\xd0\xb5 \xd0\xb7\xd0\xbd\xd0\xb0\xd1\x87\xd0\xbe\xd0\xba \xd0\xba\xd0\xb0\xd1\x80\xd0\xb0\xd0\xbd\xd0\xb4\xd0\xb0\xd1\x88\xd0\xb0 \xd0\xb4\xd0\xbb\xd1\x8f \xd0\xbf\xd1\x80\xd0\xb0\xd0\xb2\xd0\xba\xd0\xb8)'
[****] 5 b'\xd0\x92\xd0\xbe\xd1\x81\xd0\xbf\xd0\xbe\xd0\xbb\xd1\x8c\xd0\xb7\xd0\xbe\xd0\xb2\xd0\xb0\xd1\x82\xd1\x8c\xd1\x81\xd1\x8f \xd0\xbb\xd0\xb5\xd1\x81\xd1\x82\xd0\xbd\xd0\xb8\xd1\x86\xd0\xb5\xd0\xb9/\xd0\xbb\xd0\xb8\xd1\x84\xd1\x82\xd0\xbe\xd0\xbc (\xd0\xbd\xd0\xb0\xd0\xb6\xd0\xbc\xd0\xb8\xd1\x82\xd0\xb5 \xd0\xb7\xd0\xbd\xd0\xb0\xd1\x87\xd0\xbe\xd0\xba \xd0\xba\xd0\xb0\xd1\x80\xd0\xb0\xd0\xbd\xd0\xb4\xd0\xb0\xd1\x88\xd0\xb0 \xd0\xb4\xd0\xbb\xd1\x8f \xd0\xbf\xd1\x80\xd0\xb0\xd0\xb2\xd0\xba\xd0\xb8)'
Whereas it should output something like this:
habitica habits
[*****] 1 Проходить не менее 10000 шагов
[*****] 2 Не есть по ночам
[****] 3 Плодотворная работа (нажмите значок карандаша для правки)
[****] 4 Нездоровое питание (нажмите значок карандаша для правки)
[****] 5 Воспользоваться лестницей/лифтом (нажмите значок карандаша для правки)
It could be solved, I think, using one .decode("utf-8")
.
Other functions (dailies and todos) aren't affected by this bug.
So you don't have to say hrpg todos done 1
a zillion times. Instead you can say hrpg todos done 1,4,7-11,14
.
https://habitica.com is hard wired in the code. It would be nice to be able to use this tool with self hosted habitica installations.
Places the URL is hard wired:
For example, if ~/netrc
is missing, or if there's a login problem.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.