Skip to content

olegush/29_phones

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microservice for Search Index of Phone Numbers

This microservice can help with search phone numbers in the database. First script, using Alembic, adds new column in the orders table. Second one, using phonenumbers library normalizes phone numbers and save them in the new column. It runs in the background, awaits new orders and updates rows.

How to Install

Python 3 and libraries from requirements.txt should be installed. Use virtual environment tool, for example virtualenv.

virtualenv virtualenv_folder_name
source virtualenv_folder_name/bin/activate
python3 -m pip install -r requirements.txt

Put all necessary parameters to .env file.

PG_URL=postgresql://user:paswprd@host:port/database
PG_TABLE=postgresql_table

Quickstart

  1. Run add_column.py.
$ python add_column.py
  1. Check if table has new column.

  2. Run normalize_phone.py.

  3. Check if new column contains normalized phone numbers.

Project Goals

The code is written for educational purposes. Training course for web-developers - DEVMAN.org

About

Alembic and SQLAlchemy exploring

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%