Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Localization Handling #6

Open
beniutek opened this issue Apr 15, 2018 · 6 comments
Open

Better Localization Handling #6

beniutek opened this issue Apr 15, 2018 · 6 comments

Comments

@beniutek
Copy link

I'm following the process described in the readme
I have obtained keys from splitwise
I have a sample csv file that looks like this:

Transaction Date,Transaction Description,Debit Amount
07/02/2018,TEST1,9.99
26/02/2018,TEST2,9.99

I run the command python groupsplit.py ../test.csv 'Splitwise group name'
Webbrowser opens and wants me to click authorize
I click authorize
I'm redirected to an site that has some xml information

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<versions xmlns="http://docs.openstack.org/identity/api/v2.0">
<version status="stable" updated="2013-03-06T00:00:00Z" id="v3.0">
<media-types>
<media-type base="application/json" type="application/vnd.openstack.identity-v3+json"/>
<media-type base="application/xml" type="application/vnd.openstack.identity-v3+xml"/>
</media-types>
<links>
<link href="http://localhost:5000/v3/" rel="self"/>
</links>
</version>
<version status="stable" updated="2014-04-17T00:00:00Z" id="v2.0">
<media-types>
<media-type base="application/json" type="application/vnd.openstack.identity-v2.0+json"/>
<media-type base="application/xml" type="application/vnd.openstack.identity-v2.0+xml"/>
</media-types>
<links>
<link href="http://localhost:5000/v2.0/" rel="self"/>
<link href="http://docs.openstack.org/api/openstack-identity-service/2.0/content/" type="text/html" rel="describedby"/>
<link href="http://docs.openstack.org/api/openstack-identity-service/2.0/identity-dev-guide-2.0.pdf" type="application/pdf" rel="describedby"/>
</links>
<link href="http://localhost:5000/v2.0/" rel="self"/>
<link href="http://docs.openstack.org/api/openstack-identity-service/2.0/content/" type="text/html" rel="describedby"/>
<link href="http://docs.openstack.org/api/openstack-identity-service/2.0/identity-dev-guide-2.0.pdf" type="application/pdf" rel="describedby"/>
</version>
</versions>

the url is localhost:5000 so this is the callback site but I can't do anything from there. There are no prompts to describe the columns in my csv etc. Have I missed any steps when setting up the app?

@beniutek
Copy link
Author

turns out that all I had to was to change the callback site to 127.0.0.1 (becuase of how my hosts file is configured)
I'm receiving now Invalid OAuth Request now as an error which I assume could be something i can handle

@esecules
Copy link
Owner

Hey thanks for bringing this to my attention. Were you able to grant access to your account to your api key?

@beniutek
Copy link
Author

Yes, I was able to do so. Think that my browsers was cashing some stuff from previous request - when doing that in incognito mode everything started working correctly.
short disclamer - i can read python because i can read english, not because i'm proficient with that particular language.
I do have some other errors - the difference between US and EU date (days and month switched) was kinda obvious one (I assume all it took for the program to read EU formatted dates was to change the line in method self.transactions to be days/months/years right?), but then I can't seem to upload any of the transactions from my csv file.
When I get to the method self.ask_for_splits() i see that self.self.transactions is an empty array although I have several rows in the csv file. I see that we are passing self all around so I assume that is a python thing to do, but it seems like maybe the scope is not being preserved?

@beniutek
Copy link
Author

okay so I have found the reason behind that missing self.transactions
it was if float(r[self.csv.amount_col]) < 0: in make transactions, in my csv file all values are positive floats, and as far as I understand, you program assumes negative floats. phew!

@esecules
Copy link
Owner

to solve the date issue and skipping positive amounts I could create a config file or add it to the first use questionnaire thing. But in the mean time you're always welcome to submit a PR.

I created this program to take my bank statement csv files as an input and ask me which of these transactions I wanted to split with a predefined group so I naturally wanted to skip over any deposits and only ask about debit transactions.

I don't think theres a bug here. Filing under enhancements.

@esecules esecules changed the title No response after starting the application? Better Localization Handling Apr 16, 2018
@beniutek
Copy link
Author

Yeah there are no bugs on the code, problems I've had was either the environment (server running on different url than the callback one) or data problems (csv had different date formats and values were positive or negative). This issue can be closed. btw, thanks for opensourcing your program, it helps a lot! (i might be inclined to work on this one to make it a configuration thing, will let you know once I've submitted a PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants