Metadata-Version: 2.0
Name: pytwis
Version: 0.1.2
Summary: A twitter-clone backend using Python and Redis
Home-page: https://github.com/renweizhukov/pytwis
Author: Wei Ren
Author-email: renwei2004@gmail.com
License: UNKNOWN
Project-URL: Bug Reports, https://github.com/renweizhukov/pytwis/issues
Project-URL: Source, https://github.com/renweizhukov/pytwis
Description-Content-Type: UNKNOWN
Keywords: redis twitter python3.6
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Database :: Database Engines/Servers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.6
Requires-Python: >=3.6
Requires-Dist: parse
Requires-Dist: redis
Provides-Extra: test
Requires-Dist: coverage; extra == 'test'

pytwis
======

A twitter-clone backend using Python and Redis.

Note that **this package requires Python 3.6 and later** since it
depends on Python 3.6 built-in module
`secrets <https://docs.python.org/3/library/secrets.html>`__.

To get the help information,

.. code:: bash

    $ ./pytwis_clt.py -h
    $ ./pytwis_clt.py --help

1. Connect to the twitter clone.
--------------------------------

::

    (1) Connect to the local Redis server at the default port 6379 with no password.

.. code:: bash

    $ ./pytwis_clt.py 

::

    (2) Connect to a remote Redis server with IP = xxx.xxx.xxx.xxx at port yyyy with password zzzzzz.

.. code:: bash

    $ ./pytwis_clt.py -h xxx.xxx.xxx.xxx -p yyyy -a zzzzzz

2. Online commands after successfully connecting to the twitter clone.
----------------------------------------------------------------------

Note that the following commands have to be executed after a successful
log-in.

-  logout
-  changepassword
-  follow
-  unfollow
-  followers
-  followings
-  post

Below are the sample usage of all the available online commands.

::

    (1) Register a new user xxxxxx with password yyyyyy.

.. code:: bash

    > register xxxxxx yyyyyy

::

    (2) Log into a user xxxxxxx with password yyyyyy.

.. code:: bash

    > login xxxxxx yyyyyy

::

    (3) Log out.

.. code:: bash

    > logout

::

    (4) Change the password. Assume that the old password is yyyyyy and the new password is zzzzzz.

.. code:: bash

    > changepassword yyyyyy zzzzzz zzzzzz

::

    (5) Follow a user xxxxxx.

.. code:: bash

    > follow xxxxxx

::

    (6) Unfollow a user.

.. code:: bash

    > unfollow xxxxxx

::

    (7) Get the follower list of a user.

.. code:: bash

    > followers

::

    (8) Get the following list of a user.

.. code:: bash

    > followings

::

    (9) Post a tweet

.. code:: bash

    > post tweet

::

    (10) Get the general/user timeline.

.. code:: bash

    > timeline [max-tweet-count]

::

    It will return the user timeline if a user is logged in and will return the general timeline otherwise. Also, it will return all the tweets in the timeline if max-tweet-count is not specified.

    (11) Exit the console program.

.. code:: bash

    > exit

::

    or 

.. code:: bash

    > quit

3. Unit test.
-------------

Since this unit test requires a running local Redis server, it is in
fact a small integration test. To run the test,

.. code:: bash

    $ python3 -m unittest -v

or

.. code:: bash

    $ python3 pytwis_test.py

or

.. code:: bash

    $ ./pytwis_test.py

4. README.rst
-------------

README.rst is generated from README.md via ``pandoc``.

.. code:: bash

    $ pandoc --from=markdown --to=rst --output=README.rst README.md


