Saravanan666/pypi-org huggingface dataset:
Package: redis-tools
Redis ToolsUseful helpers and tools when working with Redis or using redis for common problems like rate-limitting, locks and other...12Factor configurationStandarized initialization of client using environment, supporting Sentinel.# export REDIS_URL=redis://localhost# export REDIS_URL=sentinel://localhost?master=mymaster# export REDIS_URL=sentinel://localhost:12343/0?master=mymasterimportredistoolsredistools.get_redis()# get redis clientredistools.get_redis(master=False)# slave (read-only) clientRate limittingRate limitting log filterLock decorator
Package: redis-tools-py2
Redis ToolsUseful helpers and tools when working with Redis or using redis for common problems like rate-limitting, locks and other...THIS IS A PYTHON 2.7 COMPATIBLE PACKAGE, FOR PYTHON 3 USEhttps://pypi.org/project/redis-tools/12Factor configurationStandarized initialization of client using environment, supporting Sentinel.# export REDIS_URL=redis://localhost# export REDIS_URL=sentinel://localhost?master=mymaster# export REDIS_URL=sentinel://localhost:12343/0?master=mymasterimportredistoolsredistools.get_redis()# get redis clientredistools.get_redis(master=False)# slave (read-only) clientRate limittingRate limitting log filterLock decorator
Package: redistore
Simple python interface for redisInstallationpipinstallredistoreUsage>>importredistore>>store=redistore.get(host='localhost',port=6379,db=0)Now you can access and store keys and values with a dict-like interface:>>store['foo']='bar'>>store['foo']'bar'>>'foo'instoreTrue>>delstore['foo']>>store['foo']...KeyError:'foo'Or using methods:>>store.set('baz','qux')>>store.get('baz')'qux'redistoresupport other data types, e.g., hashes. they are used exactly like a dict:>>store['hash']={}# creates a hash without any values>>'my'instore['hash']True>>store['hash']['my']'hash'>>store['hash'].update({'baz':'qux'})>>store['hash']['baz']'qux'>>len(store['hash'])2>>list(store.keys())['foo','bar']>>forkey,valueinstore.items():...print(key,value)...myhashbazqux>>store['other_hash']={'foo':'bar'}# creates a hash with values>>store['other_hash']['foo']'bar'
Package: redis-tq
redis-tqredis-tq is aRedis-basedmulti-producer, multi-consumer Queue.
Allows for sharing data between multiple processes or hosts.Tasks support a "lease time". After that time other workers may consider this
client to have crashed or stalled and pick up the item instead. The number of
retries can be configured as well.Based onthis examplebut with many improvements added.Installingredis-tq is available onPyPIso you can simply install via:$pipinstallredis-tqHow to useOn the producing side, populate the queue with tasks and a respective lease
timeout:fromredistqimportTaskQueuetq=TaskQueue('localhost','myqueue')foriinrange(10):tq.add(sometask,lease_timeout,ttl=3)On the consuming side:fromredistqimportTaskQueuetq=TaskQueue('localhost','myqueue')whileTrue:task,task_id=tq.get()iftaskisnotNone:# do something with task and mark it as complete afterwardstq.complete(task_id)iftq.is_empty():break# tq.get is non-blocking, so you may want to sleep a# bit before the next iterationtime.sleep(1)If the consumer crashes (i.e. the task is not marked as completed afterlease_timeoutseconds), the task will be put back into the task queue. This
rescheduling will happen at mostttltimes and then the task will be
dropped. A callback can be provided if you want to monitor such cases.Running the testsThe tests will check the presence of a Redis instance on localhost, you can
usedocker run --rm -d -p 6379:6379 redisto get one. Then usemake test, it will take care of creating an appropriate
virtualenv and use it to run the tests.
Package: redis-tracker
redis-trackerCli tool that redirect redis key values to stdout and/orprometheus$ redis-tracker set zset text list --prometheus 9090
sending stats to prometheus: localhost:9090
set                                                       84
list                                                      57
zset                                                      19
text                                                  hello!PrometheusThe example above would produce these prometheus stats:# HELP redis_track redis key value tracking
# TYPE redis_track gauge
redis_track{key="set",source="redis@localhost/0:6379",type="set"} 1.0
redis_track{key="zset",source="redis@localhost/0:6379",type="zset"} 1.0
# HELP redis_track_info redis key value tracking
# TYPE redis_track_info gauge
redis_track_info{key="text",source="redis@localhost/0:6379",text="hello!",type="string"} 1.0In other words:setsandlistsproduce gauges that track their lengthzsetssame as setsstringproducesinfoUsage$ redis-tracker --help                                                                                               
Usage: redis-tracker [OPTIONS] [KEYS]...

  track redis keys to stdout and/or prometheus

Options:
  --from-set TEXT       take keys from set key
  --prometheus INTEGER  enable prometheus polling on port
  --tick-rate INTEGER   how often to check in seconds  [default: 1]
  --no-color            disable output color
  -h TEXT               redis hoststring  [default: localhost]
  -p INTEGER            redis port  [default: 6379]
  -a TEXT               redis password
  -db INTEGER           redis host  [default: 0]
  --help                Show this message and exit.Installpip install redis-tracker
Package: redis_triplestore
redis_triplestoreImplements a triplestore using Redis to store relations, in Python.Requires Redis 2.0+, newest version of redis-py and redis_wrap.redis-py can be downloaded from here:
*http://github.com/andymccurdy/redis-pyNote that you can use the requirements.txt file to install dependencies with pip.ExamplesAtribution:FOAF = Namespace('http://xmlns.com/foaf/0.1/')

frodo = Resource('http://example.com/comte/frodo', **{
    FOAF.name: 'Frodo',
    FOAF.familyName: 'Baggins',
})
assert frodo[FOAF.name] == 'Frodo'Persistence:frodo = Resource('http://example.com/comte/frodo')
assert frodo[FOAF.name] == 'Frodo'

gandalf = Resource('http://example.com/wizards/gandalf', **{
    FOAF.name: 'Gandalf',
    FOAF.familyName: 'the White',
})
saruman = Resource('http://example.com/wizards/saruman', **{
    FOAF.name: 'Saruman',
    FOAF.familyName: 'of Many Colors',
})Relations:frodo.add_relation(FOAF.knows, gandalf)
assert frodo.relations(FOAF.knows) == [gandalf]
gandalf.add_relation(FOAF.knows, saruman)
assert gandalf.relations(FOAF.knows) == [saruman]
assert gandalf.reversed_relations(FOAF.knows) == [frodo]
frodo.add_relation(FOAF.knows, saruman)
assert frodo.relations(FOAF.knows) == [gandalf, saruman]Clean up:frodo.delete_relation(FOAF.knows, saruman)
assert frodo.relations(FOAF.knows) == [gandalf]
frodo.delete_relation(FOAF.knows, gandalf)
gandalf.delete_relation(FOAF.knows, saruman)
assert gandalf.relations(FOAF.knows) == []
assert gandalf.reversed_relations(FOAF.knows) == []
frodo.remove()
gandalf.remove()
saruman.remove()
assert frodo[FOAF.name] == NoneCopyright: 2010 by David Larlet
License: BSD.
Package: redis_tryton
Redis Cache backend for the Tryton application framework.In order to configure the redis cache you should modify your trytond
configuration file to include the redis_tryton.RedisCache as class of the
cache section. Optionally you can especify the redis uri with the uri value.
If you do not specify the uri value it will useredis:/127.0.0.1:6379/0as
default value. An example configuration file looks like:[cache]
class=redis_tryton.RedisCache
uri=redis://127.0.0.1:6379/0Once you have specified the config file, everything should work out of the
box and you should see your cache values created on the redis database.It uses msgpack as an eficient way to dump python objects to the redis cache.IssuesFeel free to open Issues on thebitbucket issue trackerif you have some problems with the software or do you want to discuss some
posible improvements.Pull Request are very welcomme also!SupportYou can send me and email onsergi@koolpi.comif you encounter any problems.
I will try to reply ASAP, but it may take some time to get a reply, so please
be patient.ThanksThis code is based on the Coopengo Guys Redis Cache implementation, so without
their effort this should not be possible. Please give them many thanks.
Package: redistypes
Redis bindings is an attempt to bring Redis types into Python as native ones. It
is based onredis-pyand has the
following types implemented so far:RedisListMoreover, it provides some Redis descriptor interfaces:IRedisFieldIRedisListFieldIt is exactly interfaces, because it requires user to overrideget_key_namemethod to define key name for Redis. Here is an example of how it can be
implemented (can be found inexample.py).fromredisimportRedisfromredistypes.descriptorsimportIRedisField,IRedisListFieldr_connection=Redis()classRedisField(IRedisField):def__init__(self,pickling=True):super(RedisField,self).__init__(redis_connection=r_connection,pickling=pickling)defget_key_name(self,instance):return':'.join([instance.__class__.__name__,str(instance.pk),self.name])classRedisListField(IRedisListField,RedisField):passclassStudent:name=RedisField()subjects=RedisListField()def__init__(self,pk):self.pk=pkTheStudentclass defined above can do the following things:>>>fromexampleimportStudent>>>s=Student(pk=1)>>>s.name='John Galt'>>>s.subjects=['math','physics']>>>s.nameJohn Galt>>>s.subjectsRedisList: ['math', 'physics']>>>s.subjects.append('p.e.')>>>s.subjectsRedisList: ['math', 'physics', 'p.e.']>>># Values stored inside the Redis types are immutable!>>>s.subjects.append({'name':'art','avg_score':4.5})>>>s.subjects[3]{'avg_score': 4.5, 'name': 'art'}>>>s.subjects[3]['avg_score']=3>>>s.subjects[3]{'avg_score': 4.5, 'name': 'art'}Warning!All values stored inside the Redis types are immutable! As the example above
shows, an attempt to change the value stored in the dictionary inside the
RedisList leads to nothing.RoadmapQuerying over the pipeRedisDict
Package: redis-unique-queue
redis-unique-queueA module that combines the use of redis in-built data types to build a unique queue for processing and expiry.UsageItems are put on the queue with an optional key. A duplicate key cannot be added until either:
- the previous key that was added has been fully processed.
- expiry_in_seconds have passed.Examplesimporttimeimportredisimportruqueueexpiry_in_seconds=1conn=redis.Redis()uqueue=ruqueue.Queue(redis_conn=conn,expiry_in_seconds=expiry_in_seconds)uqueue.put(100)print("Expected size 1:",uqueue.qsize())uqueue.put(100)# not added againprint("Expected size 1:",uqueue.qsize())uqueue.put(200)# not added againprint("Expected size 2:",uqueue.qsize())# get an itemprint("Expected item 100:",uqueue.get())# go past expiry seconds to testtime.sleep(expiry_in_seconds)# item 100 has expiredprint("Items that expired:",uqueue.clear_expired())# [100] -> a list of items that expiresprint("Expected size 1:",uqueue.qsize())print("Expected item 200:",uqueue.get())# we have finished handling 200uqueue.task_done(200)print("Expected size 0:",uqueue.qsize())print("Expected item None:",uqueue.get())
Package: redis-utils
Useful when a seeded redis database is needed during test-cyclesOverviewhelpers for seeding / clearing local redis databases during testingFunctionsdump_to_file(path, redis_conn = None, host = “localhost”, port=
6379 ) - create a pickled dump of redisload_from_file(path, redis_conn = None, host = “localhost”, port=
6379 ) - load a pickled file into redisclear(redis_conn = None, host = “localhost”, port= 6379 ) - clear a
redis databaseThis is good for any testing environment and works well in a setup /
breadkown Nose testing environment
Package: redisweb
rediswebA flask extension to support user view and manage redis with beautiful interface.Get StartedInstallation is easy:$ pip install rediswebStart Server:# 使用redis默认连接配置 IP:127.0.0.1 PORT:6379redisweb# 配置启动的时候redis连接IP 端口和密码rediswebhostportpasswordNow, you can go tohttp://127.0.0.1:5000/redisboardPreview
Package: redis-websocket-api
An extensible Redis-over-WebSocket API on top of websockets and aioredis.InstallationFor basic functionality:pip install redis_websocket_apiWith geo extension (filtering messages by extent, projection transformation):pip install redis_websocket_api[geo]Server-Side UsageFor a quick test you can runpython-mredis_websocket_apito start a simple redis websocket api onws://localhost:8765.This doesroughlythe equivalant of:fromaioredisimportfrom_urlfromredis_websocket_apiimportWebsocketServer,WebsocketHandlerclassPublishEverythingHandler(WebsocketHandler):defchannel_is_allowed(self,channel_name):returnTrueWebsocketServer(redis=from_url("redis:///",encoding="utf-8",decode_responses=True),read_timeout=30,keep_alive_timeout=120,handler_class=PublishEverythingHandler,).listen(host='localhost',port=8000,channel_patterns=["[a-z]*"],)Have a look atexamples/demo.pyfor an example with theGeoCommandsMixinadded.Client-Side UsageWebsocketHandlerThe default functionality provides the following interface to the web client
(expecting the requests over a websocket connection):GET keytranslates tohvals keyGET key hkeytranslates tohget key hkeySUB keysubscribes the websocket to a redis channel (using a single redis
connection pool for all clients)DEL keyunsubscribes the client from the channelPINGcauses aPONGresponse (to avoid timeouts)Subclass ofWebsocketHandlerwithGeoCommandsMixinaddedBy adding theGeoCommandsMixinthe web client can useBBOX left bottom right topto only receive GeoJSON features within this box
plus all messages which are not valid GeoJSONPROJECTION epsg:numbercauses all future GeoJSON features to be transformed
to the given projectionSeeexamples/demo.pyfor how to use an extendedWebsocketHandlersubclass.Geo commands are currently limited toLineString,Polygon, andPointgeometries.Note that the projection input and output coordinates will use the traditional GIS order,
that is longitude, latitude for geographic CRS and easting, northing for most projected CRS.
If you want the input and output axis order to strictly follow the definition of the CRS,
useStrictAxisOrderGeoCommandsMixininstead ofGeoCommandsMixin.Build your own protocolUsing the commands listed above for communicating from client to server is
completly optional and determinded by the Mixin classes added to theWebsocketHandlerBase.
Package: redis-wheel
redis-wheelTo install the pre-compiled Redis binaries:pipinstallredis-wheel==<redis-version>Supported versions of Redis:6.2.5Supported platforms:manylinux2014_x86_64macosx_11_0_x86_64Supported python versions:cp39To get the paths of pre-compiled Redis binaries:importredis_wheelredis_wheel.REDIS_SERVER_PATH# redis-serverredis_wheel.REDIS_CLI_PATH# redis-cli
Package: redis-work-queue
A work queue, on top of a redis database, with implementations in Python, Rust, Go, Node.js
(TypeScript) and Dotnet (C#).This is the Python implementations. For an overview of how the work queue works, it's limitations,
and the general concepts and implementations in other languages, please read theredis-work-queue
readme.SetupfromredisimportRedisfromredis_work_queueimportKeyPrefix,WorkQueuedb=Redis(host='your-redis-server')work_queue=WorkQueue(KeyPrefix("example_work_queue"));Adding workCreatingItemsfromredis_work_queueimportItem# Create an item from bytesbytes_item=Item(b"[1,2,3]")# Create an item from a stringstring_item=Item('[1,2,3]');# Create an item by json serializing an objectjson_item=Item.from_json_data([1,2,3])# Retreive an item's data, as bytes:assertbytes_item.data()==b"[1,2,3]"assertbytes_item.data()==string_item.data()assertbytes_item.data()==json_item.data()# Parse an item's data as JSON:assertbytes_item.data_json()==[1,2,3]Add an item to a work queuework_queue.add_item(db,item)Completing workPlease readthe documentation on leasing and completing
items.fromredis_work_queueimportItemwhileTrue:# Wait for a job with no timeout and a lease time of 5 seconds.# Use work_queue.lease(db, 5, timeout=10) to timeout and return `None` after 10 seconds.job:Item|None=work_queue.lease(db,5)assertjobisnotNonedo_some_work(job)work_queue.complete(db,job)Handling errorsPlease readthe documentation on handling
errors.fromredis_work_queueimportItemwhileTrue:# Wait for a job with no timeout and a lease time of 5 seconds.job:Item=work_queue.lease(db,5)try:do_some_work(job)exceptExceptionaserr:ifshould_retry(err):# Drop a job that should be retried - it will be returned to the work queue after# the (5 second) lease expires.passelse:# Errors that shouldn't cause a retry should mark the job as complete so it isn't# tried again.log_error(err)work_queue.complete(db,&job)continue# Mark successful jobs as completework_queue.complete(db,job)
Package: redis_wrap
redis_wrapImplements a wrapper for Redis datatypes so they mimic the datatypes found in Python.Requires Redis 2.0+ and newest version of redis-py.For best performance the wrappers are lazy and use direct Redis calls.
E.g. __len__ of list wrapper is implemented by calling llen.redis-py can be downloaded from here:
*http://github.com/andymccurdy/redis-pyExamplesExample of list wrapper:bears = get_list('bears')
bears.append('grizzly')
assert len(bears) == 1
assert 'grizzly' in bearsExample of hash wrapper:villains = get_hash('villains')
assert 'riddler' not in villains

villains['riddler'] = 'Edward Nigma'
assert 'riddler' in villains

assert len(villains.keys()) == 1

del villains['riddler']
assert len(villains) == 0Example of set wrapper:fishes = get_set('fishes')
assert 'nemo' not in fishes

fishes.add('nemo')
assert 'nemo' in fishes

for item in fishes:
    assert item == 'nemo'Copyright: 2010 by amix
License: BSD.
Package: rediswrapper
rediswrapper is a pythonic wrapper of Redis Client for end users. The whole storage
acts like a python dict as well as its child storage values.FeaturesThe root client support dict-like operationsPython object wrappers for list, set, hash type valuesImplicit serialization and deserialization when storing and fetching dataInstallationFrom PyPI:pip install rediswrapperFrom GitHub:git clone https://github.com/frostming/rediswrapper
cd rediswrapper
pip install .Usagerediswrapperwill try to serialize non-sting values and store them in redis and
deserialize them when fetching back.All redis value types are mocked with respective python objects and support all
standard methods as the builtin types.>>>importrediswrapper>>>redis=rediswrapper.RedisDict()# String value>>>redis['a']='hello'# int value>>>redis['b']=2>>>dict(redis){'a':'hello','b':2}# Picklable object>>>importdatetime>>>redis['c']=datetime.datetime.now()# List value>>>redis['d']=list(range(5))>>>redis['d'].append(0)>>>redis['d']ListTypevalue([0,1,2,3,4,0])# Hash value>>>redis['e']={'a':1,'b':2}>>>redis['e'].get('a')1# Set value>>>redis['f']=set([1,2])>>>redis['f'].add(3)>>>redis['f']SetTypevalue([1,2,3])To inspect those value types, one should use the ABCs defined incollectionsmodule.>>>fromcollectionsimportMapping>>>isinstance(redis['e'],Mapping)TrueHistoryv0.4.0Drop support for Python older than 3.6v0.3.0Drop support for Python 3.3Fix a vulnerability issue that cause users run arbitrary scripts.LicensingThis work is open-sourced under theMITlicense.
Package: redisx
redisx-pyInstallpython version >=3.10redis-py version == 5.0.0Install from pip:python3-mvenv.venvsource.venv/bin/activate
pip3installredisxInstall from source:gitclonehttps://github.com/weedge/redisx-py.gitcdredisx-py
python3setup.pyinstallrun examplespython3examples/ann_usearch.pyReferencehttps://devguide.python.org/versions/https://github.com/redis/redis-pyhttps://github.com/alibaba/tair-py
Package: redit
redit - edit againreditpreviews a folder of recently edited text files and launches an editor on the file of your choice.reditis useful when you keep a folder of textual notes and you want to go back to a recently edited file whose name you might not remember. In this case you would typereditand be greeted with this interactive prompt:Answering withj,enterwill then directly loadREADME.mdinto your editor.You can set a default directory to look for files (say,~/notes) in~/.config/redit/default-locationlike this:mkdir-p~/.config/redit&&echo'~/notes'>~/.config/redit/default-locationAlternatively you can provide a location withredit ~/Downloadsand finallyreditfalls back to the current directory.InstallationpipinstallreditConfigure an editorreditwill try to launch the editor in$EDITORor use the one configured in~/.config/redit/editor.
Package: redivis
redivis-pythonRedivisclient library for python!Connect data on Redivis to the Python scientific stack, and script your data management tasks.Beta disclaimerThis library is currently in beta testing. Many of the interfaces are nearing stability, but there may still be backwards-incompatible changes in the future.Please report any issues or feature requests in theissue tracker.DocumentationComprehensive documentation for this package is available athttps://apidocs.redivis.com/client-libraries/redivis-pythonContributingPlease report any issues or feature requests in theissue tracker— your feedback is much appreciated!
Package: rediz
RedizServer code for open community microprediction atwww.microprediction.org.Microprediction.OrgOverviewThe python packages called "microprediction" (user client library) and "rediz" (system implementation using redis as transport) are demonstrated atwww.microprediction.org, where they
make it easy for anyone who needs a live source of data predicted to receive help from clever humans and self-navigating time series algorithms.  They do this by:Obtaining a write_key with microconventions.create_key(difficulty=12), which takes several hoursUsing the write_key to update a live quantity, such ashttps://www.microprediction.org/live/cop.jsonRepeating often.They can then access history (e.g.https://www.microprediction.org/live/lagged::cop.json) and predictions (e.g.https://www.microprediction.org/cdf/cop.json). This is an easy way to
normalize data and perform anomaly detection. Over time it may garner other insights such as assessment of the predictive value of the data stream the identities of streams that
might be causally related.This setup is especially well suited to collective prediction of civic data streams such as transport, water, electricity, public supply chain indicators or the spread of infectious diseases. The client
libraryhttps://github.com/microprediction/rediz/blob/master/README.mdand sitewww.microprediction.orgprovide more information.Related packages and dependenciesmuid      getjson
   |           |
 microconventions 
   |           | 
 rediz        micropredictionConventionshttps://github.com/microprediction/microconventions/blob/master/README.mdMicropredictionhttps://github.com/microprediction/rediz/blob/master/README.mdRediz detailsThis may be a little stale.https://github.com/microprediction/rediz/blob/master/README_REDIZ.mdhttps://github.com/microprediction/rediz/blob/master/README_REDIZ_DETAILS.md