Инструмент делает запрос к ExchangeRate API и показывает актуальный курс USD к RUB — без заморочек и регистрации.
💡 Что умеет: 🟢Получает свежий курс валют (USD → RUB); 🟢Обрабатывает ошибки (если вдруг интернет решит умереть); 🟢Подходит как база для телеграм-бота или финансового дашборда; 🟢Конечно можно адаптировать под разные, мировые валюты.
🚀 Запускаешь — и сразу знаешь курс. Прямо в терминале.
import requests from typing import Optional
def get_exchange_rate(base_currency: str, target_currency: str) -> Optional[float]: """ Получает курс обмена из base_currency в target_currency.
:param base_currency: Базовая валюта (например, 'USD'). :param target_currency: Целевая валюта (например, 'RUB'). :return: Курс обмена или None в случае ошибки. """ url = f"https://open.er-api.com/v6/latest/{base_currency}" try: response = requests.get(url, timeout=10) response.raise_for_status() data = response.json() rate = data["rates"].get(target_currency) if rate is None: print(f"Курс для {target_currency} не найден.") return None return rate except requests.RequestException as e: print(f"Ошибка при запросе к API: {e}") return None
if __name__ == "__main__": base = "USD" target = "RUB" rate = get_exchange_rate(base, target) if rate: print(f"Курс {base} к {target}: {rate}") else: print("Не удалось получить курс обмена.")
# Курс USD к RUB: 80.926191
👨💻 Подходит для автоматизации, личных проектов или просто чтобы каждый день знать, пора ли покупать iPhone или подождать.
📂 Код уже готов — бери, дорабатывай, засовывай в своего ассистента.
Инструмент делает запрос к ExchangeRate API и показывает актуальный курс USD к RUB — без заморочек и регистрации.
💡 Что умеет: 🟢Получает свежий курс валют (USD → RUB); 🟢Обрабатывает ошибки (если вдруг интернет решит умереть); 🟢Подходит как база для телеграм-бота или финансового дашборда; 🟢Конечно можно адаптировать под разные, мировые валюты.
🚀 Запускаешь — и сразу знаешь курс. Прямо в терминале.
import requests from typing import Optional
def get_exchange_rate(base_currency: str, target_currency: str) -> Optional[float]: """ Получает курс обмена из base_currency в target_currency.
:param base_currency: Базовая валюта (например, 'USD'). :param target_currency: Целевая валюта (например, 'RUB'). :return: Курс обмена или None в случае ошибки. """ url = f"https://open.er-api.com/v6/latest/{base_currency}" try: response = requests.get(url, timeout=10) response.raise_for_status() data = response.json() rate = data["rates"].get(target_currency) if rate is None: print(f"Курс для {target_currency} не найден.") return None return rate except requests.RequestException as e: print(f"Ошибка при запросе к API: {e}") return None
if __name__ == "__main__": base = "USD" target = "RUB" rate = get_exchange_rate(base, target) if rate: print(f"Курс {base} к {target}: {rate}") else: print("Не удалось получить курс обмена.")
# Курс USD к RUB: 80.926191
👨💻 Подходит для автоматизации, личных проектов или просто чтобы каждый день знать, пора ли покупать iPhone или подождать.
📂 Код уже готов — бери, дорабатывай, засовывай в своего ассистента.
Telegram hopes to raise $1bn with a convertible bond private placement
The super secure UAE-based Telegram messenger service, developed by Russian-born software icon Pavel Durov, is looking to raise $1bn through a bond placement to a limited number of investors from Russia, Europe, Asia and the Middle East, the Kommersant daily reported citing unnamed sources on February 18, 2021.The issue reportedly comprises exchange bonds that could be converted into equity in the messaging service that is currently 100% owned by Durov and his brother Nikolai.Kommersant reports that the price of the conversion would be at a 10% discount to a potential IPO should it happen within five years.The minimum bond placement is said to be set at $50mn, but could be lowered to $10mn. Five-year bonds could carry an annual coupon of 7-8%.
What Is Bitcoin?
Bitcoin is a decentralized digital currency that you can buy, sell and exchange directly, without an intermediary like a bank. Bitcoin’s creator, Satoshi Nakamoto, originally described the need for “an electronic payment system based on cryptographic proof instead of trust.” Each and every Bitcoin transaction that’s ever been made exists on a public ledger accessible to everyone, making transactions hard to reverse and difficult to fake. That’s by design: Core to their decentralized nature, Bitcoins aren’t backed by the government or any issuing institution, and there’s nothing to guarantee their value besides the proof baked in the heart of the system. “The reason why it’s worth money is simply because we, as people, decided it has value—same as gold,” says Anton Mozgovoy, co-founder & CEO of digital financial service company Holyheld.