From 777109f5ea0d083369bfe108707f5b2dadbcfa0e Mon Sep 17 00:00:00 2001 From: Tayler Porter Date: Mon, 7 Feb 2022 17:03:01 -0600 Subject: [PATCH] Updated package for upload to PyPI. --- .gitignore | 2 ++ README.md | 36 +++++++++++++++++++++--------------- pyproject.toml | 6 ++++++ setup.py | 37 ++++++++++++++++++++++++++++++------- 4 files changed, 59 insertions(+), 22 deletions(-) create mode 100644 .gitignore create mode 100644 pyproject.toml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b74ac78 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +dist/ +pyVoIP.egg-info diff --git a/README.md b/README.md index 0616a2d..a43812a 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,18 @@ # pyVoIP PyVoIP is a pure python VoIP/SIP/RTP library. Currently, it supports PCMA, PCMU, and telephone-event. -Please note this is still in development. - -This library does not depend on a sound library, i.e. you can use any sound library that can handle linear sound data i.e. pyaudio or even wave. Keep in mind PCMU/PCMA only supports 8000Hz, 1 channel, 8 bit, audio. +This library does not depend on a sound library, i.e. you can use any sound library that can handle linear sound data i.e. pyaudio or even wave. Keep in mind PCMU/PCMA only supports 8000Hz, 1 channel, 8 bit audio. ## Getting Started -Simply put pyVoIP into your site-packages folder. +Simply run `pip install pyVoIP`, or if installing from source: + +```bash +git clone https://github.com/tayler6000/pyVoIP.git +cd pyVoIP +pip install . +``` + +Don't forget to check out [the documentation](https://pyvoip.readthedocs.io/)! ### Basic Example This basic code will simple make a phone that will automatically answer then hang up. @@ -14,17 +20,17 @@ This basic code will simple make a phone that will automatically answer then han ```python from pyVoIP.VoIP import VoIPPhone, InvalidStateError -def answer(call): #This will be your callback function for when you receive a phone call. - try: - call.answer() - call.hangup() - except InvalidStateError: - pass +def answer(call): # This will be your callback function for when you receive a phone call. + try: + call.answer() + call.hangup() + except InvalidStateError: + pass -if __name__=='__main__': - phone=VoIPPhone(, , , , callCallback=answer, myIP=, sipPort=, rtpPortLow=, rtpPortHigh=) - phone.start() - input('Press enter to disable the phone') - phone.stop() +if __name__ == "__main__": + phone=VoIPPhone(, , , , callCallback=answer, myIP=, sipPort=, rtpPortLow=, rtpPortHigh=) + phone.start() + input('Press enter to disable the phone') + phone.stop() ``` diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..236c211 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = [ + "setuptools>=42", + "wheel" +] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index dd17005..4111e00 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,35 @@ from setuptools import find_packages from setuptools import setup + +with open("README.md", "r", encoding='utf-8') as f: + long_description = f.read() + setup( - name = 'pyVoIP', - version = '1.5.2', - description = 'PyVoIP is a pure python VoIP/SIP/RTP library.', - author = 'Tayler Porter', - author_email = 'taylerporter@gmail.com', - url = 'https://github.com/tayler6000/pyVoIP', - packages = find_packages() + name='pyVoIP', + version='1.5.2', + description='PyVoIP is a pure python VoIP/SIP/RTP library.', + long_description=long_description, + long_description_content_type="text/markdown", + author='Tayler Porter', + author_email='taylerporter@gmail.com', + url='https://github.com/tayler6000/pyVoIP', + project_urls={ + "Bug Tracker": "https://github.com/tayler6000/pyVoIP/issues", + "Documentaiton": "https://pyvoip.readthedocs.io/" + }, + classifiers=[ + "Programming Language :: Python :: 3", + "Operating System :: OS Independent", + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Intended Audience :: Telecommunications Industry", + "Intended Audience :: Information Technology", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Natural Language :: English", + "Topic :: Communications :: Internet Phone", + "Topic :: Communications :: Telephony" + ], + packages=find_packages(), + python_requires=">=3.6" )