Saravanan666/pypi-org huggingface dataset:
Package: drakeutil
Utilities for making life easier in Python withDrakeworkflows.InstallingRunpip install drakeutil.UsingFor Python steps inside your workflow include the line:from drakeutil import *This will populate the special family of variablesINPUT,OUTPUTfrom the environment. For example:somefile.out <- somefile.in [python]
    from drakeutil import *
    with open(INPUT) as istream:
        with open(OUTPUT) as ostream:
            for l in istream:
                for word in l.split():
                    print >> ostream, wordIn the future we might add more helpers. Can you think of any that would be useful?Changelog0.1.0Support specialINPUTandOUTPUTfamily of environment variablesProvidemysql_cursorhelper whenMySQLdbmodule is installed
Package: drakken
DrakkenA minimalistWSGIweb framework written inPython. Uses theSQLAlchemydatabase toolkit, theMakotemplate engine, and theWebObWSGI library.Installpip3 install drakkenQuickstartCreate a filedemo.pyand paste the following code into it:from drakken.core import Drakken
 app = Drakken()

 @app.route('/')
 def home(request, response):
     response.text = 'Hello from the HOME page'

 if __name__ == "__main__":
     app.runserver()Launch demo.py:python3 demo.pyVisit the demo app'shome page. You should see a web page with the messageHello from the HOME page.LinksProject pageLicenseMIT License.Contact MeSend bug reports and patches tocraig@seagrape.us.
Package: dral
D-RAL - Device Register Access LayerWhat is it?D-RAL is a register access code generator for any device, chip or embedded system. The goal is to provide a simple and consistent way to access the internal registers of the device.
Every embedded project requires the programmer to manipulate registers. D-RAL is trying to address this and provide an easy way to access registers.
The main motivation for creating this project was to design a register access layer for modern C++ programming language.Main functionalityMain functionality is to generate a register access layer based on the device register description input for the C++ programming language.
Currently, D-RAL only supports the SVD format as an input file with a description of the registers.SVDis an ARM-created format that formalizes the description of the system inside microcontrollers based on Arm Cortex-M processors, specifically the memory mapped registers of peripherals.
It is a widely used format by many companies.
It is also possible to use your own register description format in D-RAL by writing an adapter that translates it to know for the D-RAL form. More about this on the wiki page.
D-RAL generates a set of header files that you can simply copy and paste into your existing project.ExampleLet's take the STM32F411 microcontroller and its general-purpose timers as an example. We want to configure the TIM2 timer as a countdown timer. To do this, we need to set the direction bit in one of the timer's control registers.We can accomplish this in C++ by utilizing raw pointers:constexpruint32_tTim2Cr1Address=0x4000'0000;constexpruint32_tTim2Cr1DirPos=4;constexpruint32_tTim2Cr1DirMask=0x1;volatileuint32_t*Tim2Cr1Reg=reinterpret_cast<volatileuint32_t*>(Tim2Cr1Address);*Tim2Cr1Reg=(*Tim2Cr1Reg&~(Tim2Cr1DirMask<<Tim2Cr1DirPos))|((1&Tim2Cr1DirMask)<<Tim2Cr1DirPos);Or we can use D-RAL:dral::stm32f411::tim2::cr1::dir::write(1);This is a brief example to demonstrate D-RAL's purpose. More information can be found on the Wiki page.Main benefits of using D-RAL:Simple and clean syntax,Less code,No need to warry about bit shifting and masking,No run-time overheadInstallingThe easiest way to install D-RAL is withpipx.pipx install dralYou can also install D-RAL withpip:pip install dralWhichever method you use, you should have adralcommand on your path.UsageD-RAL is a CLI tool that takes two positional argumentsdral [OPTIONS] INPUT OUTPUTINPUT - path to external device description fileOUTPUT - a path where D-RAL files will be generated.Extra functionalityThe D-RAL generator is flexible enough to be easily adapted to generate register access layers for other programming languages or for other use cases.
More about it on the Wiki page.
Package: dram
Dram - Keeping your package manager packagedAuthor:Scott TorborgDram is a POSIX-specific tool for managing shell environments. The basic
goal is to make it possible to install new shell-based software, from a number
of different sources, with the confidence that it won’t mess up your global
environment.Please seethe documentation.LicenseDram is licensed under an MIT license. Please see the LICENSE file for more
information.
Package: dramatiq
dramatiqA fast and reliable distributed task processing library for Python 3.Changelog:https://dramatiq.io/changelog.htmlCommunity:https://groups.io/g/dramatiq-usersDocumentation:https://dramatiq.ioSponsorsFranz: Desktop Client for Apache KafkaInstallationIf you want to use it withRabbitMQpip install 'dramatiq[rabbitmq, watch]'or if you want to use it withRedispip install 'dramatiq[redis, watch]'QuickstartMake sure you've gotRabbitMQrunning, then create a new file calledexample.py:importdramatiqimportrequestsimportsys@dramatiq.actordefcount_words(url):response=requests.get(url)count=len(response.text.split(" "))print(f"There are{count}words at{url!r}.")if__name__=="__main__":count_words.send(sys.argv[1])In one terminal, run your workers:dramatiq exampleIn another, start enqueueing messages:python example.py http://example.com
python example.py https://github.com
python example.py https://news.ycombinator.comCheck out theuser guideto learn more!Licensedramatiq is licensed under the LGPL.  Please seeCOPYINGandCOPYING.LESSERfor licensing details.
Package: dramatiq-abort
dramatiq-abortAdd the aborting feature todramatiqthrough a simple middleware with flexible backend.Current version support aborting using theRedisstore.InstallationSince the only available backend right now isRedis:pip install dramatiq_abort[redis]Documentation:http://flared.github.io/dramatiq-abortQuickstartfromdramatiqimportget_brokerfromdramatiq_abortimportAbortable,backends,abortabortable=Abortable(backend=backends.RedisBackend())get_broker().add_middleware(abortable)# ...importdramatiq@dramatiq.actordefmy_long_running_task():...message=my_long_running_task.send()# Now abort the message.abort(message.message_id)
Package: dramatiq-apscheduler
Dramatiq ApSchedulerAllows simple command line usage of ApScheduler to add tasks directly to Dramatiq. It is designed to support multiple concurrent scheduler process such as in the case of Elastic Beanstalk.You can run multiple process and each one will check if it's the leader before executing any tasks.RequirementsThe application uses rabbitmq and redis.By default both rabbitmq and redis will just use localhost but on most systems you are running these services on another server. You can configure both redis and rabbitmq by providing the connection urls as optionsredis_urlandrabbitmqor environment variablesSCHEDULE_REDIS_URLandSCHEDULE_RABBITMQ.ConfigBelow is a minimal example of the config. To add more tasks just simply edit thejobsconfig option.jobs:trigger_feed_run_every_10_minutes:func:run_feedscrontab:"*/10****"trigger_test_task:func:test_taskcrontab:"*/1****"queue_name:testTriggersCurrently only one trigger is supportedcrontab. We recommend you usehttps://crontab.guru/to validate your expressions.UsageJust run the task to start the process. You can also add the--debugflag to get extra logging.Usage: dramatiq_apscheduler [OPTIONS] TASK_FILE

Options:
  --debug           Enables debug logging
  --rabbitmq TEXT   rabbitmq connection url: amqp://127.0.0.1:5672/
  --redis_url TEXT  redis connection url: redis://localhost/
  --expire INTEGER  How long the lock should last for
  --help            Show this message and exit.You can run with the demo config:dramatiq_apscheduler config.yamlDevelopmentThe easiest way to develop this application is in a venv. You can see more details in theclick documentationbut if your venv is setup just run the below command.pip install --editable .DockerfileAdocker imageis also provided which allows you to easily run the application anywhere.docker pull scollins/dramatiq-apscheduler
docker run scollins/dramatiq-apscheduler
Package: dramatiq_azure
dramatiq-azureADramatiqbroker that can be used withMicrosoft Azurequeue services.Heavily inspired byDramatiq SQS, this package currently implements a broker forAzure Storage Queue.
An implementation forAzure Service Busis planned... eventually.Installationpipinstalldramatiq-azurepipinstalldramatiq-azure[identity]# for passwordless authenticationUsageASQBrokerimportdramatiqfromdramatiq.middlewareimportAgeLimit,TimeLimit,Callbacks,Pipelines,Prometheus,Retriesfromdramatiq_azureimportASQBrokerbroker=ASQBroker(dead_letter=True,middleware=[Prometheus(),AgeLimit(),TimeLimit(),Callbacks(),Pipelines(),Retries(min_backoff=1000,max_backoff=900000,max_retries=96),],)dramatiq.set_broker(broker)AuthenticationThe following authentication methods are supported by the broker:Connection string based:AZURE_STORAGE_CONNECTION_STRenvironment variable must be set.
If this variable is not set, passwordless authentication will be used.
Creating a connection string for your Azure account is documentedhere.Passwordless(token-based) authentication(Recommended):AZURE_STORAGE_ACCOUNT_NAMEenvironment variable must be set.The list of other mandatory variables depends on where the app is being run.
More information can be foundhere.Environment variablesThe following environment variables can be used to configure the broker:AZURE_STORAGE_CONNECTION_STR: Azure Storage connection string;AZURE_STORAGE_ACCOUNT_NAME/AZURE_ACCOUNT_NAME: Azure Storage account name;AZURE_ENDPOINT_SUFFIX: Azure Storage endpoint suffix;AZURE_SSL: Whether to use SSL for the connection;AZURE_QUEUE_ACCOUNT_URL: Azure Storage account URL;DRAMATIQ_ASQ_MIN_TIMEOUT: The minimum time to wait between polls in second.TestsTests require a runningAzuriteinstance. You can easily launchazuritethroughDocker.dockerrun-p10000:10000-p10001:10001-p10002:10002mcr.microsoft.com/azure-storage/azuriteRun the test suitepytestContributionsFound an itch you know how to scratch? PR welcome (just remember to read thecontribution guide) !
Package: dramatiq-crontab
Dramatiq CrontabCron style scheduler for asynchronous Dramatiq tasks in Django.setup recurring tasks via crontab syntaxlightweight helpers build on robust tools likeDramatiqandAPSchedulerSentrycron monitor supportSetupYou need to haveDramatiqinstalled and setup properly.python3 -m pip install dramatiq-crontab
# or
python3 -m pip install dramatiq-crontab[sentry]  # with sentry cron monitor supportAdddramatiq_crontabto yourINSTALLED_APPSinsettings.py:# settings.pyINSTALLED_APPS=['dramatiq_crontab',# ...]Finally, you lauch the scheduler in a separate process:python3 manage.py crontabSetup Redis as a lock backend (optional)If you use Redis as a broker, you can use Redis as a lock backend as well.
The lock backend is used to prevent multiple instances of the scheduler
from running at the same time. This is important if you have multiple
instances of your application running.# settings.pyDRAMATIQ_CRONTAB={"REDIS_URL":"redis://localhost:6379/0",}Usage# tasks.pyimportdramatiqfromdramatiq_crontabimportcron@cron("*/5 * * * *")# every 5 minutes@dramatiq.actordefmy_task():my_task.logger.info("Hello World")Sentry Cron MonitorsIf you useSentryyou can add cron monitors to your tasks.
The monitor's slug will be the actor's name. Likemy_taskin the example above.The crontab command$ python3 manage.py crontab --help
usage: manage.py crontab [-h] [--no-task-loading] [--no-heartbeat] [--version] [-v {0,1,2,3}]
                         [--settings SETTINGS] [--pythonpath PYTHONPATH] [--traceback] [--no-color]
                         [--force-color] [--skip-checks]

Run dramatiq task scheduler for all tasks with the `cron` decorator.

options:
  -h, --help            show this help message and exit
  --no-task-loading     Don't load tasks from installed apps.
  --no-heartbeat        Don't start the heartbeat actor.
Package: dramatiq-dashboard
dramatiq_dashboardA dashboard fordramatiq, specific to its Redis broker (sorry
RabbitMQ users!).  Very alpha stuff.It comes in the form of a WSGI middleware, with as few dependencies as
possible (dramatiq,jinja2andredis) so it's super easy to plug
into whatever web application you have.Installationpip install dramatiq_dashboardQuickstartRun the dashboard on top of an existing WSGI app# Assuming at some point you instantiate your app.app=create_wsgi_application()# Import the library, create the middleware and wrap your app with it.importdramatiq_dashboarddashboard_middleware=dramatiq_dashboard.make_wsgi_middleware("/drama")app=dashboard_middleware(app)Run your app, visit/dramaand you should see the dashboard.Run the dashboard as a standalone webserverIf you don't want to wrap an existing WSGI app, you can also run the
dashboard as a standalone server.  Install the WSGI server of your
choice (e.g. uWSGi, gunicorn, bjoern, etc), setup the Redis broker,
and then startDashboardAppdirectly.For example, to serve the dashboard onhttp://127.0.0.1:8080using
thebjoernWSGI server and a redis server on17.0.0.1:6379, run
the following:importbjoernimportdramatiqfromdramatiq.brokers.redisimportRedisBrokerfromdramatiq_dashboardimportDashboardAppbroker=RedisBroker(host="127.0.0.1",port=6379)broker.declare_queue("default")dramatiq.set_broker(broker)app=DashboardApp(broker=broker,prefix="")bjoern.run(app,"127.0.0.1",8080)Then visithttp://127.0.0.1:8080/to see the running dashboard.Note that if you use custom queues in your application, they won't be
discovered using this approach.  You'll have to either add each one of
them manually to your broker or import and pass your application's
broker toDashboardApp.Licensedramatiq_dashboard is licensed under the LGPL.  Please seeCOPYINGandCOPYING.LESSERfor licensing details.
Package: dramatiq-header
🦅 Dramatiq Header Middleware for RabbitMQ🛠 Installationpipinstalldramatiq-header⬆️  Upgrade versionpipinstalldramatiq-header--upgrade✏️  UsageWorker code:importdramatiqfromdramatiq.brokers.rabbitmqimportRabbitmqBrokerfromdramatiq_headerimportHeadersMessage# Import Middlewarerabbitmq_broker=RabbitmqBroker()dramatiq.set_broker(rabbitmq_broker)rabbitmq_broker.add_middleware(HeadersMessage())# Add Middleware@dramatiq.actor(queue_name='example')defmy_task(message):print(f'Message Received:{message}')print(HeadersMessage.get_headers())# Get headers[!TIP]
You can add middleware specifically to monitor a header key. For example:rabbitmq_broker.add_middleware(HeadersMessage('x-test-header'))Sender exampleimportdramatiqfromdramatiqimportMessagefromdramatiq.brokers.rabbitmqimportRabbitmqBrokerrabbitmq_broker=RabbitmqBroker()dramatiq.set_broker(rabbitmq_broker)defsend_message(msg:str):message=Message(queue_name='example',actor_name='my_task',args=(msg,),kwargs={},options={'x-test-header':'test-header'},# Send your entire header here)rabbitmq_broker.enqueue(message)if__name__=='__main__':send_message('test message')Output[!IMPORTANT]This library does NOT transmit the header using the RabbitMQ header property; rather, it sends the header as metadata within the message that Dramatiq already dispatches.
Package: dramatiq-kafka
Uses kafka-python package to write a Kafka broker for dramatiq.importdramatiqfromdramatiq.middlewareimportAgeLimit,TimeLimit,Callbacks,Pipelines,Prometheus,Retriesfromdramatiq_kafkaimportKafkaBrokerbroker=KafkaBroker(bootstrap_servers="localhost:9092",topic="testdramatiq_topic",# default is `default`group_id="testdramatiq_consumergroup",# optional, default is `default`middleware=[Prometheus(),AgeLimit(),TimeLimit(),Callbacks(),Pipelines(),Retries(min_backoff=1000,max_backoff=900000,max_retries=96),],)dramatiq.set_broker(broker)Use dramatiq to send a message to a Kafka topic (queue_name) as usual:message=Message(queue_name="rita",actor_name="email_customer",args=("testing@gmail.com",),kwargs={},options={},)broker=get_broker()broker.enqueue(message)Write tasks as described in django_dramatiq's documentation (i.e. create dramatiq actors in the task.py files) and modify settings as shown indjango_exampleto get started. To send messages, view the views.py file for an example
Package: dramatiq-mongodb
Dramatiq-Mongodb Broker and Results Backend for Dramatiq:exclamation:WARNINGThis is very early beta software that has not yet been proven to work. :exclamation:Usage InstructionsDevelopment InstructionsConfigure development environmentInstall Development Dependencies using Poetry:poetryinstallInstall githooks to automate quality checks locally:poetryrunpre-commitinstall--install-hooks-tpre-commit-tcommit-msgRun code quality checks locallyAll code quality checks are performed using the Makefile at the root of the repository. You can execute individual steps by name or execute all steps by omitting a target usingmakeor specifyingmake all:makeallIf you want to purge the repo of all ignore files include the embedded virtual environment then run all tests in a fresh environment you can run:makecleanallChangelog and semantic version are automated usingSemantic-Releaseduring the CD process. To accomplish this, this repository makes heavy use ofConventional Commits, thought this isn't strictly enforced on the server side at this time until 1.0 is released, but the githooks will lint your commits.Start a local MongoDBdockerrun-d-p27017:27017--namemongo-eMONGO_INITDB_ROOT_USERNAME=username-eMONGO_INITDB_ROOT_PASSWORD=passwordmongoOnce the mongodb server is up and running you can create a pymongo client and pass it either into a MongoDBBroker or a MongoDBBackend to test the code locally. Otherwise everything should behave in accordance with the documentation forDramatiq.
Package: dramatiq-pg
Dramatiqis a simple task queue implementation for
Python3. dramatiq-pg provides a Postgres-based implementation of a dramatiq
broker.FeaturesSuper simple deployment: Single table, no ORM.Stores message payload and results as native JSONb.Uses LISTEN/NOTIFY to keep worker sync. No polling.Implements delayed task.Reliable thanks to Postgres MVCC.Self-healing: automatic purge of old messages. Automatic recovery after
crash.Utility CLI for maintainance: flush, purge, stats, etc.Note that dramatiq assumes tasks are idempotent. This broker makes the same
assumptions for recovering after a crash.InstallationInstall dramatiq-pg package from PyPI:$pipinstalldramatiq-pgpsycopg2-binaryEnsure you have either psycopg2 or psycopg2-binary installed.Init database schema withinitcommand.$dramatiq-pginitOr adaptdramatiq-pg/schema.sqlto your needs.Before importing actors, define global broker with a connection
pool:importdramatiqimportpsycopg2.poolfromdramatiq_pgimportPostgresBrokerdramatiq.set_broker(PostgresBroker(i))@dramatiq.actordefmyactor():...Now declare/import actors and manage worker just like anydramatiq
setup. Anexample
scriptis
available, tested on CI.The CLI tooldramatiq-pgallows you to requeue messages, purge old messages
and show stats on the queue. See--helpfor details.Dramatiq-pg
documentationis hosted on GitLab and give you more details on deployment and operation of
Postgres as a Dramatiq broker.IntegrationDjango: Usedjango-dramatiq-pgbyCurtis
Maloney. It includes configuration, ORM model and
database migration.SupportIf you encounter a bug or miss a feature, pleaseopen an issue on
GitLabwith as much
information as possible.dramatiq_pg is available under the PostgreSQL licence.CreditThanks to all contributors :Andy FreelandCurtis Maloney, Django support.Federico Caselli, bugfixes.Giuseppe Papallo, bugfixes.Rafal Kwasny, improvements.The logo is a creation ofDamien CAZEILS
Package: dramatiq-spielbergs
dramatiqA fast and reliable distributed task processing library for Python 3.Changelog:https://dramatiq.io/changelog.htmlCommunity:https://groups.io/g/dramatiq-usersDocumentation:https://dramatiq.ioSponsorsFranz: macOS Kafka ClientInstallationIf you want to use it withRabbitMQpip install 'dramatiq[rabbitmq, watch]'or if you want to use it withRedispip install 'dramatiq[redis, watch]'QuickstartMake sure you've gotRabbitMQrunning, then create a new file calledexample.py:importdramatiqimportrequestsimportsys@dramatiq.actordefcount_words(url):response=requests.get(url)count=len(response.text.split(" "))print(f"There are{count}words at{url!r}.")if__name__=="__main__":count_words.send(sys.argv[1])In one terminal, run your workers:dramatiq exampleIn another, start enqueueing messages:python example.py http://example.com
python example.py https://github.com
python example.py https://news.ycombinator.comCheck out theuser guideto learn more!Licensedramatiq is licensed under the LGPL.  Please seeCOPYINGandCOPYING.LESSERfor licensing details.
Package: dramkit
欢迎使用DramKitDramKit是一个工具箱，名字中的Dram取自哆啦A梦的英文名Doraemon。DramKit的目标是提升日常工作效率。如果您的工作或研究方向跟量化、金融、数据分析等领域相关，且使用Python编码，那么DramKit可能会对您有用。DramKit的主要工具包括：日志记录、绘图、文件读写、统计分析，以及其他一些有趣的算法。DramKit的内容和文档将不断完善。安装命令：pip install dramkit --upgrade接口文档请访问：DramKit文档源码请访问：dramkitPypidramkit感谢使用和支持！
Package: drand-verify
A python interface for drand-verifyBased ondrand-verifyMade withPyO3InstallationInstall fromPyPipip install drand-verifyAlternatively, you can build from source usingmaturin(requires cargo and PyO3)git clone https://github.com/very-lame-username/python-drand-verify.git
cd python-drand-verify
pip install maturin
maturin build --release
pip install ./target/wheels/whatever-the-wheel-is-called.whlUsageReturns the randomness for the given round if the input is valid.Attempting to verify an invalid/incorrect input will raise aValueError.importdrand_verifyasdrv#                  round,   previous signature,                                                                                                                                                                                 signature,                                                                                                                                                                                        public key (optional, defaults to League of Entropy mainnet key)drv.verify_mainnet(3311596,"8ed588f2a7716fb1349e2d9803da5db0005e98a83783c353d4a08f183236a9ad91d70ddb01266f4b7c576983db464b430e65680b9e0098552758afd6c1e6afcb77e3f62fe1b93d42d1cb63abbb2205512fe12fbf74ea9c5ac3b8f5c1e283a1d8","a696b9409ababce45749c3a4ec369074453dd4a79967734e1390d969c8ad8d98897d217b9121e92c8ddebbddda8d92f900e3bd6bf9deb166863b1a19390d743f82774001487594c5c09e581db7365f02b70a2c8cc41ce32446ef08e4890c4754")>>>'647c07b2abbf7ff2afb4d670214f565e5cd9f9c91bfdcecb59a21f3c78d73920'#                   round,  signature,                                                                                        public key (optional, defaults to League of Entropy quicknet key)drv.verify_quicknet(657413,"b713718a38ae728dfd477991af2822e08d2f305e47718cef9f7848ce4050e7be41076862b98fad56e91a6b85b89cd97b")>>>'fc1873a13f3545aeade8401532ef5519920652eee6b0d2b19ca12643b87b3587'# fastnet, deprecated          round,   signature                                                                                           public keydrv.verify_bls_unchained_on_g1(5713537,"9391bf57538cf1c0012fabc0d933408d21f785324bcbb4f9850503e5a31e268f6e523e1c1db91ab4bf950752474e1580","a0b862a7527fee3a731bcb59280ab6abd62d5c0b6ea03dc4ddf6612fdfc9d01f01c31542541771903475eb1ec6615f8d0df0b8b6dce385811d6dcf8cbefb8759e5e616a3dfd054c928940766d9a5b9db91e3b697e5d70a975181e007f87fca5e")>>>'5cb6e1643c07234ce4b89ed5b0ced4a2336c729edf2f6138b16a74618d6df6b7'# attempting to verify an invalid beacondrv.verify_quicknet(657414,"b713718a38ae728dfd477991af2822e08d2f305e47718cef9f7848ce4050e7be41076862b98fad56e91a6b85b89cd97b")>>>ValueError:VerificationFailedverify_mainnetis an alias ofverify_pedersen_bls_chainedwith the public key defaulting to the LOE mainnet keyverify_quicknetis an alias ofverify_bls_unchained_g1_rfc9380with the public key defaulting to the LOE quicknet key