Giter Site home page Giter Site logo

aspine-dev's Introduction

Aspine

Aspine: A simple python native implementation of data caching

What is it?

Aspine provide a simple in-memory data store, used as caching and data synchronization。

ToDo

To create a CLI.

Installation

Use the pip to install aspine.

pip install aspine

Usage

A simple example

# save this as server.py
from aspine import AspineServer

if __name__ == "__main__":
    # Please change host, port, authkey for your aspine server.
    # Default host is 127.0.0.1
    # Default port is 5116
    # Default authkey is 123456
    m = AspineServer()
    m.run()

Then run it.

python server.py

From where you want to use your aspine server.

from aspine import AspineClient

cli = AspineClient()
cli.connect()

cli.set("this_is_key", "this is value")
cli.set("sample_key", {"a": 1, "b": "text here"})

You could get it back anywhere once you connect to it.

>>> from aspine import AspineClient
>>> 
>>> cli = AspineClient()
>>> cli.connect()
>>> cli.get("sample_key")
{'name': 'sample_key', 'value': {'a': 1, 'b': 'text here'}, 'set_ts': 1646215110.250738}

License

MIT

aspine-dev's People

Contributors

ccuulinay avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.