Metadata-Version: 2.2
Name: PyLink_MarcoGos
Version: 0.3.6
Summary: Universal communication interface using File-Like API
Home-page: https://github.com/MarcoGos/PyLink
Author: Salem Harrache
Author-email: Salem Harrache <salem.harrache@gmail.com>, Marco Gosselink <pypi@famgosselink.nl>
Maintainer: Lionel Darras
Maintainer-email: lionel.darras@mom.fr
License: Copyright (c) 2011-2012 by Salem Harrache and contributors.
        See AUTHORS for more details.
        
        Some rights reserved.
        
        Redistribution and use in source and binary forms of the software as well
        as documentation, with or without modification, are permitted provided
        that the following conditions are met:
        
        * Redistributions of source code must retain the above copyright
          notice, this list of conditions and the following disclaimer.
        
        * Redistributions in binary form must reproduce the above
          copyright notice, this list of conditions and the following
          disclaimer in the documentation and/or other materials provided
          with the distribution.
        
        * The names of the contributors may not be used to endorse or
          promote products derived from this software without specific
          prior written permission.
        
        THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
        CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
        NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
        A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
        OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
        EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
        PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
        PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
        LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
        NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
        SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
        DAMAGE.
        
Project-URL: Homepage, https://github.com/MarcoGos/PyLink
Project-URL: Issues, https://github.com/MarcoGos/PyLink/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Topic :: Internet
Classifier: Topic :: Utilities
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/x-rst
License-File: LICENSE
License-File: AUTHORS
Requires-Dist: progressbar-latest
Dynamic: author
Dynamic: home-page
Dynamic: maintainer
Dynamic: maintainer-email

PyLink
======

Pylink offers a universal communication interface using File-Like API.
For now, only the **TCP**, **UDP**, **Serial** and **GSM** interfaces are 
supported.

The aim of this project is to allow any type of communication.
It is best suited for projects that have various ways of communicating
including IP remote or local serial communication.

Installation
------------

You can install, upgrade, uninstall pylink with these commands::

  $ pip install pylink
  $ pip install --upgrade pylink
  $ pip uninstall pylink

Or if you don't have pip::

  $ easy_install pylink

Examples
--------

::

  >>> from pylink import TCPLink, link_from_url
  >>> link = TCPLink('localhost', 7) # conntect to echo tcp service
  >>> link.write('Hello')
  2012-06-05 12:44:06,211 INFO: new <TCPLink tcp:127.0.0.1:7> was initialized
  2012-06-05 12:44:06,211 INFO: Write : <b'hello'>
  >>> link.read() == 'Hello'
  2012-06-05 12:44:06,312 INFO: Read : <'hello'>
  True

With GSMLink, you shoud specify the modem connection link::


  >>> from pylink import GSMLink, SerialLink
  >>> link = GSMLink("0678986955", SerialLink("/dev/ttyUSB0", 38400))
  >>> link.open()
  2012-06-29 15:13:31,637 INFO: new <SerialLink serial:/dev/ttyUSB0:38400:8N1> was initialized 
  2012-06-29 15:13:31,637 INFO: GSM : Call 0678986955 
  2012-06-29 15:13:31,638 INFO: Write : <u'ATD0678986955\r\n'> 
  2012-06-29 15:13:31,648 INFO: GSM : <u'call in progress'> 
  2012-06-29 15:13:41,649 INFO: GSM : <u'call in progress'> 
  2012-06-29 15:14:08,075 INFO: Read : <u'\r\nCONNECT 9600\r\n\n\r\n\r\n\r'> 
  2012-06-29 15:14:08,076 INFO: GSM : <u'Client is ready (\r\nCONNECT 9600\r\n\n\r\n\r\n\r)'> 
  >>> link.write("TEST\n")
  2012-06-29 15:14:16,193 INFO: Write : <u'TEST\n'> 
  >>> link.read()
  2012-06-29 15:14:24,972 INFO: Read : <u'\n\rTEST\n\r'>
  
  TEST
  
  >>> link.close()
  2012-06-29 15:29:09,295 INFO: Write : <u'+++'> 
  2012-06-29 15:29:10,318 INFO: Read : <u'\r\nOK\r\n'> 
  2012-06-29 15:29:10,318 INFO: Write : <u'ATH\r\n'> 
  2012-06-29 15:29:10,336 INFO: Read : <u'\r\nOK\r\n'> 
  2012-06-29 15:29:10,337 INFO: GSM : Hang-up 
  2012-06-29 15:29:10,437 INFO: Connection <SerialLink serial:/dev/ttyUSB0:38400:8N1> was closed

Contribute
----------

There are several ways to contribute to the project:

#. Post bugs and feature `requests on github`_.
#. Fork `the repository`_ on Github to start making your changes.
#. Write a test which shows that the bug was fixed or that the feature works as expected.
#. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS_.

.. _`requests on github`: https://github.com/SalemHarrache/PyLink/issues
.. _`the repository`: https://github.com/SalemHarrache/PyLink
.. _AUTHORS: https://github.com/SalemHarrache/PyLink/blob/master/AUTHORS.rst
