Skip to main content

A twitter-clone backend using Python and Redis

Project description

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 <>`__.

To get the help information,

$ ./ -h
$ ./ --help

1. Connect to the twitter clone.

  1. Connect to the local Redis server at the default port 6379 with no password.
$ ./
  1. Connect to a remote Redis server with IP = at port yyyy with password zzzzzz.
$ ./ -h -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
  1. Register a new user xxxxxx with password yyyyyy.
> register xxxxxx yyyyyy
  1. Log into a user xxxxxxx with password yyyyyy.
> login xxxxxx yyyyyy
  1. Log out.
> logout
  1. Change the password. Assume that the old password is yyyyyy and the new password is zzzzzz.
> changepassword yyyyyy zzzzzz zzzzzz
  1. Follow a user xxxxxx.
> follow xxxxxx
  1. Unfollow a user.
> unfollow xxxxxx
  1. Get the follower list of a user.
> followers
  1. Get the following list of a user.
> followings
  1. Post a tweet
> post tweet
  1. Get the general/user timeline.
> 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.

  1. Exit the console program.
> exit


> 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,

$ python3 -m unittest -v


$ python3


$ ./

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pytwis, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size pytwis-0.1.0-py3.6.egg (28.1 kB) File type Egg Python version 3.6 Upload date Hashes View
Filename, size pytwis-0.1.0-py3-none-any.whl (14.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pytwis-0.1.0.tar.gz (16.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page