Saravanan666/pypi-org huggingface dataset:
Package: py-redact-datumbrain
py_redactDocument redaction library in Python.Install Requirementspip install py_redactExample UsageRedact Microsoft Word Documentfrompy_redact.docx_redactorimportDocxRedactorreplace_char='*'regexes=[r"""\d{3}-\d{2}-\d{4}""",r"""(([a-zA-Z0-9_\.+-]+)@([a-zA-Z0-9-]+)\.[a-zA-Z0-9-\.]+)"""]redactor=DocxRedactor(input_file,regexes,replace_char)redactor.redact(output_file_path)Redact Microsoft Power Point Slidefrompy_redact.pptx_redactorimportPptxRedactorreplace_char='*'regexes=[r"""\d{3}-\d{2}-\d{4}""",r"""(([a-zA-Z0-9_\.+-]+)@([a-zA-Z0-9-]+)\.[a-zA-Z0-9-\.]+)"""]redactor=PptxRedactor(input_file,regexes,replace_char)redactor.redact(output_file_path)
Package: pyredai
PyRedAIPyRedAIis a Python library to interact with LLMs using LangChain as a core of this library.FeaturesSay Hello: Generate a greeting message.InstallationYou can install PyRedAI using pip:pipinstallpyredaiUsageHere's a simple example of how to use PyRedAI:Say HelloGenerate a greeting message.frompyredai.helloimportsay_helloprint(say_hello("Foo"))Running TestsTo run tests, run the following commandpytest-vAuthors@apriliantocecepLicenseThis project is licensed under the MIT License - see the LICENSE file for details.
Package: pyredblack
Copyright (c) 2015 Will Roberts <wildwilhelm@gmail.com>Licensed under the MIT License (seeLICENSE.rstfor details).Cython interface to red-black trees implemented in C++.Red-black treesare a kind ofself-balancing binary tree.  They
maintain their entries in sorted order and have O(log n) for
insertion, lookup, and deletion.  You canread more about red-black
treesandsee animations of insertion, lookup, and deletion.This package provides dictionary and set objects based on
red-black-trees; these can be used as drop-in replacements for the
built-indictandsettypes, except that they maintain their
contents in sorted order.Dictionary (rbdict):>>> import pyredblack
>>> d = pyredblack.rbdict(Germany = 'Berlin',
                          Hungary = 'Budapest',
                          Ireland = 'Dublin',
                          Portugal = 'Lisbon',
                          Cyprus = 'Nicosia',
                          Greenland = 'Nuuk',
                          Iceland = 'Reykjavik',
                          Macedonia = 'Skopje',
                          Bulgaria = 'Sofia',
                          Sweden = 'Stockholm')
>>> len(d)
10
>>> d['Ireland']
'Dublin'
>>> d.keys()
['Bulgaria', 'Cyprus', 'Germany', 'Greenland', 'Hungary',
 'Iceland', 'Ireland', 'Macedonia', 'Portugal', 'Sweden']
>>> d.values()
['Sofia', 'Nicosia', 'Berlin', 'Nuuk', 'Budapest',
 'Reykjavik', 'Dublin', 'Skopje', 'Lisbon', 'Stockholm']
>>> d.popitem()
('Bulgaria', 'Sofia')
>>> d.popitem()
('Cyprus', 'Nicosia')
>>> d.popitem()
('Germany', 'Berlin')Set (rbset):>>> fruit = pyredblack.rbset(['apple', 'orange', 'apple', 'pear',
                              'orange', 'banana'])
>>> 'orange' in fruit
True
>>> 'crabgrass' in fruit
False
>>> a = pyredblack.rbset('abracadabra')
>>> b = pyredblack.rbset('alacazam')
>>> list(a)
['a', 'b', 'c', 'd', 'r']
>>> list(a - b)
['b', 'd', 'r']
>>> list(a | b)
['a', 'b', 'c', 'd', 'l', 'm', 'r', 'z']
>>> list(a & b)
['a', 'c']
>>> list(a ^ b)
['b', 'd', 'l', 'm', 'r', 'z']
>>> a.pop()
'a'
>>> a.pop()
'b'
>>> a.pop()
'c'RequirementsPython 2.7, Python 3.2+Cython (and a C++ compiler)Todoimplement slicing on dictionaries
Package: py-reddit
py-redditA package that can be used to get reddit submissions, and their various attributes.
The package supports both synchronous and asynchronous development.
I am more familiar with synchronous programming, but have tried my best at making a good asynchronous implementation.
The package is written in Python 3.10, and uses requests and aiohttp as its main dependencies.Updates will be coming soon, thank you for viewing this package, please consider using it.Version - 1.1.12Docs -docsSocials -KING7077 - GitHubInstallation methods:pip3 install py-reddit

py -3 -m pip install py-reddit

python3 -m pip install py-redditExample usage:importredditclient=reddit.Client('agent','key')subreddit=client.Subreddit('top','subreddit-here')# supports 'top', 'new' or 'hot' mode of submissionsprint(subreddit.selftext(0))#gets the selftext of the first post hereAsynchronus client:importredditimportasyncioclient=reddit.AsyncClient('agent','key')asyncdefmain():subreddit=awaitclient.Subreddit('top','subreddit-here')# supports 'top', 'new' or 'hot' mode of submissionsprint(awaitsubreddit.selftext(0))asyncio.run(main())The package is still under active developmentCHANGELOGMay 9, 2022Added documentation, and added raw_json method for Client.Subreddit and AsyncClient.Subreddit - 1.1.12March 28, 2022Small changes to the project functionality. - 1.1.11March 28, 2022Small changes to the README. - 1.1.10March 28, 2022You no longer need to use__call__(Found a way to use async__init__) - 1.1.9March 16, 2022Changes to the async client usage (Need to use__call__()) - 1.1.8March 16, 2022License changes - 1.1.7February 21, 2022Just changing package DIRs - 1.1.6February 21, 2022Just changing package DIRs - 1.1.5February 21, 2022You can now specify the number of posts you want to fetch in Client.Subreddit() and AsyncClient.Subreddit().
For example:importredditsubreddit=reddit.Client('agent','key').Subreddit('top','memes',100)# To fetch 100 posts. If a limit is not specified, it defaults to 25Similar for the Async Clientlimit does not follow a zero index, but all the methods under Subreddit() follow zero index. This may be changed sooner or later​- 1.1.4February 20, 2022Bettered the asynchronous implementation of the project. Much faster now. Renamed Client.Subreddit.url to Client.Subreddit.post_url, the same change for the asynchronous client - 1.1.3February 19, 2022Minor changes to the description of the project - 1.1.2February 19, 2022Minor changes to the description of the project - 1.1.1February 19, 2022The project actually works now - 1.1.0February 18, 2022Minor changes to make the project more usuable - 1.0.6February 18, 2022Minor changes to make the project more usuable - 1.0.5February 18, 2022Minor changes to make the project more usuable - 1.0.4February 18, 2022Minor changes to make the project more usuable - 1.0.3February 18, 2022Minor changes to the description of the project - 1.0.2February 18, 2022Initial release - 1.0.1
Package: pyredditchatbot
PyredditchatbotPyredditchatbot is a Python package for easily building reddit chatbots that surf your favourite subreddit and replies
when called. Simply modify the parameters mentioned in the Quickstart to create your own custom reddit chatbot to add
some life to your subreddit!InstallationPyredditchatbot is supported on Python 3.7 and above. The recommended way to install it is viapip <https://pypi.python.org/pypi/pip>.pip install pyredditchatbotFor instructions on installing Python and pip see "The Hitchhiker's Guide to Python"Installation Guides <https://docs.python-guide.org/en/latest/starting/installation/>.QuickstartGo tohttps://www.reddit.com/prefs/apps/and login with your reddit account. This is the account that will be replying, so
consider making a new account if you're looking to roleplay as a character. Please also make sure to read
reddit etiquette and guidelines before creating a bot.Create a script type application by filling out the form. You should now have a client id and secret for the application
just created.You can create a bot like so:import pyredditchatbot as prc

bot = prc.Bot(
    client_id,
    client_secret,
    reddit_username,
    reddit_password,
    "u/my-bot",
    "my-favourite-subreddit"
)The bot surfs all the comments on the subredditmy-favourite-subredditand replies whenever it sees the phraseu/my-botin a comment.You need to add quotes to your bot to help it choose what to reply with. By default it looks forquotes.txtlocally.
You can also add your quotes as an iterable like this:quotes = ["Hi", "How are you!!", "Hello!"]
bot.add_quotes(quotes)You can also fetch quotes directly from a file:bot.add_quotes_file("path/to/file/quotes.txt")Each new line in the file is considered as a new quote.If you want to pre_process the quotes, you can pass your custom callable like so:bot = prc.Bot(
    client_id,
    client_secret,
    username,
    password,
    "u/my-bot",
    "my-favourite-subreddit"
    quote_cleaner=my_pre_processor_func
)This will callmy_pre_processor_func(quotes)and add the output to the bot instance.If no quote_cleaner is passed, a default cleaner which simple removes empty quotes is used.To run the bot, simply do:bot.run()This will run the bot continuously until the script is terminated.If the bot is run without any quotes and a localquotes.txtdoesn't exist, the run fails with aQuotesNotFoundError.LicensePyredditchatbot is provided under theSimplified BSD License
Package: pyrede
pyrede - TheElement Snooze Python Module:rocket:A Rede is a fancy snooze delayed queueUsageThe Rede is an effective 'snooze button' for events,
you push an event into it along (for future referance) and in how many seconds you want it back,
and poll whenever you want the elements back. only expired elements would pop out.import pyrede
   import redis

   rede = pyrede.Rede(redis.Redis(decode_responses=True), "demo")

   rede.push("123", 1)
   rede.push("456", 1)
   rede.push("789", 3)

   time.sleep(1)

   list(rede.poll())output-> ["123", "456"]
Package: pyredi
PyREDiOfficial REDi™ Python PackagePlease see visit theREDi documentationfor the latest information.Created atArupin San Francisco.Installpip install pyrediUsagePyREDiusage documentation.Note:Tested for Python 3.11. May work with other versions as well.Python version created and maintained by:Dr. Stevan Gavrilovic, Arup, Risk + Resilience Team, San FranciscoContact Us
Package: pyrediq
pyrediqpyrediq(py-re-ddi-ck) is a Python (2.7) library providing an
implementation of priority messaging queue usingRedis. The message
payload is serialized byMessagePack.pyrediqis licensed under theMIT License (MIT).Basic UsageimportredisfrompyrediqimportPriorityQueue,QueueEmptyredis_conn=redis.StrictRedis()# create a queuequeue=PriorityQueue('myqueue',redis_conn)# enqueue a message to the queuequeue.put({'mykey':'myvalue'},priority=-1)# create a consumerwithqueue.consumer()asconsumer:try:msg=consumer.get(block=False)exceptQueueEmpty:raisesuccess=do_task(msg.payload)# the message is either acked or rejected after task is done.# a rejected message can optionally be requeuedifsuccess:consumer.ack(msg)else:consumer.reject(msg,requeue=True)queue.close()To remove all message from a queue and remove the queue itself, runPriorityQueue.purgemethod:queue.purge()InstallationTo installpyrediqusingpip, run this command on the shell:pip install pyrediqTo usepyrediq, Redis needs to be installed and running on the
computer. For example, on a Debian box, running this command should
suffice:sudo apt-get install redis-serverConsult theofficial Redis distribution sitefor the install
procedure.
Package: pyredirect
InstallLinuxpython3 -m pip install pyredirectWindowspython -m pip install pyredirectAuthorDiscord:Lactua#1806Github:https://github.com/lactuaDocumentationBefore doing anything, import the class Redirection from the module.frompyredirectimportRedirectionCreate a redirectionTo create a redirection, use the methodcreatefrom theRedirectionclass.ParameterTypeDescriptionnamestringThe name of the redirectionredirectionsdictionnaryRedirections name and their urlExample :frompyredirectimportRedirectionredirection=Redirection.create(name='name',redirections={'default':'https://google.com','mozilla':'https://youtube.com'})Get a redirectionTo get a redirection init theRedirectionclass.ParameterTypeDescriptionnamestringThe name of the redirectionsecret_keystringThe secret key of the redirection that allows you to manage itExample :frompyredirectimportRedirectionredirection=Redirection(name='name',secret_key='wVXT8ZI81LzPPGp')Delete a redirectionTo delete a redirection you must have aRedirection object.Example :frompyredirectimportRedirectionredirection=Redirection(name='name',secret_key='wVXT8ZI81LzPPGp')redirection.delete()orfrompyredirectimportRedirectionredirection=Redirection.create(name='name',redirections={'default':'https://google.com','mozilla':'https://youtube.com'})redirection.delete()
Package: py-redis
Py-RedisA convenience wrapper for theofficial Python Redis package.
Supports the Python context manager protocol and takes care of (de-)serializing data to JSON,
as well as helper methods to work on multiple keys.Object CreationfrompyredisimportRedisConnection# pass everything you would pass to redis.Redis()redis_args={'host':'localhost',# 'password': 'my$ecureRed1s',# 'port': 1234,}withRedisConnection(**redis_args)asmy_redis:my_redis.set('key','value')Redis Get and Set# redis setwithRedisConnection(**redis_args)asmy_redis:my_redis.set('a_sting','my_sting value')my_redis.set('a_list',[1,4,3,2])my_redis.set('a_dict',{'key_1':'val_1','key_2':'val_2'})# redis getwithRedisConnection(**redis_args)asmy_redis:data=my_redis.get('a_dict')# data is already converted to a dictprint(type(data))Handle Lists and Dictionariesfrompprintimportpprint# get multiple keys / datawithRedisConnection(**redis_args)asmy_redis:# get all keys that start with a_pattern='a_'keys=my_redis.get_key_pattern(pattern)print(f"list of all keys that start with{pattern}:{keys}")data=my_redis.get_data_for_keys(keys)print(f"data of all keys that start with{pattern}:{data}")# or retrieve the data as a key: data dictionary for a specific patternprint('data as key: data dictionary for a pattern:')data=my_redis.get_keys('a_')pprint(data)# set all entries of a dictionary to redisdata={'a':12,'b':'myvalue'}withRedisConnection(**redis_args)asmy_redis:# yo can continue working with the keyskeys=my_redis.set_dict(data)print(my_redis.get('a'))print(my_redis.get(keys[1]))Fallback# you can always work directly on the redis.Redis() object,# as you would with the official package,# by using the RedisConnection.R attributewithRedisConnection(**redis_args)asmy_redis:print('access redis client through object...')print(my_redis.R.get('a_dict'))
Package: py-redis-cachetools
py-redis-cachetoolscachetools core + redisRequirements:redis 3.5.3Installation:pip install py-redis-cachetoolsenv variables:REDIS_HOST
REDIS_DBUsage:import time
import cachetools, cachetools.rcache


# cache = cachetools.rcache.RedisCache(ttl=60)

cache = cachetools.rcache.PrefixedRedisCache("hb-cachetools-cache", ttl=60)


@cachetools.cached(cache=cache)
def test(a, b):
    return {
        'hi': 'hello'
    }



a = 1
while True:
    print(test(a, 2))
    print(a)
    time.sleep(1)
    a = a+1
Package: pyrediseasyio
PyRedisEasyIOA project to simplify reading/writing single objects from/to redisDescriptionRedis is a great way to share data between applications - or processes in an application.
However, in its raw form, the application has to deal with data type conversion to/from
string, check for existence, and other pesky stuff. It would be nice if that were
abstracted in such a way to where it didn't appear in code that redis was being used
at all.This project seeks to allow the exchange of single data points in a readable way, eg.
my_data.my_value = 30 (automatically writes '30' to redis)Installationpip install pyrediseasyioUsageThe basis of functionality is the IOGroup class. It acts as a container for individual values
and performs the behind-the-scenes reads and writes.from io_group import IOGroup
from single_io import BooleanIO, IntIO, FloatIO


class TestGroup1(IOGroup):
    Bool1 = BooleanIO("Boolean 1", "Bool1", False)
    Bool2 = BooleanIO("Boolean 2", "Bool2", True)
    Int1 = IntIO("Integer 1", "Int1")
    Int2 = IntIO("Integer 2", "Int2", default=34)
    MyFloat1 = FloatIO("Float 1", "Float1", default=1.2)

class TestGroup2(IOGroup):
    Bool1 = BooleanIO("Boolean 1", "Bool1", False)
    Bool2 = BooleanIO("Boolean 2", "Bool2", True)
    Int1 = IntIO("Integer 1", "Int1")
    Int2 = IntIO("Integer 2", "Int2", default=34)
    Float1 = FloatIO("Float 1", "Float1", default=1.2)


group1a = TestGroup1()
group1b = TestGroup1()
group2 = TestGroup2()

group1a.MyFloat1 = 1234.5         # Performs redis 'set', sending 1234.5 with key 'Float1'
print(group1b.Float1.value)       # Performs redis 'get', calling 'value' converts to primitive type
print(group2.Float1.value)HTML:For convenience, methods are provided to automatically generate html. Thedominatelibrary is used behind the scenes,
giving you first class access to manipulate the html response; Below is an example of usage,
consult the test cases for further examples.class TestGroup(IOGroup):
    Bool1 = BooleanIO("Boolean 1", "Bool1", units="On/Off")
    Float1 = FloatIO("Float 1", "Float1", default=1.23, units="furlongs")


h = HMTLIOGroup(test_group, "my_id", "my_namespace").html().render()
print(h)  #-> Gives;

'''
<div class="my_namespace_io_container" id="my_id_io_container">
  <div class="my_namespace_io" id="my_id_Bool1_io">
    <div class="my_namespace_io_name">Boolean 1</div>
    <div class="my_namespace_io_value" id="my_id_Bool1_io_value" onchange="OnIOValueChange(event)">False</div>
    <div class="my_namespace_io_units">On/Off</div>
  </div>
  <div class="my_namespace_io" id="my_id_Float1_io">
    <div class="my_namespace_io_name">Float 1</div>
    <div class="my_namespace_io_value" id="my_id_Float1_io_value" onchange="OnIOValueChange(event)">1.23</div>
    <div class="my_namespace_io_units">furlongs</div>
  </div>
</div>
'''
Package: pyredishelper
pyredishelper提供redis客户端的代理对象功能.本项目代理的对象是redis-py中的四种客户端redis.Redisredis.cluster.RedisClusterredis.asyncio.Redisredis.asyncio.cluster.RedisCluster特性提供了统一的代理对象RedisProxy用于代理redis.Redis,redis.cluster.RedisCluster,redis.asyncio.Redis或redis.asyncio.cluster.RedisCluster针对生产者消费者模式提供了专用代理对象ChannelConsumerHelper,ChannelProducerHelper,QueueConsumerHelper,QueueProducerHelper,StreamConsumerPHelper,StreamProducerHelper生产者消费者提供了进一步的封装,可以通过上下文管理连接使用RedisProxy的使用我们可以使用RedisProxy延后初始化要代理的对象,从而避免客户端对象在各个函数之间传来传去.rediscli=RedisProxy()...rediscli.initialize_from_url("redis://localhost:6379/0?decode_responses=true")我们可以在运行时通过代理对象的propertyaio和propertycluster来确认是哪种客户端.当我们编程时我们应该先确定将使用哪种客户端,然后使用typing.cast方法在调用前声明类型.多数时候我们并不需要标明实际的类型,可以只区分同步和异步和具体使用:同步:r=cast(redis.commands.core.DataAccessCommands,rediscli)r.get("x")异步:r=cast(redis.commands.core.AsyncDataAccessCommands,rediscli)awaitr.get(x)这样我们在写程序是也可以有接口提示.只有用到pubsub,execute_command或者pipeline的少数场景时需要指定具体类型.生产者消费者模式生产者消费者模式提供了基本统一的接口设计ConsumerProtocol通用的同步消费者接口ProducerProtocol除了stream外通用的同步生产者接口AioConsumerProtocol通用的异步消费者接口AioProducerProtocol除了stream外通用的异步生产者接口StreamProducerProtocolstream的同步生产者接口AioStreamProducerProtocolstream的异步生产者接口当我们编程时我们应该先确定将使用哪种客户端,然后使用typing.cast方法在调用前声明对应代理的接口类型.同步生产者qp=cast(StreamProducerProtocol,StreamProducerHelper.from_proxy(rediscli,maxlen=20))withqp.mount()asproducer:foriinrange(10):producer.publish(topic,value)异步生产者qp=cast(AioStreamProducerProtocol,StreamProducerHelper.from_proxy(rediscli,maxlen=20))asyncwithqp.mount()asproducer:foriinrange(10):awaitproducer.publish(topic,value)同步消费者qc=cast(ConsumerProtocol,QueueConsumerHelper.from_proxy(rediscli,topics))withqc.watch()asrecords:forrecordinrecords:print(f"get msg{record.value}from topic{record.topic}")异步消费者qc=cast(AioConsumerProtocol,QueueConsumerHelper.from_proxy(rediscli,topics))asyncwithqc.watch()asrecords:asyncforrecordinrecords:print(f"get msg{record.value}from topic{record.topic}")安装pipinstallpyredishelper0.0.2新增list,pubsub,stream3种常用生产者消费者结构的代理类型细化注释文档0.0.1项目创建
MIT LicenseCopyright (c) 2023 Python-ToolsPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: pyredis-rate-limiter
This is an implementation ofGCRAfor rate limiting based on Redis.The code requires Redis version 3.2 or newer since it relies onreplicate_commandsfeature.How to Install?pipinstallpyredis-rate-limiterHow to Use?Here is a short example.# -*- coding: utf-8 -*-importasynciofromtypingimportOptionalimportredisasaio_redisfromloguruimportloggerasloguru_loggerfrompyredis_rate_limiterimport(Limit,Limiter,per_second)_rl_instance:Optional[Limiter]=Nonedefinit_rl_instance(redis_conn:aio_redis.Redis):global_rl_instance_rl_instance=Limiter(redis_conn)defrl_instance()->Limiter:return_rl_instanceasyncdeftake_token(key:str,limit:Limit,block_wait:bool=False)->Optional[int]:token:Optional[int]=Noneret,_=awaitrl_instance().aio_allow(key,limit)ifretisNone:returntokenifret.allowed==0:ifblock_wait:wait_until_available=ret.retry_after_in_secloguru_logger.warning(f"Token for key:{key}exceeds, wait{wait_until_available}secs until resource turns to be available")awaitasyncio.sleep(ret.retry_after_in_sec)else:loguru_logger.error(f"no token available for key:{key}")else:token=1returntokenasyncdefsend_sm():token=awaittake_token(key="send_sm_handler",limit=per_second(5))iftokenisNone:# do sthelse:# do sth
Package: py_redis_simple_queue
Redis simple queueVery simple implementation from article :http://peter-hoffmann.com/2012/python-simple-queue-redis-queue.htmlusagepipinstallpy_redis_simple_queueThe senderfromredisimportRedisfromredis_simple_queueimportRedisQueueconnection=Redis()# see docs at https://docs.objectrocket.com/redis_python_examples.htmlqueue=RedisQueue('my_queue',connection)queue.put('my message')The workerfromredisimportRedisfromredis_simple_queueimportWorker,RedisQueueclassMyWorker(Worker):defrun(self,msg):print(msg)# do something with messageconnection=Redis()queue=RedisQueue('my_queue',connection)worker=MyWorker(queue)worker.dequeue()
Package: pyredlock
pyredlock - A Redis distributed lock implementation in PythonThis python lib implements the Redis-based distributed lock manager algorithmdescribed in this blog post.How to use it?To create a lock manager:frompyredlockimportRedisClientfrompyredlockimportRedlock,Lock...client=RedisClient(client_conf={"endpoint":"localhost:6379","password":"your_redis_password","db":0,"socket_timeout":0.5,"socket_connect_timeout":0.25})lock_mgr=Redlock(connections=[client.get_connection()],async_mode=False)...To acquire a lock:...success,my_lock=lock_mgr.lock("my_resource_name",1000)...To release a lock:...lock_mgr.unlock(my_lock)...To extend your ownership of a lock that you already own:...lock_mgr.extend(my_lock,1000)...Disclaimer: This implementation is currently a proposal, it was not formally analyzed. Make sure to understand how it works before using it in your production environments.
Package: pyRedmineClient
# redmine-cliA simple redmine client## InstallationThe project is available at Pypy and you can simply install in the usually way:```bashpip install red```You can install the last version in github in this way:```bashpython setup.py install```If you get the warning InsecureRequestWarning while running the command, this is likely that you are running an oldpython version that uses a deprecated ssl version.You'd better upgrade to a newer python interpreter but if you can not, you can omit the warning with this command:```bashpip install 'requests[security]'```## Usage```shexport REDMINE_ENDPOINT=xxxexport REDMINE_API_KEY=xxx./redmine --help./redmine list --help./redmine detail --help./redmine close --help```## TODO- pip install- create issue- docs