Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phoneparser library

library for get operation and region to phone number Russia

install

git clone https://github.com/The-wartexny/phoneparser.git
cd phoneparser

or pip install

pip install ru-phone-parser

fast start

import phoneparser

parser = phoneparser.PhoneParser()
print(parser.parse('79161234567'))

batch processing

from phoneparser import PhoneParser

parser = PhoneParser()
numbers = ['79275842018', '79161234567', '+78123334455']

results = parser.parse_batch(numbers)

for number, info in results.items():
    print(f"{number}: {info['operator']} - {info['region']}")

working with the cache

parser = PhoneParser()

# Первый запрос — загрузка из базы
result1 = parser.parse('79275842018')

# Второй запрос с тем же номером — из кэша (быстрее)
result2 = parser.parse('78123334455')

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages