예제 #1
0
    parser.add_argument('--guid', help='some guid')
    parser.add_argument('--dev_user_agent',
                        default='Android',
                        help='application user agent')
    parser.add_argument('--dev_app_version', help='application version')

    parser.add_argument('--login',
                        help='your login (phone number: 7xxxxxxxxxx)')
    parser.add_argument('--pwd', help='your password')

    args = parser.parse_args()

    #
    api = MosAPI(token=args.token,
                 user_agent=args.user_agent,
                 guid=args.guid,
                 dev_user_agent=args.dev_user_agent,
                 dev_app_version=args.dev_app_version,
                 timeout=6)

    try:
        api.login(args.login, args.pwd)

        flats = api.get_flats()

        print('Кол-во квартир: ', len(flats))
        assert flats, 'Добавьте квартиру в приложении Госуслуги Москвы'

        for f in flats:
            print('Квартира #', flats.index(f) + 1)
            print('Название: ', f['name'])
            print('Адрес: ', f['address'])
예제 #2
0
# coding: utf-8
from __future__ import unicode_literals
import settings
from emp_mos_api import MosAPI

api = MosAPI(token=settings.EMP_MOS_RU_TOKEN,
             user_agent=settings.EMP_MOS_RU_USER_AGENT,
             guid=settings.EMP_MOS_RU_GUID,
             dev_user_agent=settings.EMP_MOS_RU_DEV_USER_AGENT,
             dev_app_version=settings.EMP_MOS_RU_APP_VER,
             timeout=1.5,
             https_verify=True)
예제 #3
0
                        help='application user agent')
    parser.add_argument('--dev_app_version', help='application version')

    parser.add_argument('--login',
                        help='your login (phone number: 7xxxxxxxxxx)')
    parser.add_argument('--pwd', help='your password')

    parser.add_argument('--hot', type=float, help='Hot water new value')
    parser.add_argument('--cold', type=float, help='Cold water new value')

    args = parser.parse_args()

    #
    api = MosAPI(token=args.token,
                 user_agent=args.user_agent,
                 guid=args.guid,
                 dev_user_agent=args.dev_user_agent,
                 dev_app_version=args.dev_app_version,
                 verify=True)

    try:
        api.login(args.login, args.pwd)

        flats = api.get_flats()
        assert flats, u'Добавьте квартиру в приложении Госуслуги Москвы'
        f = flats[0]
        print('Адрес: ', f['address'])
        print('Номер кв:  ', f['flat_number'])
        print('Номер платежки: ', f['paycode'])

        counters = api.get_watercounters(f['flat_id'])['counters']
예제 #4
0
                        help='application user agent')
    parser.add_argument('--dev_app_version', help='application version')

    parser.add_argument('--login',
                        help='your login (phone number: 7xxxxxxxxxx)')
    parser.add_argument('--pwd', help='your password')

    parser.add_argument('--sts', help='your car sts')

    args = parser.parse_args()

    #
    try:
        api = MosAPI(token=args.token,
                     user_agent=args.user_agent,
                     guid=args.guid,
                     dev_user_agent=args.dev_user_agent,
                     dev_app_version=args.dev_app_version,
                     timeout=6)

        api.login(args.login, args.pwd)

        car_fines = api.get_car_fines(args.sts)
        unpaid = car_fines['unpaid']
        print("Неоплаченных штрафов: {}".format(len(unpaid)))

        for u in unpaid:
            print("\nНомер: {}".format(u['seriesAndNumber']))
            print("Дата: {}".format(u['date']))
            print("Место: {}".format(u['offence_place']))
            print("Статья: {}".format(u['offenceType']))
            print("Сумма: {}".format(u['cost']))
예제 #5
0
    parser.add_argument('--dev_user_agent',
                        default='Android',
                        help='application user agent')
    parser.add_argument('--dev_app_version', help='application version')

    parser.add_argument('--login',
                        help='your login (phone number: 7xxxxxxxxxx)')
    parser.add_argument('--pwd', help='your password')

    args = parser.parse_args()

    #
    try:
        api = MosAPI(token=args.token,
                     user_agent=args.user_agent,
                     guid=args.guid,
                     dev_user_agent=args.dev_user_agent,
                     dev_app_version=args.dev_app_version,
                     timeout=6)

        api.login(args.login, args.pwd)
        p = api.get_profile()

        flats = api.get_flats()

        print('Кол-во квартир: ', len(flats))
        assert flats, 'Добавьте квартиру в приложении Госуслуги Москвы'

        for f in flats:
            # print(f)
            print('Квартира #', flats.index(f) + 1)
            print('Название: ', f['name'])