-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82b6e5e
commit 7cbb344
Showing
4 changed files
with
110 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
dist: bionic | ||
language: python | ||
|
||
git: | ||
depth: false | ||
|
||
stages: | ||
- black | ||
- flake8 | ||
- test | ||
|
||
jobs: | ||
include: | ||
- stage: "black" | ||
python: "3.6" | ||
env: BLACK=19.10b0 | ||
install: pip install black==$BLACK | ||
script: black ./phone_gen --check | ||
after_success: false | ||
- stage: "flake8" | ||
python: "3.6" | ||
env: | ||
- FLAKE8=3.8.1 | ||
- PEP8_NAMING=0.10.0 | ||
install: | ||
- pip install flake8==$FLAKE8 | ||
- pip install pep8-naming==$PEP8_NAMING | ||
script: flake8 ./phone_gen | ||
after_success: false | ||
|
||
env: | ||
- PHONENUMBERS="-U phonenumbers" # last version | ||
|
||
python: | ||
- "pypy3" | ||
- "3.5" | ||
- "3.6" | ||
- "3.7" | ||
- "3.8" | ||
install: | ||
- pip install $PHONENUMBERS | ||
- pip install pytest-cov==2.8.1 | ||
- pip install pytest==5.4.2 | ||
- pip install -e . | ||
script: | ||
- pip freeze | grep phonenumbers | ||
- pytest tests | ||
deploy: | ||
provider: pypi | ||
user: $PYPI_USER | ||
password: $PYPI_PASSWORD | ||
skip_existing: true | ||
distributions: bdist_wheel --universal | ||
on: | ||
tags: true | ||
repo: tolstislon/phone_gen | ||
python: "3.8" | ||
|
||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) | ||
|
||
notifications: | ||
email: | ||
on_success: never | ||
on_failure: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,40 @@ | ||
# phone_gen | ||
Phone number generator | ||
# Phone Gen | ||
|
||
[![Build Status](https://travis-ci.com/tolstislon/phone_gen.svg?branch=master)](https://travis-ci.com/tolstislon/phone_gen) | ||
[![codecov](https://codecov.io/gh/tolstislon/phone-gen/branch/master/graph/badge.svg)](https://codecov.io/gh/tolstislon/phone-gen) | ||
|
||
|
||
Phone number generator for [Google's libphonenumber library](https://github.com/google/libphonenumber) | ||
|
||
|
||
Install | ||
---- | ||
|
||
```bash | ||
pip install phone-gen | ||
``` | ||
|
||
Example | ||
---- | ||
```python | ||
from phone_gen import PhoneNumber | ||
|
||
phone_number = PhoneNumber('GB') | ||
|
||
# Get full phone number | ||
number = phone_number.get_number() | ||
print(number) # +442908124840 | ||
|
||
# Get country code | ||
country_code = phone_number.get_code() | ||
print(country_code) # 44 | ||
|
||
# Phone number without country code | ||
number = phone_number.get_number(full=False) | ||
print(number) # 183782623 | ||
``` | ||
|
||
|
||
Contributing | ||
---- | ||
Contributions are very welcome. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
license='MIT License', | ||
author='tolstislon', | ||
author_email='[email protected]', | ||
description='Phone number generator', | ||
description='Phone number generator for libphonenumber', | ||
long_description=long_description, | ||
long_description_content_type='text/markdown', | ||
use_scm_version={"write_to": "phone_gen/__version__.py"}, | ||
|
@@ -22,10 +22,9 @@ | |
include_package_data=True, | ||
keywords=[], | ||
classifiers=[ | ||
'Development Status :: 5 - Production/Stable', | ||
'Development Status :: 4 - Beta', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: MIT License', | ||
'Natural Language :: English', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3.5', | ||
|
@@ -34,6 +33,7 @@ | |
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: Implementation :: CPython', | ||
'Programming Language :: Python :: Implementation :: PyPy', | ||
'Topic :: Software Development :: Libraries :: Python Modules' | ||
'Topic :: Software Development :: Testing', | ||
'Topic :: Communications :: Telephony' | ||
] | ||
) |