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,

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

```bash
$ ./pytwis_clt.py
```

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

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

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

```bash
> register xxxxxx yyyyyy
```

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

```bash
> login xxxxxx yyyyyy
```

(3) Log out.

```bash
> logout
```

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

```bash
> changepassword yyyyyy zzzzzz zzzzzz
```

(5) Follow a user xxxxxx.

```bash
> follow xxxxxx
```

(6) Unfollow a user.

```bash
> unfollow xxxxxx
```

(7) Get the follower list of a user.

```bash
> followers
```

(8) Get the following list of a user.

```bash
> followings
```

(9) Post a tweet

```bash
> post tweet
```

(10) Get the general/user timeline.

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

```bash
> exit
```

or

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

$ python3 -m unittest -v

or

$ python3 pytwis_test.py

or

$ ./pytwis_test.py

4. README.rst

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

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

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.1.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

pytwis-0.1.1-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pytwis-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4ad7c1f57793ac084e0d34a97fc1d0f28cc4f8af01a3733b48f5ed27f00ad736
MD5 80097ed6680eda512e02ec903afd147f
BLAKE2b-256 72368e5272472c0d9e45c33fe45a069a59088a381352899dd9996bcbe768da49

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytwis-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a7c7cf099ef272d53a782ebf7272270a0bf8ea21bb21ada64f9d111e7a5c5e2a
MD5 fd1a99d98d830eab25e60d260d5eecf3
BLAKE2b-256 70e335e584910ee5723f7bbbcb3801da12e35b7434162314f61cf9e11624d14a

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