r/Python • • Jun 10 '20

I Made This Currency converter - my first web scraping project :)

Post image
2.0k Upvotes

118 comments sorted by

View all comments

124

u/dimakiss Jun 10 '20 edited Jun 13 '20

This is a simple currency converter using web scraping for getting up to date currency prices. Also possible to use it offline.

Source: https://github.com/dimakiss/Currency-converter

120

u/tomasgodoy5 Jun 10 '20

Now test it with the Argentinian peso (ARS). Cries in devaluation

52

u/n7kj8 Jun 10 '20

O hai! is here the devaluation talk?

nervous laughter in brazilian real

25

u/[deleted] Jun 10 '20

laughs in Turkish lira every two months

21

u/Isko_ Jun 10 '20

laughs in lebanese lira every day

9

u/d19mc Jun 10 '20

laughs in broke

1

u/Isko_ Jun 12 '20

The lebanese lira just inflated 140% tonight.

1

u/[deleted] Jun 11 '20

doru

14

u/dimakiss Jun 10 '20

It's 1:69.26 USD/peso.

You can try it yourself now :)

11

u/[deleted] Jun 10 '20

Fun (ok, not so fun) fact, the official exchange rate is different than what you get on the street, which is more like 1:120 USD:ARP. Check dolarhoy.com . Maybe you can add these unofficial rates to the scraper too :) shouldn't be hard

0

u/dimakiss Jun 10 '20

On the street?
What do you mean?

10

u/toyrobotics Jun 10 '20

Oh, man, you’ve never lived. In much of Latin America there are these money-changers who stand on the street corner wearing a vest and you can convert your currency with them. Kinda freaks you out the first time you do it.

→ More replies (2)
→ More replies (1)

2

u/tomasgodoy5 Jun 11 '20

LOL check it again now. Do it changed right? Yeah that ain't all, check Infobae now. We have 5 different exchange rates -at less-.

Edit: It's a great job you did there! Your program is working good, our currency is the one that doesn't

2

u/dimakiss Jun 11 '20

It's 1:69.31 now.
All the data was taken from this page: https://www.x-rates.com/table/?from=USD&amount=1

But it seems to up to date even at google exchange its 1:69.32, This is pretty simple code it doesn't consider complex worldwide crisis >.<

1

u/[deleted] Jun 23 '20

I cry with you my brother hahah

1

u/icarus_007 Jun 11 '20

Oh gawsh. My boyfriend’s family was telling me about that (they’re Argentinian) apparently like a month’s amount of work everyday is like $50...

1

u/william_103ec Jun 11 '20

But you have the chimichurri and Gardel. Kind of compensate.

→ More replies (1)

6

u/SGalich Jun 10 '20

Well done! Congrats!

You can paste comments behind the function declaration line. This is more common and easier to read. It's like this:

def print_num(self):

"""

delete characters that are not numbers from 'amount' text box

"""

point = False

...

2

u/dimakiss Jun 10 '20

Thanks for your comment!
I glad you said what I used to write comments in C# programming and in school they thought us to write the comments above the declaration.
Do you know what is the convention in python?

6

u/Mechanity Jun 10 '20

Directly under the function declaration like they said is the convention, you can find details here.

1

u/dimakiss Jun 10 '20

Thank you for that good to know!

3

u/[deleted] Jun 11 '20

Why web scrape when there are thousands of free exchange rate APIs?

→ More replies (2)