Saravanan666/pypi-org huggingface dataset:
Package: redirector
Control redirects through WSGI middleware.redirector is a piece of WSGI middleware that allows redirects to be
managed within the scope of a python web service.  Traditionally,
redirects are done via Apache or some other web server disparate from
the python application.  This leads to several undesirable
consequences:there is no way of controlling redirects through the webthe web server must be restarted when redirects are changedBecause of this methodology of doing things, it discourages the
stake-holders (the people that actually care about the redirects) from
changing the redirects themselves.  Because the redirects are not, in
their mind, content, this leads to unmaintainable systems.  The goal
of redirector is to bring the power to create redirects to any
authorized user.StatusRedirector is largely in the conceptual stage.  While what redirector
does now (regular expression redirects) is sufficient to reproduce
Apache’s behavior, it is not enough to realize the vision of bringing
redirects to the people for WSGI apps.Even this documentation is thoroughly imcomplete.TODOredirector needs several pieces to become what it should be:Types of RedirectsCurrently, only regular expression redirects (a la Apache) are
implemented. Another possibility, probably more applicable, are
something like glob redirects.  The reason that these are useful is
that they, with a carefully constructed rule system, can be seen to
match each other.  In other words, you can see if the existing set of
redirects is contradictory and if there are superfluous redirects.  It
also better matches how non-experts think about redirects.
Package: redirector.io
# Redirector.ioWelcome to Redirector.io, a powerful package designed to handle all your URL redirection needs!## DescriptionRedirector.io is a robust and efficient package that provides easy-to-use functions for URL redirection. Whether you're managing a small personal project or a large-scale web application, Redirector.io can simplify your redirection tasks.## InstallationTo install the package, use the following command:

```bash
pip install redirector.ioUsageHere's a basic example of how to use Redirector.io:fromredirectorimportRedirector# Create a Redirector objectredir=Redirector()# Add a redirection ruleredir.add_rule("/old-url","/new-url")# Now, /old-url will be redirected to /new-urlDocumentationIt's crucial to read the documentation before using Redirector.io.The documentation provides comprehensive details about all the features and functionalities of the package. It also includes various examples and best practices to help you make the most of Redirector.io.You can access the documentationhere.SupportIf you encounter any issues or have any questions, please open an issue on ourGitHub page.LicenseRedirector.io is licensed under the MIT License. SeeLICENSEfor more information.ConclusionThank you for choosing Redirector.io for your URL redirection needs. We hope you find it useful and easy to use. Happy coding!
Package: redirects_cli
redirects-cliA CLI to create static redirections from a YAML file.Why?You are relying on GitHub Pages to host your site. However, whenever you move a page from one folder to another, your users get the 404 page.Withredirects-cli, you can define 301 redirects for the pages you have moved in a YAML file. Then, you can generate static redirects for each page with one command.In my case, I use this CLI tool in the project's CI pipelines before publishing the site to thegh-pagesbranch.Getting startedRequirementsPython >= 3.7pipInstallationpip install redirects_cliQuickstartredirects-cli --helpUsageGenerate redirects from a static fileTo generate static redirects from a YAML file:Define the redirects in a new file namedredirects.yaml. This file must follow this syntax:# old_path: new_path
# Example

# internal link example
/original-path/page-a.html: /new-path/page-a.html

# external link example
/original-path/page-b.html: https://example.localRun the command:redirects-cli fromfile --yaml-file redirects.yaml --output-dir htmlThe CLI creates the static redirects you have defined in theredirects.yamlfile within the folderhtml.
For this example, it creates the following folder structure:my-project/
├─ html/
│  ├─ original-path/page-a.html
│  ├─ original-path/page-b.html
├─ redirects.yamlCreate a single redirectTo create a single redirect, you can run the command:redirects-cli --output-file index.html  --redirect-to https://davidgarcia.devThis command creates a 301 redirect tohttps://davidgarcia.devin the fileindex.html.ContributingContributions are welcome and appreciated!
If you want to enhance the CLI, please readCONTRIBUTING.mdfile first.LicenseCopyright (c) 2022-present David Garcia (@dgarcia360). Licensed under theMIT License.
Package: redirect-streams
Package DocumentationDescriptionThis project provides Python context managers to help redirect multiple
forms of output into a buffer (capturing the output).Installation$pipinstallredirect-streamsBasic UsageThe most common use of this project is to redirectstdout.fromioimportBytesIO,SEEK_SET,TextIOWrapperfromosimportsystemfromsysimportstdoutfromredirect_streamsimportredirect_stdoutwithTextIOWrapper(BytesIO(),stdout.encoding)asbuffer:withredirect_stdout(buffer):print('this will be saved in the buffer')# code below won't work with stdlib's redirect_stdoutsystem('this will be saved in the buffer')buffer.seek(SEEK_SET)saved=buffer.read()print(saved)For other context managers and more detailed information, please refer
to thedocumentation.
Package: redirect-webfinger
This simple webfinger implementation just redirects
a single webfinger address to another server. I use it to
allow people to find my mastodon profile via my
personal server.Example usage:$ redirect-webfinger --acct=jelmer@jelmer.uk \
     --mastodon-server=mastodon.cloud \
     --mastodon-user=jelmerThe only URL it exposes is /.well-known/webfinger, which
you would probably want to expose via your reverse HTTP proxy.Or using docker/podman:$ podman run ghcr.io/jelmer/redirect-webfinger \
     -e ACCT=jelmer@jelmer.uk \
     -e MASTODON_SERVER=mastodon.cloud \
     -e MASTODON_USER=jelmer
Package: redis2hdfs
redis2hdfs is a command line tool to help you export Redis data to HDFS.NOTE: ensure WebHDFS is enabled.Installation$ pip install redis2hdfsUsage$ redis2hdfs --redis-key myzset --namenode-host namenode.example.com --hdfs-username hdfs --hdfs-path /tmp/myzset.lzo --compress-format lzoredis2hdfs could compress file before copy to HDFS, through--compress-formatoption. Currently supported compress formats are: LZO.If you want to use LZO format, you need installlzopfirst.Development$ mkvirtualenv redis2hdfs
$ python setup.py develop
Package: redis2http
redis2httpRedis2http takes request data from redis and performs HTTP request.
Mostly used to implement web-hook callsWhy not requests.get/requests.post ?Most likely you want main program to run fast and spend very short time on calling hook. HTTP requests are not good for it - it may fail or be slow for many reasons. On other hand, LPUSH operation with local redis is always very quick and very reliable.redis2http is good if a) You do not need to wait for HTTP request completion b) You do not need to get any reply from requestInstallpip3 install redis2httpIf you want to start on boot (as root or sudo):cp /usr/local/redis2http/redis2http.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable redis2http
systemctl start redis2httpUsage for CLICLI is not main purpose for redis2http, but it's good for testing. Examples:To start as service in foreground (for debugging), just runredis2http.py(not options required).To send request via redis (for debugging):redis2http.py --send GET https://google.com/After this (in less then second), you can see result in redis2http service output. If redis2http runs as systemd service, thensudo journalctl -u redis2http.Usage from Python or from whatever (via redis)Put JSON-encoded data structure tohttp_requests_queuelist (or use-qfor other key name). Python example:data={'method':'GET','url':'https://example.com/hook','payload':None}request=json.dumps(data)redis_connection.sadd('http_requests_queue',request)Set vs Listredis2http may use queue as redis object of typesetor typelist. You may specify type as--typeCLI option. Default isset.If you will use set and submit same data twice, only one HTTP request will be performed. If you will use list, both requests will be performed.
Package: redisai
redisai-py is the Python client for RedisAI. Checkout thedocumentationfor API details and examplesInstallationInstall Redis 5.0 or aboveInstallRedisAIInstall the Python client$pipinstallredisaiInstall serialization-deserialization utility (optional)$pipinstallml2rtDevelopmentAssuming you have virtualenv installed, create a virtualenv to manage your python dependencies, and activate it.`virtualenv-vvenv; source venv/bin/activate`Install [pypoetry](https://python-poetry.org/) to manage your dependencies.`pip install poetry`Install dependencies.`poetry install--no-root`[tox](https://tox.readthedocs.io/en/latest/) runs all tests as its default target. Runningtoxby itself will run unit tests. Ensure you have a running redis, with the module loaded.ContributingPrior to submitting a pull request, please ensure you’ve built and installed poetry as above. Then:Run the linter.`tox-elinters.`Run the unit tests. This assumes you have a redis server running, with the [RedisAI module](https://redisai.io) already loaded.  If you don’t, you may want to install a [docker build](https://hub.docker.com/r/redislabs/redisai/tags).`tox-etests`RedisAI example reposhows few examples
made using redisai-py underpython_clientfolder. Also, checkoutml2rtfor convenient functions those might help in
converting models (sparkml, sklearn, xgboost to ONNX), serializing models to disk, loading
it back to redisai-py etc.
Package: redisamp
RedisampA Redis UI in your terminalInstallInstall via pip:pipinstallredisampInstall via pipx:pipxinstallredisampRunredisamp[-u$REDIS_URL]RoadmapSettingsConnection settingsSSH tunnelingCLI settingsConfiguration fileConnection switchingKey actions - all keysDeleteSet TTLRename (?)Monitorredis-cliredis-cli process window (?)redis console paneloutput formattingcommand formatting (highlight, auto-complete?)
Package: redisary
RedisaryRedis is a key-value database. Interestingly Python dictionaries are some how key-value data structure. So why not write
a wrapper that maps Python dictionary to Redis server.InstallationSimply you can install it from PyPi by following command:pipinstall-Uredisaryor if you prefer the latest development version, you can install it from the source:gitclonehttps://github.com/xurvan/redisary.gitcdredisary
pythonsetup.pyinstallQuickstartA very simple usage could be like:fromredisaryimportRedisaryredis=Redisary(host='127.0.0.1',db=0)redis['k']='data'data=redis['k']Well it works like a normal dictionary, the only advantage is data now stored on Redis and we could access it from
another process.We also could set an expire for all keys of dictionary:fromredisaryimportRedisaryredis=Redisary(expire=800)redis['k']='temporary'TODOMap Redis 'string' to Python 'str'Map Redis 'list' to Python 'list'Map Redis 'hash' to Python 'dict'Map Redis 'set' to Python 'set'Map Redis 'sorted set' to something!
Package: redis-astra
redis-astraRedis-astra is Python light ORM for Redis.Note: version 2 has uncomportable changes with version 1. SeeCHANGELOG.txtExample:importredisfromastraimportmodelsdb=redis.StrictRedis(host='127.0.0.1',decode_responses=True)classSiteObject(models.Model):defget_db(self):returndbname=models.CharHash()classUserObject(models.Model):defget_db(self):returndbname=models.CharHash()login=models.CharHash()site=models.ForeignKey(to=SiteObject)sites_list=models.List(to=SiteObject)viewers=models.IntegerField()defsave(self,action,attr=None,value=None):print('\t*%s'%kwargs)So you can use it like this:>>>user=UserObject(pk=1,name="Mike",viewers=5)*{'action':'post_init','value':{'name':'Mike','viewers':5}}>>>user.login='mike@null.com'*{'action':'pre_assign','attr':'login','value':'mike@null.com'}*{'action':'post_assign','attr':'login','value':'mike@null.com'}>>>user.login'mike@null.com'>>>user.viewers_incr(2)7>>>site=SiteObject(pk=1,name="redis.io")>>>user.site=site*{'attr':'site','action':'m2m_link','value':<ModelSiteObject(pk=1)>}>>>user.sites_list.lpush(site,site,site)3>>>len(user.sites_list)3>>>user.sites_list[2].name'redis.io'>>>user.site=None*{'attr':'site','action':'m2m_remove'}>>>user.remove()*{'action':'pre_remove','attr':'pk','value':'1'}*{'action':'post_remove','attr':'pk','value':'1'}InstallPython versions 2.6, 2.7, 3.3, 3.4, 3.5 are supported
Redis-py versions >= 2.9.1pipinstallredis-astra
Package: redis-async
redis-asyncA simple redis async wrapper for python3NOTE:Not all redis command are covered yet. Please use it after release0.1.0.Setup & InstallVia pippip install redis_asyncFrom sourcepython setup.py build && python setup.py installExamplefrom redis_async import RedisHash, Redis


# Initialize redis store
Redis.initialize(url='redis://redis:port', prefix='application')

class Store:
  # actual redis key will be like: "application:user:1"
  User = RedisHash(tpl="user:{id}")

def process_user(id):
  # preprocess code ...
  user = Store.User.hgetall(id)
  # process user block
  # ...

async def process_user_async(id):
  # preprocess code ...
  user = await Store.User.hgetallAsync(id)
  # process user block
  # ...
Package: redis-bandit
redis-banditA Python, redis-backed, distributed Multi-Armed Bandit Framework. The goal is being able to scale a MAB horizontally.Installationpipinstall-Uredis-banditor install withPoetrypoetryaddredis-banditMakefile usageMakefilecontains a lot of functions for faster development.1. Download and remove PoetryTo download and install Poetry run:makepoetry-downloadTo uninstallmakepoetry-remove2. Install all dependencies and pre-commit hooksInstall requirements:makeinstallPre-commit hooks coulb be installed aftergit initviamakepre-commit-install3. CodestyleAutomatic formatting usespyupgrade,isortandblack.makecodestyle# or use synonymmakeformattingCodestyle checks only, without rewriting files:makecheck-codestyleNote:check-codestyleusesisort,blackanddarglintlibrary4. Code securitymakecheck-safetyThis command launchesPoetryintegrity checks as well as identifies security issues withSafetyandBandit.makecheck-safety5. Type checksRunmypystatic type checkermakemypy6. TestsRunpytestmaketest7. All lintersOf course there is a command torulerun all linters in one:makelintthe same as:maketest&&makecheck-codestyle&&makemypy&&makecheck-safety8. CleanupDelete pycache filesmakepycache-removeRemove package buildmakebuild-removeOr to remove pycache, build and docker image run:makeclean-all📈 ReleasesYou can see the list of available releases on theGitHub Releasespage.We followSemantic Versionsspecification.We useRelease Drafter. As pull requests are merged, a draft release is kept up-to-date listing the changes, ready to publish when you’re ready. With the categories option, you can categorize pull requests in release notes using labels.List of labels and corresponding titlesLabelTitle in Releasesenhancement,feature🚀 Featuresbug,refactoring,bugfix,fix🔧 Fixes & Refactoringbuild,ci,testing📦 Build System & CI/CDbreaking💥 Breaking Changesdocumentation📝 Documentationdependencies⬆️ Dependencies updatesYou can update it inrelease-drafter.yml.GitHub creates thebug,enhancement, anddocumentationlabels for you. Dependabot creates thedependencieslabel. Create the remaining labels on the Issues tab of your GitHub repository, when you need them.🛡 LicenseThis project is licensed under the terms of theApache Software License 2.0license. SeeLICENSEfor more details.📃 Citation@misc{redis-bandit,author={fernandocamargoai},title={A Python, redis-backed, distributed Multi-Armed Bandit Framework. The goal is being able to scale a MAB horizontally.},year={2021},publisher={GitHub},journal={GitHub repository},howpublished={\url{https://github.com/deeplearningbrasil/redis-bandit}}}CreditsThis project was generated withpython-package-template
Package: redisbayes
name:redisbayesdescription:Naïve Bayesian Text Classifier on RedisCopyright:© 2012 Justine Alexandra Roberts Tunneylicense:MITWhat Is This?It’s a spam filter.  I wrote this to filter spammy comments from a high
traffic forum website and it worked pretty well.  It can work for you too :)
It’s not tied to any particular format like email, it just deals with the raw
text.This is probably the only spam filtering library you’ll find for Python that’s
simple (170 lines of code), works (30 lines of test code), and doesn’t suck.InstallationFrom folder:sudo python setup.py installFrom cheeseshop:sudo pip install redisbayesFrom git:sudo pip install git+git://github.com/jart/redisbayes.gitBasic Usageimport redis, redisbayes
rb = redisbayes.RedisBayes(redis=redis.Redis())

rb.train('good', 'sunshine drugs love sex lobster sloth')
rb.train('bad', 'fear death horror government zombie god')

assert rb.classify('sloths are so cute i love them') == 'good'
assert rb.classify('i fear god and love the government') == 'bad'

print rb.score('i fear god and love the government')

rb.untrain('good', 'sunshine drugs love sex lobster sloth')
rb.untrain('bad', 'fear death horror government zombie god')
Package: redisbench-admin
redisbench-adminRedis benchmark run helper can help you with the following tasks:Setup abd teardown of benchmarking infrastructure specified
onredis-performance/testing-infrastructureSetup and teardown of an Redis and Redis Modules DBs for benchmarkingManagement of benchmark data and specifications across different setupsRunning benchmarks and recording resultsExporting performance results in several formats (CSV, RedisTimeSeries, JSON)Finding on-cpu, off-cpu, io, and threading performance problems by attaching profiling tools/probers ( perf (a.k.a. perf_events), bpf tooling, vtune )[SOON]Finding performance problems by attaching telemetry probesCurrent supported benchmark tools:redis-benchmarkmemtier_benchmarkredis-benchmark-goYCSBtsbsredisgraph-benchmark-goftsb_redisearchann-benchmarksInstallationInstallation is done using pip, the package installer for Python, in the following manner:python3-mpipinstallredisbench-adminProfiler daemonYou can use the profiler daemon by itself in the following manner.
On the target machine do as follow:pip3install--upgradepip
pip3installredisbench-admin--ignore-installedPyYAML# install perfaptinstalllinux-tools-commonlinux-tools-genericlinux-tools-`uname-r`-y# ensure perf is workingperf--version# install awsclisnapinstallaws-cli--classic# configure awsawsconfigure# start the perf-daemonperf-daemonstart
WARNING:root:Unabletodetectedgithub_actor.caughtthefollowingerror:Nosection:'user'Writtinglogto/tmp/perf-daemon.log
Startingperf-daemon.PIDfile/tmp/perfdaemon.pid.Daemonworkdir:/root/RedisGraph# check daemon is working appropriatellycurllocalhost:5000/ping# start a profilecurl-XPOSTlocalhost:5000/profiler/perf/start/<pidtoprofile># stop a profilecurl-XPOST-d'{"aws_access_key_id":$AWS_ACCESS_KEY_ID,"aws_secret_access_key":$AWS_SECRET_ACCESS_KEY}'localhost:5000/profiler/perf/stop/<pidtoprofile>DevelopmentInstallpypoetryto manage your dependencies and trigger tooling.pipinstallpoetryInstalling dependencies from lock filepoetry installRunning formaterspoetryrunblack.Running linterspoetryrunflake8Running testsA test suite is provided, and can be run with:$toxTo run a specific test:$tox--tests/test_redistimeseries.pyLicenseredisbench-admin is distributed under the BSD3 license - seeLICENSE
Package: redisbloom
Python client for RedisBloomredisbloom-py is a package that gives developers easy access to several probabilistic data structures. The package extendsredis-py's interface with RedisBloom's API.Installation$ pip install redisbloomUsage example# Using Bloom Filterfromredisbloom.clientimportClientrb=Client()rb.bfCreate('bloom',0.01,1000)rb.bfAdd('bloom','foo')# returns 1rb.bfAdd('bloom','foo')# returns 0rb.bfExists('bloom','foo')# returns 1rb.bfExists('bloom','noexist')# returns 0# Using Cuckoo Filterfromredisbloom.clientimportClientrb=Client()rb.cfCreate('cuckoo',1000)rb.cfAdd('cuckoo','filter')# returns 1rb.cfAddNX('cuckoo','filter')# returns 0rb.cfExists('cuckoo','filter')# returns 1rb.cfExists('cuckoo','noexist')# returns 0# Using Count-Min Sketchfromredisbloom.clientimportClientrb=Client()rb.cmsInitByDim('dim',1000,5)rb.cmsIncrBy('dim',['foo'],[5])rb.cmsIncrBy('dim',['foo','bar'],[5,15])rb.cmsQuery('dim','foo','bar')# returns [10, 15]# Using Top-Kfromredisbloom.clientimportClientrb=Client()rb.topkReserve('topk',3,20,3,0.9)rb.topkAdd('topk','A','B','C','D','E','A','A','B','C','G','D','B','D','A','E','E')rb.topkQuery('topk','A','B','C','D')# returns [1, 1, 0, 1]rb.topkCount('topk','A','B','C','D')# returns [4, 3, 2, 3]rb.topkList('topk')# returns ['A', 'B', 'E']rb.topkListWithCount('topk')# returns ['A', 4, 'B', 3, 'E', 3]APIFor complete documentation about RedisBloom's commands, refer toRedisBloom's website.LicenseBSD 3-ClauseDevelopmentCreate a virtualenv to manage your python dependencies, and ensure it's active.virtualenv -v venvInstallpypoetryto manage your dependencies.pip install poetryInstall dependencies.poetry installtoxruns all tests as its default target. Runningtoxby itself will run unit tests. Ensure you have a running redis, with the module loaded.
Package: redis-bloom-filter
pyredisbloomfilterpython bloom filter based on redispython versionpython2.7.x and python 3.5+ is supportedredis client requirementsbasic dependency redis-pyif your redis is in cluster mode, you must import rediscluter from package redis-py-cluster by yourselfnote: redis-py-cluster does not support pipeline with transactionhow to useimportredisimportredisbloomfiltername="bloomfilter"number_of_insertion=10000000error_rate=0.00001redis_client=redis.StrictRedis()bloom_filter=redisbloomfilter.RedisBloomFilter(name,number_of_insertion,error_rate,redis_client)try:bloom_filter.initialize()exceptredis.RedisError:print('occurs redis error')raiseexceptredisbloomfilter.BloomFilterException:print('bloom filter exception')raisebloom_filter.put("abc")bloom_filter.contains("abc")
Package: redisbloom-py
Python client for RedisBloomredisbloom-py is a package that gives developers easy access to several probabilistic data structures. The package extendsredis-py's interface with RedisBloom's API.Installation$ pip install redisbloomUsage example# Using Bloom Filterfromredisbloom.clientimportClientrb=Client()rb.bfCreate('bloom',0.01,1000)rb.bfAdd('bloom','foo')# returns 1rb.bfAdd('bloom','foo')# returns 0rb.bfExists('bloom','foo')# returns 1rb.bfExists('bloom','noexist')# returns 0# Using Cuckoo Filterfromredisbloom.clientimportClientrb=Client()rb.cfCreate('cuckoo',1000)rb.cfAdd('cuckoo','filter')# returns 1rb.cfAddNX('cuckoo','filter')# returns 0rb.cfExists('cuckoo','filter')# returns 1rb.cfExists('cuckoo','noexist')# returns 0# Using Count-Min Sketchfromredisbloom.clientimportClientrb=Client()rb.cmsInitByDim('dim',1000,5)rb.cmsIncrBy('dim',['foo'],[5])rb.cmsIncrBy('dim',['foo','bar'],[5,15])rb.cmsQuery('dim','foo','bar')# returns [10, 15]# Using Top-Kfromredisbloom.clientimportClientrb=Client()rb.topkReserve('topk',3,20,3,0.9)rb.topkAdd('topk','A','B','C','D','E','A','A','B','C','G','D','B','D','A','E','E')rb.topkQuery('topk','A','B','C','D')# returns [1, 1, 0, 1]rb.topkCount('topk','A','B','C','D')# returns [4, 3, 2, 3]rb.topkList('topk')# returns ['A', 'B', 'E']rb.topkListWithCount('topk')# returns ['A', 4, 'B', 3, 'E', 3]APIFor complete documentation about RedisBloom's commands, refer toRedisBloom's website.LicenseBSD 3-ClauseDevelopmentCreate a virtualenv to manage your python dependencies, and ensure it's active.virtualenv -v venvInstallpypoetryto manage your dependencies.pip install poetryInstall dependencies.poetry installtoxruns all tests as its default target. Runningtoxby itself will run unit tests. Ensure you have a running redis, with the module loaded.