Giter Site home page Giter Site logo

redisjson-py's Introduction

GitHub issues CircleCI macos Dockerhub Codecov

RedisJSON

Forum Discord

logo

Overview

RedisJSON is a Redis module that implements ECMA-404 The JSON Data Interchange Standard as a native data type. It allows storing, updating and fetching JSON values from Redis keys (documents).

Primary features

  • Full support of the JSON standard
  • JSONPath syntax for selecting elements inside documents
  • Documents are stored as binary data in a tree structure, allowing fast access to sub-elements
  • Typed atomic operations for all JSON values types
  • Secondary index support when combined with RediSearch

Quick start

docker run -p 6379:6379 --name redis-stack redis/redis-stack:latest

Documentation

Read the docs at https://redis.io/docs/latest/develop/data-types/json/

How do I Redis?

Learn for free at Redis University

Build faster with the Redis Launchpad

Try the Redis Cloud

Dive in developer tutorials

Join the Redis community

Work at Redis

Build

Make sure you have Rust installed: https://www.rust-lang.org/tools/install

Then, build as usual:

cargo build --release

When running the tests, you need to explicitly specify the test feature to disable use of the Redis memory allocator when testing:

cargo test

If you forget to do this, you'll see an error mentioning signal: 4, SIGILL: illegal instruction.

Run

Linux

redis-server --loadmodule ./target/release/librejson.so

Mac OS

redis-server --loadmodule ./target/release/librejson.dylib

Client libraries

Official clients

NRedisStack Jedis node-redis redis-py
Redis.OM Redis OM Spring redis-om-node redis-om

Community supported clients

Project Language License Author Stars Package Comment
Redisson Java Apache-2.0 Redisson Redisson-stars Maven
redis-modules-java Java Apache-2.0 Liming Deng @dengliming redis-modules-java-stars maven
ioredis-rejson Node.js MIT Felipe Schulz @schulzf ioredis-rejson-stars npm
go-rejson Go MIT Nitish Malhotra @nitishm go-rejson-stars
rejonson Go Apache-2.0 Daniel Krom @KromDaniel rejonson-stars
rueidis Go Apache-2.0 Rueian @rueian rueidis-stars
NReJSON .NET MIT/Apache-2.0 Tommy Hanks @tombatron NReJSON-stars nuget
phpredis-json PHP MIT Rafa Campoy @averias phpredis-json-stars composer
redislabs-rejson PHP MIT Mehmet Korkmaz @mkorkmaz redislabs-rejson-stars composer
rejson-rb Ruby MIT Pavan Vachhani @vachhanihpavan rejson-rb-stars rubygems
rustis Rust MIT Dahomey Technologies rustis-stars crate Documentation
coredis Python MIT Ali-Akber Saifee @alisaifee coredis-stars pypi Documentation

Acknowledgments

RedisJSON is developed with <3 at Redis Labs.

RedisJSON is made possible only because of the existence of this amazing open source project:

License

RedisJSON is licensed under the Redis Source Available License 2.0 (RSALv2) or the Server Side Public License v1 (SSPLv1).

redisjson-py's People

Contributors

avitalfineredis avatar bentsku avatar chayim avatar dvirdukhan avatar gkorland avatar hootnot avatar itamarhaber avatar oshadmi avatar stsievert avatar tuananh avatar ykvch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redisjson-py's Issues

Small issues

Hi,

experimenting with this new JSON-feature I found:

  • pip install rejson-py should be : pipinstall rejson
  • ReJSONClient should be : Client

See PR

TypeError: can't use a string pattern on a bytes-like object

Hi,

I am using python 3.4 and following code

from rejson import Client, Path

rj = Client(host='localhost', port=6379)

# Set the key `obj` to some object
obj = {
    'answer': 42,
    'arr': [None, True, 3.14],
    'truth': {
        'coord': 'out there'
    }
}
rj.jsonset('obj', Path.rootPath(), obj)

# Get something
response = rj.jsonget('obj', Path('.truth.coord'))
print (response.read().decode('utf-8'))

Value is getting inserted but while reading it is throwing following error

Traceback (most recent call last):
  File "/home/sohanvir/pyhton-workspace/rejsonDemo.py", line 16, in <module>
    response = rj.jsonget('obj', Path('.truth.coord'))
  File "/usr/local/lib/python3.4/dist-packages/rejson/client.py", line 114, in jsonget
    return self.execute_command('JSON.GET', *pieces)
  File "/usr/local/lib/python3.4/dist-packages/redis/client.py", line 573, in execute_command
    return self.parse_response(connection, command_name, **options)
  File "/usr/local/lib/python3.4/dist-packages/redis/client.py", line 587, in parse_response
    return self.response_callbacks[command_name](response, **options)
  File "/usr/lib/python3.4/json/decoder.py", line 343, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: can't use a string pattern on a bytes-like object

redis.exceptions.ResponseError: unknown command 'JSON.SET'

Ola, Estou tentando Utilizar o REJSON no python, ja iniciei utilizando o pip install rejson, instala normal, porem sempre me retorna esse erro, que nao esta encontrando o comando JSON.SET.. o que poderia ser ? estou rodando o servidor redis no localhost do windows..

  File "d:\RAFA\WHATSAPP\whatsapp-bot\redis2.py", line 7, in <module>
    r.execute_command('JSON.SET',"dic")
  File "C:\Users\hto-r\AppData\Local\Programs\Python\Python39\lib\site-packages\redis\client.py", line 901, in execute_command
    return self.parse_response(conn, command_name, **options)
  File "C:\Users\hto-r\AppData\Local\Programs\Python\Python39\lib\site-packages\redis\client.py", line 915, in parse_response
    response = connection.read_response()
  File "C:\Users\hto-r\AppData\Local\Programs\Python\Python39\lib\site-packages\redis\connection.py", line 756, in read_response
    raise response
redis.exceptions.ResponseError: unknown command 'JSON.SET'   ```

client.jsonget('foo', '.') causes TypeError if key doesn't exist.

If you run the following:

connection = rejson.Client(host='redis')
print(connection.jsonget('test', '.'))

Python (3.7) will complain with an error like this:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/rejson/client.py", line 114, in jsonget
    return self.execute_command('JSON.GET', *pieces)
  File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 668, in execute_command
    return self.parse_response(connection, command_name, **options)
  File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 682, in parse_response
    return self.response_callbacks[command_name](response, **options)
  File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: cannot use a string pattern on a bytes-like object

Given that running this on the cli yields 'nil', I'd expect jsonget to return None.

To fix this I've built a custom JSON Decoder that handles this, but it'd be nice to have it done in the API.

In case it's useful to someone else, here's what I wrote as a work around:

import json
import rejson

class ReJsonEncoder(json.JSONEncoder): pass

class ReJsonDecoder(json.JSONDecoder):
	def decode(self, s, *args, **kwargs):
		if s is not None:
			return json.JSONDecoder.decode(self, s, *args, **kwargs)
		return None

client = rejson.Client(host='redis', encoder=ReJsonEncoder(), decoder=ReJsonDecoder())

Dependencies not being installed

Hello,

I installed this module using
pipenv install rejson
but when I try to use it i get errors such as:
Traceback (most recent call last): File "app.py", line 2, in <module> from rejson import Client, Path File "/path/.pyenv/shims/python/lib/python3.6/site-packages/rejson/__init__.py", line 116, in <module> from .client import Client File "/path/.pyenv/shims/python/lib/python3.6/site-packages/rejson/client.py", line 3, in <module> from redis import StrictRedis ModuleNotFoundError: No module named 'redis'

Seems like the above install command does not also install dependencies.

How to search in a list?

I see a key pointing to list of json :

redis_json_client.jsonset('customers', Path.rootPath(), { "customers": []})

example of insreted json
customer_json:

 {
  "customer_status": "Active",
  "first_name": "Leonard",
  "last_name": "Cohen",
  "customer_no": 1
}

So now I append each of the json as following:

redis_json_client.jsonarrappend('customers', Path('.customers'), customer_json)

I'd like to preform a search finding specific customer_no
I tried something like:

customer_redis = redis_json_client.jsonget('customers', Path('customer_no'),370471789)

Q:
1.The reaosn for creating a list of json is that i'd like to some category collection in redis
,i wonder how bad it effect the performance ,
I could also assign the json as :
key,customer_json instead of key,[customer_json]

2.How could i preform a search for specific json where key holds a list of json as desribe above?

Cannot import 'BasePipeline'

I am running into
ImportError: cannot import name 'BasePipeline' from 'redis.client' (/usr/local/lib/python3.7/site-packages/redis/client.py)

at this line

from rejson import Client, Path

Issue occurs with redis-py version 3.0.1

JSON.MGET list of keys argument not supported

Hello..
I am using python and i want to pass list of keys to JSON.MGET but that is not working.

so i need to prapare from list to sting and then i need to prepare command and much more...
so its look like difficult.

So can u please fix it or give me sample example to how to implement JSON.MGET with python?

Thanks

Get/Filter in a JSON Key Values

Hi Guys,

look my json

JSON.GET 906461499
"{"name": "jony", "time": "10:36:49", "date": "20190109", "ope": "U", "table": "C20010", "field": "U"}"

How can I get/filter in a JSON key value, like "name = 'jony'"

Thank you

TypeError when executing jsonget with pipeline for key that does not exist

If you execute jsonget on the Client and the key does not exist, it will catch the TypeError and instead return None, as expected.

If you execute jsonget on a pipeline and the key does not exist, it will throw the TypeError that results from json decoding the None value. Because of this, I cannot get any of the other results from the other commands from the pipeline.

Python 3.6.9
rejson 0.5.4

Traceback (most recent call last):
  File "test.py", line 7, in <module>
    result = pipeline.execute()
  File "/home/user/.local/lib/python3.6/site-packages/redis/client.py", line 4019, in execute
    return execute(conn, stack, raise_on_error)
  File "/home/user/.local/lib/python3.6/site-packages/redis/client.py", line 3943, in _execute_transaction
    r = self.response_callbacks[command_name](r, **options)
  File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: expected string or bytes-like object
import rejson

rj = rejson.Client(host='localhost', port=6379, decode_responses=True)

pipeline = rj.pipeline()
pipeline.jsonget("gdrbhiserbgherigh")
result = pipeline.execute()

ImportError: dynamic module does not define init function (PyInit_rejson)

Hej
After installing rejson-py in ubuntu for python3( pip3 install rejson)
running sample file
python3 rejson.py
Traceback (most recent call last):
File "rejson.py", line 2, in
from rejson import Client, Path
ImportError: dynamic module does not define init function (PyInit_rejson)

Do you have any suggestions?
Thanks
/Joanna

JSON in a stream value

Hello,
Is it possible to put a JSON in a stream entry, as a value ? And if so, how ?
Thank you in advance

Error installing the package

I am trying to install the package on Python 3.8 and I am getting this error.

pip install rejson

ERROR: Failed building wheel for rejson Failed to build rejson ERROR: Could not build wheels for rejson which use PEP 517 and cannot be installed directl

pip install rejson==0.5.0 fails

Collecting rejson==0.5.0
Downloading

https://files.pythonhosted.org/packages/33/31/d85098ce0718e86b147296b296fd66b5f82f3d638d60a8798e6824b71a7a/rejson-0.5.0.tar.gz
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ehcrp3qu/rejson/setup.py'"'"'; file='"'"'/tmp/pip-install-ehcrp3qu/rejson/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-ehcrp3qu/rejson/pip-egg-info
cwd: /tmp/pip-install-ehcrp3qu/rejson/
Complete output (9 lines):
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-ehcrp3qu/rejson/setup.py", line 24, in
version = get_version('rejson')
File "/tmp/pip-install-ehcrp3qu/rejson/setup.py", line 14, in get_version
init_py = open(os.path.join(package, 'init.py')).read()
File "/usr/local/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1425: ordinal not in range(128)

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I am seeing this on Mac OS 10.5 and Centos 7.4
Python Version - 3.6.4

Method setDecoder is not working

Hello,

The method setDecoder is not working properly, if you use it after initialising your Client instance, it won't be used in the callbacks.

Passing the decoder as a parameter when initialising the Client instance works as expected.

I believe it is because we set the callbacks in the __init__ method, and when we set the new decoder, we reassign self._decode with the new decoder decode method, but the callbacks are still pointing to the old function.

Those callbacks are not recreated with the set_response_callback method.

# Set the module commands' callbacks
MODULE_CALLBACKS = {
'JSON.DEL': long,
'JSON.GET': self._decode,
'JSON.MGET': bulk_of_jsons(self._decode),
'JSON.SET': lambda r: r and nativestr(r) == 'OK',
'JSON.NUMINCRBY': self._decode,
'JSON.NUMMULTBY': self._decode,
'JSON.STRAPPEND': long,
'JSON.STRLEN': long,
'JSON.ARRAPPEND': long,
'JSON.ARRINDEX': long,
'JSON.ARRINSERT': long,
'JSON.ARRLEN': long,
'JSON.ARRPOP': self._decode,
'JSON.ARRTRIM': long,
'JSON.OBJLEN': long,
}
for k, v in six.iteritems(MODULE_CALLBACKS):
self.set_response_callback(k, v)

I guess several fixes are possible, having _decode being a declared method of the class, which would be calling the _decode_function property (I don't like the name, what should it be ?) that would be set in the setDecoder method. The callbacks would always be pointing to the right method.

A quick fix that would also be fixing the TypeError for every command would be in the form of this snippet.

class Client(StrictRedis):
    _encoder = None
    _encode = None
    _decoder = None
    _decode_function = None

   [...]

    def _decode(self, s, *args, **kwargs):
        try:
            return self._decode_function(s, *args, **kwargs)
        except TypeError:
            if s is not None:
               raise
            return None

This would fix the callback problem (tested). I can open a pull request if you'd like this fix.

Thank you

python 2.7 SyntaxError

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/rejson/__init__.py", line 124, in <module>
    from .client import Client
  File "/Library/Python/2.7/site-packages/rejson/client.py", line 106
    def jsonget(self, name, *args, no_escape=False):
                                           ^
SyntaxError: invalid syntax

In Python 2, all positional arguments must come before any *args argument.

Unicode / Encoding issues

I'm facing some encoding issues with the client;
The problem are when using non ascii characters, more precisely æøåÆØÅ etc.

client.jsonset("test", Path.rootPath(), {'name': 'test111', 'items': []})

client.jsonget('test') --> {'name': 'test111', 'items': []}

client.jsonarrinsert('test', Path('.items'), 0, {'company': 'Åre', 'destination': 'ÅS', 'origin': 'LØR'})

client.jsonget('test')

This does not look correct?
{"name":"test111","items":[{"company":"\u00c3\u0085re","destination":"\u00c3\u0085S","origin":"L\u00c3\u0098R"},]}

What i had expected:
{"name":"test111","items":[{"company":"\u00c5re","destination":"\u00c5S","origin":"L\u00d8R"},]}
or
{"name":"test111","items":[{"company":"\xc5re","destination":"\xc5S","origin":"L\xd8R"},]}

If i save as strings they appear to get the correct encoding, but then my array elements are turned in to strings instead of objects

If I'm doing it wrong, I'd be greatful for any tips! :)

Client.jsonget not finding key from rootpath

I'm entirely certain this may be a usage issue, but reaching out here as I'm not sure where else to look.

Problem

I have a class Jobs which inherits the rejson module classes Client and Path. Methods in the Jobs class are called by routes in a flask API.

My /run route calls the make_job function, which in turn generates a unique id for that job, and inserts a JSON body into redis. I am using the redis-json docker image from dockerhub.

My /status route calls the get_job function, and is supposed to return a JSON object from redis.

The problem I'm having is, I can insert JSON objects without issue, but jsonget can't seem to find the key I inserted previously.

All keys are inserted at the root path.

Workflow

Insert Key via /run route:

{
  "JobID": "5de40954-bf5f-499e-8d6e-f283d4d326c8",
}

Verify via redis-cli:

127.0.0.1:6379> KEYS 5de40954-bf5f-499e-8d6e-f283d4d326c8
1) "5de40954-bf5f-499e-8d6e-f283d4d326c8"
127.0.0.1:6379> 
127.0.0.1:6379> json.get 5de40954-bf5f-499e-8d6e-f283d4d326c8
"{\"gitOrg\":\"test-org\",\"gitRepo\":\"test-repo\",\"job\":{\"inventory\":\"site.ini\",\"playbook\":\"deploy.yml\",\"vars\":\"env=testenv cleanup_keys=true\"}}"

Run /status route that calls get_job(), which gets a key using jsonget;

None
127.0.0.1 - - [12/Jul/2019 16:24:02] "GET /status/5de40954-bf5f-499e-8d6e-f283d4d326c8 HTTP/1.1" 404 -

where None is the output of print(job)

Code:

from rejson import Client, Path

class Jobs(Client, Path):
    Client(host='localhost', port=6379, decode_responses=True)

    def make_job_id(self):
        return uuid.uuid4()

    def make_job(self, data): 
        jobId = str(self.make_job_id())
        self.jsonset(jobId, Path.rootPath(), data)
        return jobId

    def get_job(self, jobId):
        job = self.jsonget(jobId)
        if job:
            print(job)
            return job
        else:
            return False

Expected results

jsonget returns and decodes the JSON object stored under the keyname set when inserted.

I'm not sure if this is a pathing issue. I've looked at the source, and I see that jsonget defaults to the root path.

Before using rejson-py, I was using just the raw redis client and encoding/decoding json as needed, but I had issues where the first key I inserted into redis would be rendered null, so I switched to rejson-py.

Idk if I'm being incredibly stupid here or what..

In python 3.6 get errors in jsonget related to how encoding is managed

Attempted to install and use rejson with Python 3.6.5 on Ubuntu (in Windows WSL), as described here: https://stackoverflow.com/questions/51805265/rejson-py-example-not-working-on-python-3-6/51805591#51805591 .

The example failed with error:
File "testrejson.py", line 16, in
temp = rj.jsonget('obj')
File "/home/greg/.local/lib/python3.6/site-packages/rejson/client.py", line 114, in jsonget
return self.execute_command('JSON.GET', *pieces)
File "/home/greg/.local/lib/python3.6/site-packages/redis/client.py", line 668, in execute_command
return self.parse_response(connection, command_name, **options)
File "/home/greg/.local/lib/python3.6/site-packages/redis/client.py", line 682, in parse_response
return self.response_callbacks[command_name](response, **options)
File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: cannot use a string pattern on a bytes-like object

Was able to correct through adding 2 lines in decoder.py at line 680:

if isinstance(response, bytes):
response = response.decode('utf-8')

However not sure if this will work universally or if a different approach is needed.

Thanks

Exception when using Redis-Pool

I get decoding exception when I use a redis-pool along with rejson client.

I'll use the same code as the Usage Example in README

from rejson import Client, Path
import redis

redis_pool = None

def redis_create_pool() -> None:
    """
    Get redis pool and init it globally.
    This is done at the start of main.py
    """
    # Redis client bound to pool of connections (auto-reconnecting).
    global redis_pool
    redis_pool = redis.ConnectionPool.from_url("redis://localhost", max_connections=10)


redis_create_pool()
rj = Client(decode_responses=True, connection_pool=redis_pool)

# Set the key `obj` to some object
obj = {
    'answer': 42,
    'arr': [None, True, 3.14],
    'truth': {
        'coord': 'out there'
    }
}
rj.jsonset('obj', Path.rootPath(), obj)

# Get something
print('Is there anybody... {}?'.format(rj.jsonget('obj', Path('.truth.coord'))))

# Delete something (or perhaps nothing), append something and pop it
rj.jsondel('obj', Path('.arr[0]'))
rj.jsonarrappend('obj', Path('.arr'), 'something')
print('{} popped!'.format(rj.jsonarrpop('obj', Path('.arr'))))

# Update something else
rj.jsonset('obj', Path('.answer'), 2.17)

# And use just like the regular redis-py client
jp = rj.pipeline()
jp.set('foo', 'bar')
jp.jsonset('baz', Path.rootPath(), 'qaz')
jp.execute()

# If you use non-ascii character in your JSON data, you can add the no_escape flag to JSON.GET command
obj_non_ascii = {
    'non_ascii_string': 'hyvää'
}
rj.jsonset('non-ascii', Path.rootPath(), obj_non_ascii)
print('{} is a non-ascii string'.format(rj.jsonget('non-ascii', Path('.non_ascii_string'), no_escape=True)))

This is the diff

1a2
> import redis
3c4,17
< rj = Client(host='localhost', port=6379, decode_responses=True)
---
> redis_pool = None
> 
> def redis_create_pool() -> None:
>     """
>     Get redis pool and init it globally.
>     This is done at the start of main.py
>     """
>     # Redis client bound to pool of connections (auto-reconnecting).
>     global redis_pool
>     redis_pool = redis.ConnectionPool.from_url("redis://localhost", max_connections=10)
> 
> 
> redis_create_pool()
> rj = Client(decode_responses=True, connection_pool=redis_pool)

Exception

TypeError: cannot use a string pattern on a bytes-like object

RedisJSON for Redis Cluster?

Currently Client is a StrictRedis client. This does not seem to work with the Redis Cluster setup (MOVED error due to redirection that is not followed?).

Does it make sense to pass a redis/rediscluster object to Client to make the connector pluggable?

moduleNotFoundError: No module named "redis._compat"

This import error pops up when trying to import rejson using latest build for redis-py (pip install redis before rejson).

A temporary workaround is to install previous redis-py version 3.5.3 before installing rejson, as in:

p -m pip uninstall -y redis
p -m pip install redis==3.5.3
p -m pip install rejson

Rejson russian letter problem.

Hi all! I have a problem with reason and russian letter. I no anything idea, how i can fix it.

hiredis==0.2.0
redis==2.10.6
rejson==0.2.1
six==1.11.0
python =3.6

from rejson import Client, Path

rj = Client(host='localhost', port=6379, db=1, decode_responses=True)

with open('param_dict.json', 'rb') as file:

obj_test = json.load(file)

print(obj_test)
{'ID': 1, 'Вес(кг.)': 17, 'Рост(см.)': 100, .....

rj.jsonset('user1', Path.rootPath(), obj_test)
print(rj.jsonget('user1'))

{'ID': 1, 'Ð\x92еÑ\x81(кг.)': 17, 'Ð\xa0оÑ\x81Ñ\x82(Ñ\x81м.)':

When i set dict with reason module in redis base, russian letter looking this Ð\x92еÑ\x81(кг.)

Is there a problem?

How to retrieve a subset of key, vals

   obj = {
       'answer': 42,
       'arr': [None, True, 3.14],
       'truth': {
           'coord': 'out there'
       }
   }

Is there any way for me to specify a set of paths to enable something like:

jsonmget(path=Path(['.answer', '.arr']), 'obj')

=> ```
[ 'answer': 42,
'arr': [None, True, 3.14]]

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.