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 <https://docs.python.org/3/library/secrets.html>`__.

To get the help information,

$ ./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.

$ ./pytwis_clt.py
  1. Connect to a remote Redis server with IP = xxx.xxx.xxx.xxx at port yyyy with password zzzzzz.

$ ./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

  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

or

> 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

or

$ python3 pytwis_test.py

or

$ ./pytwis_test.py

Project details


Download files

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

Source Distribution

pytwis-0.1.0.tar.gz (16.0 kB view details)

Uploaded Source

Built Distributions

pytwis-0.1.0-py3.6.egg (28.1 kB view details)

Uploaded Source

pytwis-0.1.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file pytwis-0.1.0.tar.gz.

File metadata

  • Download URL: pytwis-0.1.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pytwis-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5b51139afa4970f0284ca397195c9f5c4c301cb89d0de615689546000ce4eec6
MD5 bc27d8bcc5fd68ed7983d5d892257d10
BLAKE2b-256 563558eaa5536e7deea342b67b11818d9f78aa43dfb20f2ca01d8a563c033ac7

See more details on using hashes here.

File details

Details for the file pytwis-0.1.0-py3.6.egg.

File metadata

  • Download URL: pytwis-0.1.0-py3.6.egg
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pytwis-0.1.0-py3.6.egg
Algorithm Hash digest
SHA256 d6484ebc904e7f72cbc3715f15e4d3d6d8459556b58d6eb19d8c058b2dd59dfd
MD5 04ee0b2ed577dcc3a32ec716bbe1dea0
BLAKE2b-256 e4347cb4f18ec238fcbf5924ce1bed836bab7bd2a75017a36b52cf3a67d508e3

See more details on using hashes here.

File details

Details for the file pytwis-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytwis-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67cf09337ec7ebadd14992789fcf82f49362f2df3a7b260fb0f536c989701816
MD5 cd3d29be302867bb04c3788e8661bbbf
BLAKE2b-256 000768619160992dc2ff20973a7847906745d4eaeb8b6ff637caf6cebabf12e5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page