Saravanan666/pypi-org huggingface dataset:
Package: dhooks
Discord WebhooksInteract with discord webhooks using python.Thissimplelibrary enables you to easily interact with discord webhooks, allowing you to easily format discord messages and discord embeds, retrieve webhook information, modify and delete webhooks. Asynchronous usage is also supported.InstallationTo install the library simply use pip.pip install dhooksIf you would also like to get the latest version of dhooks from GitHub, build docs, run tests or run examples, you may want to install
dhooks with the optional extended dependencies.git clone https://github.com/kyb3r/dhooks.git
cd dhooks
pip install .[tests,docs,examples]Quick StartSending Messages:fromdhooksimportWebhookhook=Webhook('url')hook.send("Hello there! I'm a webhook :open_mouth:")Discord Embeds:You can easily format and send embeds using this library.Note:Embedobjects fromdiscord.pyare also compatible with this library.fromdhooksimportWebhook,Embedhook=Webhook('url')embed=Embed(description='This is the **description** of the embed! :smiley:',color=0x5CDBF0,timestamp='now'# sets the timestamp to current time)image1='https://i.imgur.com/rdm3W9t.png'image2='https://i.imgur.com/f1LOr4q.png'embed.set_author(name='Author Goes Here',icon_url=image1)embed.add_field(name='Test Field',value='Value of the field :open_mouth:')embed.add_field(name='Another Field',value='1234 :smile:')embed.set_footer(text='Here is my footer text',icon_url=image1)embed.set_thumbnail(image1)embed.set_image(image2)hook.send(embed=embed)Sending Files:You can easily send files as shown.fromdhooksimportWebhook,FilefromioimportBytesIOimportrequestshook=Webhook('url')file=File('path/to/file.png',name='cat.png')# optional name for discordhook.send('Look at this:',file=file)You can also pass a file-like object:response=requests.get('https://i.imgur.com/rdm3W9t.png')file=File(BytesIO(response.content),name='wow.png')hook.send('Another one:',file=file)Get Webhook Info:You can get some basic information related to the webhook through Discord's API.hook.get_info()The following attributes will be populated with data from discord:hook.guild_idhook.channel_idhook.default_namehook.default_avatar_urlModify and Delete Webhooks:You can change the default name and avatar of a webhook easily.withopen('img.png',rb)asf:img=f.read()# byteshook.modify(name='Bob',avatar=img)hook.delete()# webhook deleted permanentlyAsynchronous Usage:To asynchronously make requests usingaiohttp, simply useWebhook.Asyncto create the object. An example is as follows. Simply use theawaitkeyword when calling API methods.fromdhooksimportWebhookasyncdefmain():hook=Webhook.Async('url')awaithook.send('hello')awaithook.modify('bob')awaithook.get_info()awaithook.delete()awaithook.close()# close the client sessionAlternatively you can use anasync withblock (asynchronous context manager) to automatically close the session once finished.asyncdefmain():asyncwithWebhook.Async('url')ashook:awaithook.send('hello')DocumentationYou can find the full API referencehere.LicenseThis project is licensed under MIT.ContributingFeel free to contribute to this project, a helping hand is always appreciated.Join our discord server.
Package: dhp
dhpis a library of snippets almost guaranteed to get you into trouble.I obtained it from a vendor, on the corner, outside of PyCon.Actually, this is a growing repository of routines that I find helpful from time to time. I think you might too.Example Phrasebook ContentsSee theFull Documentationfor a complete listing.dhp.doqDOQData Object Query mapper.  Query simple data sources with an ORM like style.from dhp.doq import DOQ

doq = DOQ(data_objects=data_source)
for rec in doq.filter(occupation='Publisher'):
  print(rec)dhp.structuresDictDot- subclasses Python’s built-in dict object and offers attribute access to the dictionary.from dhp.structures import DictDot

my_dict = {'hovercraft': 'eels', 'speed': 42}
dicdot = DictDot(my_dict)
assert dicdot.hovercraft == 'eels'
assert dicdot.speed == 42dhp.testtempfile_containing- generate a temporary file that contains indicated contents and returns the filename for use.  When finished the tempfile is removed.from dhp.test import tempfile_containing

contents = 'I will not buy this record, it is scratched.'
with tempfile_containing(contents) as fname:
    do_something(fname)dhp.xmlxml_to_dict- parse any ugly xml to a python dictionary.from dhp.xml import xml_to_dict

xml = '<vehicle type="Hovercraft"><filled/><cargo>eels</cargo></vehicle>'
xml_to_dict(xml)

{'vehicle': {'@type':'Hovercraft',
             'cargo':'eels',
             'filled': None}
}SupportsTested on Python 2.7, 3.2, 3.3, 3.4RequirementsNone.InstallationMake sure to get the latest version.pip install dhpDocumentationFull Docs
Package: dhq-auth
DataHQ auth serviceA generic OAuth2 authentication service and user permission manager.Quick startClone the repo and installmake installRun testsmake testRun serverpython server.pyEnv VarsPRIVATE_KEY&PUBLIC_KEYan RSA key-pair in PEM format.
Seetools/generate_key_pair.shfor more info.GOOGLE_KEY&GOOGLE_SECRET: OAuth credentials for authenticating with GoogleGITHUB_KEY&GITHUB_SECRET: OAuth credentials for authenticating with GithubDATABASE_URL: A SQLAlchemy compatible database connection string (where user data is stored)EXTERNAL_ADDRESS: The hostname where this service is located onALLOWED_SERVICES:
Which permissions providers are available. A;delimited list of provider identifiers.
Each provider identifier takes the form of[alias:]provider, whereprovideris the name of a Python module
which exports aget_permissions(service, userid)function.INSTALLED_EXTENSIONS:
List of installed extensions. A;delimited list ofextension- the name of a Python modules which exports one or all of these functionson_new_user(user_info)on_user_login(user_info)on_user_logout(user_info)APICheck an authentication token's validity/auth/checkMethod:GETQuery Parameters:jwt- authentication tokennext- URL to redirect to when finished authenticationReturns:If authenticated:{"authenticated":true,"profile":{"id":"<user-id>","name":"<user-name>","email":"<user-email>","avatar_url":"<url-for-user's-profile-photo>","idhash":"<unique-id-of-the-user>","username":"<user-selected-id>"#Ifuserhasausername}}If not:{"authenticated":false,"providers":{"google":{"url":"<url-for-logging-in-with-the-Google-provider>"},"github":{"url":"<url-for-logging-in-with-the-Github-provider>"},}}When the authentication flow is finished, the caller will be redirected to thenextURL with an extra query parameterjwtwhich contains the authentication token. The caller should cache this token for further interactions with the API.Get permission for a service/auth/authorizeMethod:GETQuery Parameters:jwt- user token (received from/user/check)service- the relevant service (e.g.storage-service)Returns:{"token":"<token-for-the-relevant-service>""userid":"<unique-id-of-the-user>","permissions":{"permission-x":true,"permission-y":false},"service":"<relevant-service>"}Change the username/auth/updateMethod:POSTQuery Parameters:jwt- authentication token (received from/user/check)username- A new username for the user profile (this action is only allowed once)Returns:{"success":true,"error":"<error-message-if-applicable>"}Note: trying to update other user profile fields likeemailwill fail silently and return{"success":true}Receive authorization public key/auth/public-keyMethod:GETReturns:The service's public key in PEM format.Can be used by services to validate that the permission token is authentic.
Package: dhravyapy
DhravyaPyDhravyaPy is a basic, asynchronous wrapper for theDhravyaAPIDhravyaPy works withPython 3.8+FeaturesEasy to use OOP designGet random jokesGet random topicsGenerate images and memesInstallationTo install the library throughPyPiuse:-pip install dhravyapyTo install the development version(using git):-pip install git+https://github.com/27Saumya/dhravyapyExamplesTo get a random jokeimportdhravyaimportasyncioasyncdefmain():joke=awaitdhravya.Fun().joke()print(joke)if__name__=="__main__":loop=asyncio.get_event_loop()loop.run_until_complete(main())To generate a qrcodeimportdhravyaimportasyncioasyncdefmain():# the text of the qrcode(can be links or just normal text)text="https://api.dhravya.me"qrcode=awaitdhravya.Image().qrcode(text)# saving the image of the qrcodeawaitqrcode.save("qrcode.png")if__name__=="__main__":loop=asyncio.get_event_loop()loop.run_until_complete(main())For more examples see the examples directory.
Package: dht11
DHT11 Python libraryThis simple class can be used for reading temperature and humidity values from DHT11 sensor on Raspberry Pi.InstallationTo install, clone the repository, cd into it, and run:python3 -m pip install .UsageInstantiate theDHT11class with the pin number as constructor parameter.Callread()method, which will returnDHT11Resultobject with actual values and error code.For example:importRPi.GPIOasGPIOimportdht11# initialize GPIOGPIO.setwarnings(False)GPIO.setmode(GPIO.BCM)GPIO.cleanup()# read data using pin 14instance=dht11.DHT11(pin=14)result=instance.read()ifresult.is_valid():print("Temperature:%-3.1fC"%result.temperature)print("Humidity:%-3.1f%%"%result.humidity)else:print("Error:%d"%result.error_code)For working example, seedht11_example.py(you probably need to adjust pin for your configuration)LicenseThis project is licensed under the terms of the MIT license.
Package: dht20-sensor
dht20-sensorCode for taking readings with the DHT20 temperature humidity sensor using I2C.This is the most basic working implementation that suits my needs. It doesn't handle sensor initialisation.Example Usageimport time

from dht20_sensor.sensor import DHT20Sensor

if __name__ == "__main__":
    sensor = DHT20Sensor()

    while True:
        t, h = sensor.read()
        print(t)
        print(h)
        time.sleep(2)
Package: dhtcplib
Dhtcplib--------dhtcplib makes threaded TCP servers and connections to servers really easy.```````````````::from time import sleepfrom dhtcplib import dhtcp'''Start the server'''class MyHandlerClass:def handle(data):print("Handler got data: ", data)return(data)# Using a defined class with a 'handle' method to route requestsmy_serv = dhtcp("127.0.0.1", 9000, RouterClass=MyHandlerClass)my_serv.start()try:while True:print("Do something in your main thread while the server slaves away!")sleep(5)except KeyboardInterrupt:'''Shutdown the server'''my_serv.kill()And Easy to Install```````````````````::$ pip3 install dhtcplib
Package: dhtc-server
dhtc-serverdhtcui part with api endpointsusedhtc-clientwith thisusage(venv)nbdy@c0:~$python3dhtc_server--help
usage:[-h][--hostHOST][--portPORT]options:-h,--helpshowthishelpmessageandexit--hostHOSTserveraddress--portPORTserverportspecificationvideohttps://user-images.githubusercontent.com/12073272/184382122-2dee4c7c-2786-40eb-9b79-1383d36c97cf.mp4
Package: dhtsensor
dhtsensorSimplifies reading temperature and humidity data from a DHT11/22 sensor using pigpioRequirementspigpio daemonpigpio Python packagepip install pigpioInstallpip install dhtsensorQuickstart# Create a new Sensor object for a DHT22 temperature and humidity sensor# GPIO to read from: 21# GPIO that powers the sensor: 20fromdhtsensor.sensorimportSensors=Sensor(pi,21,powered_by=20)# Turn on power to the sensors.activate()# Get temperature and humidity measurement from the sensor# Do not call read_once repeatedly! Use .read insteadreading=s.read_once()# Temperature and humidity as separate variablestemp,rh=s.read_once()# Read from the sensor 10 times, with a 5-second interval between reads# Outputs a list of 10 Reading objectsreading=s.read(10,interval=5)Acknowledgmentpigpio Python examplesContactkentkawashima@gmail.comLicense: MIT License
Package: dhttp
dhttpdhttp, which is pretty short fordecorable HTTP, is a
simple, yet dynamic, HTTP server written for Python 3.It is inspired by Node.js's Express library."Decorable" is a reference to how extensively decorators are
used throughout this project. They are very useful, and
are one of the nicest syntaxes for a callback system like
this.Example codeimport dhttp
import random

app = dhttp.DHTTPServer(int(sys.argv[1]) if len(sys.argv) > 1 else 8005)

app.alias('/index', '/')
app.alias('/index.htm', '/')
app.alias('/index.html', '/')

test_index = """<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>My first DHTTP server</title>
    </head>

    <body>
        <p><h2>Congratulations!</h2></p>
        <hr>
        <p><b>dhttp {version}</b> is now running on your machine.</p>
        <p>How about <i>{party}</i> to comemorate? :)</p>
    </body>
</html>"""

party_stuff = [
    'a bottle of wine', 'a bottle of champagne', 'a big party',
    'THE party, just', 'THE party', 'lots of cats', 'partyception',
    'balloons and cakes', 'a big-endian cake', 'lots of confetti',
    'the Confetti-o-Tron 2000', 'HTTP juice', 'Spicy Bytes',
    'antimatter', 'cats writing code', 'a smile breaking the 4th wall'
]

@app.get('/')
def serve_index(req, res):
    res.end(test_index.format(
        party = random.choice(party_stuff),
        version = DHTTP_VERSION
    ))

@app.on_log
def print_log(log):
    if log.request.get_header('X-Forwarded-For') is not None:
        log.ip = log.request.get_header('X-Forwarded-For')
        print(log, '  (forwarded)')

    else:
        print(log)

@app.serve_forever
def on_serve():
    print(f"   == Listening on port: {app.port} ==")
Package: dhubbard-sphinx-markdown-tables
Note:This is a fork ofsphinx-markdown-tablespackage that works with newer versions of themarkdownpackage.sphinx-markdown-tablesASphinxextension for rendering markdown tables.Sphinx supports markdown viaRecommonmark,which does not support tables. This
extension provides them.It renders markdown tables as HTML, as defined bypython-markdownInstallationpip install dhubbard-sphinx-markdown-tablesUsageQuick versionAddsphinx_markdown_tablestoextensionsinconf.py, like so:extensions = [
    'sphinx_markdown_tables',
]Longer versionSphinx needs to be configured to use markdown. First, you needrecommonmark:pip install recommonmarkInconf.py, configuresource_parsersandsource_suffix:source_parsers = {
    '.md': 'recommonmark.parser.CommonMarkParser',
}

source_suffix = ['.rst', '.md']Once Sphinx is configured appropriately, addsphinx_markdown_tablestoextensions, like so:extensions = [
    'sphinx_markdown_tables',
]For more information on Sphinx and markdown, see theSphinx documentation.LicenseThis project is available under the GPLv3 license. For other licensing arrangements contactRyan Fox.
Package: dhunter
Table of contentsIntroductionFeaturesUsage exampleRequirements and installationBugs reports and contributionsCredits and licenseChangelogIntroductiondhunter (pronounced The Hunter) is [d]uplicate [hunter] utility, designed
to help scanning and processing large sets of files. Uses content based
file duplicates matching and smart caching for faster directory scanning,
data changes detection and processing.FeaturesContent based file matching (sha256)Designed to work with lot of data:caches folder scaning results for quick reuse/rescandirectory scanning can be aborted andresumedat any momentSmart content filtersIgnores zero length files and symlinksIgnores folders like.git,.cvs,.svnSupports file size based (min and/or max) filteringPer folder exlusion via.dhunterignorefileCredits and licenseWritten and copyrighted ©2018-2019 by Marcin Orlowskidhunter is open-sourced software licensed under the MIT license
Package: dhuolib
dhuolibLibrary for data science on DHuO Data🏠HomepageInstalldhuolibsupports Python 3.8 and higher.System-wide or user-wide installation with pipxUse the package managerpipto installdhuolib.$pipinstalldhuolibUsageLogin at DHuO Platform# create /.dhuo config file$dhlogin# /.dhuo (config file example)[default]username=email@test.compassword=xptoproject=workspace=9iS36lMPQXWwAmgAVkworkspace_id=experiment_id=Help Login$dhlogin--helpUsage:dhlogin[OPTIONS]ProvidesuserauthenticationOptions:--emailTEXTYourDHuODataemail--passwordTEXTYourDHuODatapassword--env[prd|dev|stg]Specifyenvironment--helpShowthismessageandexit.
Package: dhwani
DhwaniEnglish to Indic language phonetic conversion engine. Read more about the projecthere.InstallationDhwani is currentlynotstable. However, the developmental release isavalibale at PyPI.Installing from PyPI$ pip install dhwaniInstalling from sources$ git clone https://github.com/ndyashas/Dhwani.git
$ cd Dhwani
$ pip install -r requirements.txt
$ pip install -e .ExampleAn example of converting fromEnglishtoKannadais shown here.# Import the main converter classfromdhwaniimportConverter# Make  a converter object. The first argument is the# ISO 639-3 code of the source language, and the second# argument is the ISO 639-3 code of the destination language.converter=Converter('eng','kan')src_string="kannaDa"# Use the 'convert' method of converter object to get the converter# string back.dest_string=converter.convert(src_string)# Print the result# Note that the display for standard output needs to support the unicode# characters.print(dest_string)# output > ಕನ್ನಡ​Currently supported conversionsEnglish to KannadaEnglish to DevnagariEnglish to Tamil
Package: di
di: dependency injection toolkitdiis a modern dependency injection toolkit, modeled around the simplicity of FastAPI's dependency injection.Key features:Intuitive: simple API, inspired byFastAPI.Auto-wiring:disupports auto-wiring using type annotations.Scopes: inspired bypytest scopes, but defined by users (no fixed "request" or "session" scopes).Composable: decoupled internal APIs give you the flexibility to customize wiring, execution and binding.Performant:dican execute dependencies in parallel and cache results ins scopes. Performance critical parts are written in🦀viagraphlib2.Installationpipinstalldi[anyio]⚠️ This project is a work in progress. Until there is 1.X.Y release, expect breaking changes. ⚠️Simple ExampleHere is a simple example of howdiworks:fromdataclassesimportdataclassfromdiimportContainerfromdi.dependentimportDependentfromdi.executorsimportSyncExecutorclassA:...classB:...@dataclassclassC:a:Ab:Bdefmain():container=Container()executor=SyncExecutor()solved=container.solve(Dependent(C,scope="request"),scopes=["request"])withcontainer.enter_scope("request")asstate:c=solved.execute_sync(executor=executor,state=state)assertisinstance(c,C)assertisinstance(c.a,A)assertisinstance(c.b,B)For more examples, see ourdocs.Why do I need dependency injection in Python? Isn't that a Java thing?Dependency injection is a software architecture technique that helps us achieveinversion of controlanddependency inversion(one of the fiveSOLIDdesign principles).It is a common misconception that traditional software design principles do not apply to Python.
As a matter of fact, you are probably using a lot of these techniques already!For example, thetransportargument to httpx's Client (docs) is an excellent example of dependency injection. Pytest, arguably the most popular Python test framework, uses dependency injection in the form ofpytest fixtures.Most web frameworks employ inversion of control: when you define a view / controller, the web framework calls you! The same thing applies to CLIs (likeclick) or TUIs (likeTextual). This is especially true for many newer web frameworks that not only use inversion of control but also dependency injection. Two great examples of this areFastAPIandBlackSheep.For a more comprehensive overview of Python projects related to dependency injection, seeAwesome Dependency Injection in Python.Project AimsThis project aims to be a dependency injection toolkit, with a focus on providing the underlying dependency injection functionality for other libraries.In other words, while you could use this as a standalone dependency injection framework, you may find it to be a bit terse and verbose. There are also much more mature standalone dependency injection frameworks; I would recommend at least looking intopython-dependency-injectorsince it is currently the most popular / widely used of the bunch.For more background, see ourdocs.See this release on GitHub:v0.79.2
Package: di4injector
di4injectorDI for InjectorHow to usepipinstalldi4injector# at example.pyimportabcfromdiimportDIContainer,DIclassGreetingService(abc.ABC):@abc.abstractmethoddefgreeting(self)->str:passclassEnglishGreetingService(GreetingService):defgreeting(self)->str:return'Hello'classJapaneseGreetingService(GreetingService):defgreeting(self)->str:return'こんにちは'DIContainer.instance().register(DI.of(GreetingService,# Abstract class{# inject"JP":JapaneseGreetingService,# DI_PROFILE_ACTIVES=JP,..."EN":EnglishGreetingService# DI_PROFILE_ACTIVES=EN,...},EnglishGreetingService# Default))greeting_service=DIContainer.instance().resolve(GreetingService)greeting_service.greeting()For Developerrun testpytest-v./tests
Package: dia
DiaHave you ever spent a long day at work, only to wonder at the end of it what you
actually got done? Do you wish you remembered why you made a decision way back when?
Do you want to find the day you worked on a specific thing, but haven't left any trace?Dia solves all those problems by helping you keep a work diary.InstallationInstalling Dia is simple. You can usepipx(recommended):$pipxinstalldiaOrpip(less recommended):$pipinstalldiaUsageTo log a task you've completed, you can usedia log:$dialog"Completed the diary feature."This will generate the followingdiary.txtin the current directory (or append to it
if it already exists):Work diary==========2022-02-09----------*Completed the diary feature.If you want to specify a fixed file to always work on, you can do that by setting thediaryoption in~/.config/dia/config:diary="/home/stavros/diary.txt"You can similarly override any other options.Semantic tagsDia supports (though currently very tenuously) semantic tags. This means it can
understand people, projects, and tags. For example, you can say:$dialog"Worked on the %Dia #data-model with @JohnK."You can show all items with:$diashowprojectsProjects========*Dia
*Foo
*Bar
*BazSame withtagsandpeople.Changelogv0.1.8 (2022-02-20)FeaturesAdd the "show week" command. [Stavros Korokithakis]FixesFix calling "standup" with an empty log. [Stavros Korokithakis]v0.1.7 (2022-02-16)FeaturesAdd the "standup" command. [Stavros Korokithakis]Add the "show people|tags|projects" commands. [Stavros Korokithakis]Allow passing a regex to the "search" command. [Stavros Korokithakis]Add the "edit" command. [Stavros Korokithakis]FixesReduce whitespace between elements. [Stavros Korokithakis]v0.1.6 (2022-02-11)FeaturesRefactor "show" and add "show previous" command. [Stavros Korokithakis]FixesDon't use pager on search. [Stavros Korokithakis]Don't show empty days in the "search" command. [Stavros Korokithakis]v0.1.5 (2022-02-11)FeaturesWrap long task text. [Stavros Korokithakis]Add "search" command. [Stavros Korokithakis]FixesFix diary config name. [Stavros Korokithakis]
Package: dia-adfpro
MQIT_DIA_ADFPROAnomaly Detection for Fast PROcesses (ADFPRO) is a Python application used to implement anomaly detection for "fast" processes that can be described by multiple features.Fast means processes that are repeated continuously on manufacturing equipments and have a duration of a few seconds.Repository includes 2 modules:used from ML frameworks running on the cloud (Domino, SageMaker, AzureML) to trigger model training and classification on datasets having a certain structure;used to implement Dash dashboards to visualize resultsUses code contained in MQIT_DIA_AIML_Toolkit.Developed and maintained by MQ-IDS Data Integration and Analytics.
Package: diablo3api
A Python API Wrapper for the Diablo 3 APIFree software: BSD licenseDocumentation:https://diablo3api.readthedocs.org.FeaturesProvides an API wrapper for the current Diablo 3 API Resources.Works with Python 2.6, 2.7, 3.3, 3.4.History0.1.0 (2014-12-15)First release on PyPI.