Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
examples/ | H | 21-Sep-2017 | - | 594 | 491 | |
tests/ | H | 21-Sep-2017 | - | 1,652 | 1,343 | |
threema/ | H | 21-Sep-2017 | - | 3,372 | 2,568 | |
.coveragerc | H A D | 21-Sep-2017 | 205 | 15 | 12 | |
.gitignore | H A D | 21-Sep-2017 | 900 | 72 | 60 | |
.travis-install-libsodium.sh | H A D | 21-Sep-2017 | 276 | 15 | 10 | |
.travis.yml | H A D | 21-Sep-2017 | 1.2 KiB | 55 | 47 | |
CHANGELOG.rst | H A D | 21-Sep-2017 | 741 | 29 | 19 | |
LICENSE | H A D | 21-Sep-2017 | 1.1 KiB | 22 | 17 | |
MANIFEST.in | H A D | 21-Sep-2017 | 133 | 7 | 6 | |
README.rst | H A D | 21-Sep-2017 | 4.5 KiB | 164 | 107 | |
RELEASING.md | H A D | 21-Sep-2017 | 1.5 KiB | 69 | 48 | |
mypy.ini | H A D | 21-Sep-2017 | 58 | 4 | 3 | |
setup.cfg | H A D | 21-Sep-2017 | 302 | 17 | 14 | |
setup.py | H A D | 21-Sep-2017 | 3.2 KiB | 109 | 89 |
README.rst
1Threema Gateway API 2=================== 3 4|Travis| |codecov| 5 6**threema-gateway** is a Python 3 module for the Threema gateway service. 7This API can be used to send and receive text messages to and from any Threema 8user. 9 10Note 11**** 12 13On machines where Python 3 is not the default Python runtime, you should 14use ``pip3`` instead of ``pip``. 15 16Prerequisites 17************* 18 19.. code-block:: bash 20 21 $ sudo apt-get install python3 python3-pip 22 23We recommend using `venv`_ to create an isolated Python environment: 24 25.. code-block:: bash 26 27 $ pyvenv venv 28 29You can switch into the created virtual environment *venv* by running 30this command: 31 32.. code-block:: bash 33 34 $ source venv/bin/activate 35 36While the virtual environment is active, all packages installed using 37``pip`` will be installed into this environment. 38 39To deactivate the virtual environment, just run: 40 41.. code-block:: bash 42 43 $ deactivate 44 45If you want easier handling of your virtualenvs, you might also want to 46take a look at `virtualenvwrapper`_. 47 48Installation 49------------ 50 51If you are using a virtual environment, activate it first. 52 53Install the module by running: 54 55.. code-block:: bash 56 57 $ pip install threema.gateway 58 59The dependency ``libnacl`` will be installed automatically. However, you 60may need to install `libsodium`_ for ``libnacl`` to work. 61 62Command Line Usage 63****************** 64 65The script ``threema-gateway`` provides a command line interface for 66the Threema gateway. Run the following command to see usage information: 67 68.. code-block:: bash 69 70 $ threema-gateway --help 71 72Feature Levels 73************** 74 75+---------+--------+----------------+---------+--------+-----------+ 76| Level | Text | Capabilities | Image | File | Credits | 77+=========+========+================+=========+========+===========+ 78| 1 | X | | | | | 79+---------+--------+----------------+---------+--------+-----------+ 80| 2 | X | X | X | X | | 81+---------+--------+----------------+---------+--------+-----------+ 82| 3 | X | X | X | X | X | 83+---------+--------+----------------+---------+--------+-----------+ 84 85You can see the implemented feature level by invoking the following 86command: 87 88.. code-block:: bash 89 90 $ threema-gateway version 91 92Callback Server 93--------------- 94 95The callback server can be used to receive messages. The demo script 96``threema-callback-server`` prints out received message on the command 97line. Run the following command to see usage information. 98 99.. code-block:: bash 100 101 $ threema-callback-server --help 102 103The script resides `here <threema/gateway/bin/callback_server.py>`_. 104 105Contributing 106************ 107 108If you want to contribute to this project, you should install the 109optional ``dev`` requirements of the project in an editable environment: 110 111.. code-block:: bash 112 113 $ git clone https://github.com/lgrahl/threema-msgapi-sdk-python.git 114 $ cd threema-msgapi-sdk-python 115 $ pip install -e .[dev] 116 117Before creating a pull request, it is recommended to run the following 118commands to check for code style violations (``flake8``), optimise 119imports (``isort``) and run the project's tests: 120 121.. code-block:: bash 122 123 $ flake8 . 124 $ isort -rc . 125 $ py.test 126 127You should also run the type checker that might catch some additional bugs: 128 129.. code-block:: bash 130 131 $ mypy . 132 133Reporting Security Issues 134************************* 135 136Please report security issues directly to one or both of the following 137contacts: 138 139- Danilo Bargen 140 141 - Email: mail@dbrgn.ch 142 - Threema: EBEP4UCA 143 - GPG: `EA456E8BAF0109429583EED83578F667F2F3A5FA`_ 144 145- Lennart Grahl 146 147 - Email: lennart.grahl@gmail.com 148 - Threema: MSFVEW6C 149 - GPG: `3FDB14868A2B36D638F3C495F98FBED10482ABA6`_ 150 151.. _asyncio: https://docs.python.org/3/library/asyncio.html 152.. _venv: https://docs.python.org/3/library/venv.html 153.. _virtualenvwrapper: https://virtualenvwrapper.readthedocs.io/ 154.. _libsodium: https://download.libsodium.org/doc/installation/index.html 155 156.. |Travis| image:: https://travis-ci.org/lgrahl/threema-msgapi-sdk-python.svg?branch=master 157 :target: https://travis-ci.org/lgrahl/threema-msgapi-sdk-python 158.. |codecov| image:: https://codecov.io/gh/lgrahl/threema-msgapi-sdk-python/branch/master/graph/badge.svg 159 :target: https://codecov.io/gh/lgrahl/threema-msgapi-sdk-python 160.. |PyPI| image:: https://badge.fury.io/py/threema.gateway.svg 161 :target: https://badge.fury.io/py/threema.gateway 162.. _EA456E8BAF0109429583EED83578F667F2F3A5FA: https://keybase.io/dbrgn 163.. _3FDB14868A2B36D638F3C495F98FBED10482ABA6: https://keybase.io/lgrahl 164