项目作者: skhg

项目描述 :
📱 Unofficial Python API for accessing your PremiumSIM.de account balance & usage stats
高级语言: HTML
项目地址: git://github.com/skhg/pyPremiumSIM.git
创建时间: 2020-10-04T18:39:43Z
项目社区:https://github.com/skhg/pyPremiumSIM

开源协议:MIT License

下载


pyPremiumSIM

PyPI Codecov PyPI - Downloads

A Python API for accessing your PremiumSIM.de account balance & usage stats. This is an unoffical API and the author/contributors are in no way connected to PremiumSIM or Drillisch. The API provides a method to:

  • Get your current month’s data balances (consumed and remaining GB)

Installation

pip install pypremiumsim

Usage

It’s very easy to use. Try the following to get your balance data:

  1. from pypremiumsim import *
  2. from pprint import pprint
  3. session = PremiumSimSession()
  4. session.try_login("<username>", "<password>")
  5. data_used = session.current_month_data_usage()
  6. pprint(vars(data_used))

returns:

  1. {'consumed_data_gb': 0.73585937,
  2. 'tariff_total_data_gb': 20.0,
  3. 'used_percentage': 3.7}

Tests

python ./tests/tests.py

Contributing

Fork this repo, make some changes and create a new pull request!