Skip to main content

A GraphQL interface for Redis Database.

Project description

GredisQL

A GraphQL interface for Redis Database.

How To Install

pip install gredisql

If you find this project interesting, you can always appreciate it by giving it a Star. :D

A Background of GredisQL

background_image

Motivation

  1. I was bored, been sick for a while, had to lie on the bed. So I needed to create something.
  2. Redis has Web interface ( actually a REST interface), so I urged to build one in GraphQL.
  3. There are some pretty amazing GraphQL libraries around python echo system, I wanted to try them.
  4. Last but not least, jump into quick coding session, engage and nurture the human mind. LOL

Design Philosophy

  1. All the data mutation and query are not separated here by action and most probably all the actions are performed via query operation.
  2. Technically all the requests sent to the GraphQL server was in POST, so I was initially okay with the implementation.
  3. Strawberry-Graphql is kind of server agnostic so either you can use ASGI or WSGI counterpart.
  4. Currently limiting the implementation with WSGI server, but I've plan to adopt ASGI in the journey, to support subscription.
  5. Not all Redis commands are found in the implementation, I'll try to cover it in the process.

Inspiration and Tools I used

  1. redis==5.0.0 is used to communicate with the Redis database.
  2. strawberry-graphql is used to do the heavy lifting. Also, I tried ariadne which is also another cool tool to try with.

Features and Future Plans

  1. String Commands.
  2. List Commands.
  3. Set Commands.

And many more to come in the future iteration.

Quick Starting the GraphQL Server

if __name__ == "__main__":
    from gredisql.core import Server

    server = Server()
    server.run()

You can specify the host, port and debug mode in while instantiating the GraphQL server. Simply write,

if __name__ == "__main__":

    REDIS_HOST = 'redis-4343.c8.us-east-1-4.ec2.cloud.redislabs.com'
    REDIS_PORT = 16292
    REDIS_PASSWORD = 'your-secret-password'

    from gredisql.core import Server

    server = Server(
         REDIS_HOST=REDIS_HOST,
         REDIS_PORT=REDIS_PORT,
         REDIS_PASSWORD=REDIS_PASSWORD
    )
    server.run()

Now navigate to http://localhost:5055/graphql and voilà.

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

gredisql-0.0.9.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

gredisql-0.0.9-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file gredisql-0.0.9.tar.gz.

File metadata

  • Download URL: gredisql-0.0.9.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for gredisql-0.0.9.tar.gz
Algorithm Hash digest
SHA256 2fe759fb417de60ab1314d0c6a894369d1ae06bc877ebbf908dcd293a000d374
MD5 475c811d2c9abfc88c5878502b784dee
BLAKE2b-256 bba67a2868a275dc618b0f1edb0e9d5b60f2ec818f932d0cb817bcef6680f240

See more details on using hashes here.

File details

Details for the file gredisql-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: gredisql-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for gredisql-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 6ff62a2bbdc75269e3bd3ae751ed04db0348c5097ad6dfca479b4cc8cbf66633
MD5 ad7776e80456da5c017d599e555d11b7
BLAKE2b-256 704ee952c0134bd1af1e9637ea10935509889a3792fcb7d503246741ba23b442

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