Saravanan666/pypi-org huggingface dataset:
Package: deez
DeezA little library to simplify building small APIs on top of AWS Lambda and API
Gateway.This library is still in development. It is sufficient for ProdPerfect's needs
but it may not be for yours. Use at your own risk.Getting StartedRequirementsPython 3.9+Blinker 1.4+Installationpip install deezCreating a resourceYour resource must implement at least one HTTP verb (get, post, put, etc.,)fromdeez.resourceimportResourcefromdeez.responseimportJsonResponseclassMyResource(Resource):defget(self,request,*args,**kwargs):returnJsonResponse(data={'message':'hello world'})Example of how to useapp.pyfromdeezimportDeezfromdeez.resourceimportResourcefromdeez.responseimportJsonResponsefromdeez.urlsimportpathclassHelloWorldView(Resource):defget(self,request,*args,**kwargs):returnJsonResponse(data={'message':'hello world'})app=Deez()app.register_route(path("hello/world",HelloWorldView))# or you can use regexapp.register_route(r'^hello/world$',HelloWorldView)`middleware.py````pythonfromdeez.middlewareimportMiddlewareclassUser:# fake user objectpassclassAuthMiddleware(Middleware):defbefore_request(self,request):# perhaps you want to authenticate the user and attach it to the request objectrequest.user=User()returnrequestsettings.py# middleware runs before views are called and before the response is returned# so you can manipulate the response and requests objects.MIDDLEWARE=['middleware.AuthMiddleware']handler.pyfromappimportappdefhandle_event(event,context):returnapp.process_request(event,context)SignalsDeez supports signals. Signals are a way to hook into the request/response
lifecycle. This can be useful for logging metrics or doing other things such as
managing database connections.fromdeez.core.signalsimportrequest_finished,request_started@request_started.connectdefmy_callback(sender,**kwargs):print('request started')@request_finished.connectdefmy_other_callback(sender,**kwargs):print('request finished')Project StructureSee theexamplesdirectory for a working example.
Package: deezapileaks
Can search for information about releases on UPC and ISRCExample:importimport deezapileakswe indicate in the variables isrc and upcisrc = "XXXXXXXXXX"
upc = "XXXXXXXXXXX"print the result by isrcprint(deezapileaks.getisrc(isrc))print the result by upcprint(deezapileaks.getupc(upc))
Package: deezepy
Elegant Python wrapper for Deezer APIDocumentation•Releases•SupportDeezepy>>>importdeezepy>>>client=deezepy.Client()>>>client.get_track(760429392).title'Come Together'Deezepyis an elegant, intuitive and easy-to-use Python wrapper for Deezer API.Installationpip install deezepyRequirementsPython 3.6 or higherLicenseDeezepy is licensed under GNU GPLv3
Package: deezer-oauth-cli
Deezer OAuth CLISource Code:https://github.com/browniebroke/deezer-oauth-cliA small CLI to quickly obtain an API token for the Deezer API.Obtaining API token to develop API applications can be complicated and sometimes feel like a chicken and egg situation: it's hard to play with the API without a token, but it can be difficult to get a token without an application to do the OAuth flow.Given the app ID and secret, this tool lets you quickly get an API token.InstallationInstall this via pip (or your favourite package manager):pip install deezer-oauth-cliUsageBefore starting to use this tool, you first need to declare your Deezer app intheir developer portal. Create a new app with the following Redirect URL:http://localhost:8080/oauth/return.Once created, Deezer will generate an application ID and secret key for you, that's the 2 parameters that you need to run this tool:$deezer-oauthAPP_IDAPP_SECRETThis will:Spin up a webserver in the background running athttp://localhost:8080.Open your browser to grant authorisation access to your Deezer account.Redirect to a page showing the API token & expiry.Write the token to a.envfile.Contributors ✨Thanks goes to these wonderful people (emoji key):Bruno Alla💻🤔📖Pierre💻This project follows theall-contributorsspecification. Contributions of any kind welcome!CreditsThis package was created withCookiecutterand thebrowniebroke/cookiecutter-pypackageproject template.
Package: deezer-playlist-generator
deezer-playlist-generatorLibrary for working with Deezer API for creating a playlist by your preferences inDeezerInstallation 🔨The package is published onPyPIand can be installed by running:pip install deezer-playlist-generatorUsage 🎵Easily query the Deezer API from you Python code. The data returned by the Deezer API is mapped to python resources:>>>client=DeezerApi()>>>client.get_artist(27).name>'Daft Punk'>>>client.get_track(3135556).title'Harder, Better, Faster, Stronger'>>>client.get_album(302127).title>'Discovery'>>>client.client.get_playlist(908622995).title>'Bain moussant'Create your playlist with recommended tracks in Deezer:>>>client=DeezerApi(app_id=<APP_ID>,secret=<SECRET>,redirect_url=<REDIRECTED_URL>,access=Access.MANAGE)>>>tracks=client.create_recommendation_playlist(title='My Deezer Recommendation',count_tracks=10)>Processinguserplaylist:100%|██████████|10/10[00:03<00:00,3.14it/s]>Generatingplaylist:100%|██████████|10/10[00:03<00:00,3.31it/s]Deezer Client 🚩SupportedpermissionsAccess.BASIC=basic_accessAccess.MANAGE=manage_libraryAccess.DELETE=delete_libraryBasic Client- client withbasic_access, which supports access users basic informationclient=DeezerApi()Client with a token- the client allows for request an access token which is necessary to take action requiring the permissions you asked.client=DeezerApi(token=<TOKEN>,expired=3600,access=Access.MANAGE)Client with code auth- client with next token generationclient=DeezerApi(app_id=<APP_ID>,secret=<SECRET>,code=<CODE>,access=Access.MANAGE)Client- client with all parameters, without a manual work for code and token generationclient=DeezerApi(app_id=<APP_ID>,secret=<SECRET>,redirect_url=<REDIRECTED_URL>,access=Access.DELETE)Player ▶️For reproducing a playlist by your preferences in Deezer:fromdeezer_apiimportDeezerApi,Access,DeezerPlayerclient=DeezerApi(app_id=<APP_ID>,secret=<SECRET>,redirect_url=<REDIRECTED_URL>,access=Access.MANAGE)tracks=cp.generate_tracks()DeezerPlayer(tracks).start()
Package: deezer-py
deezer-pyA wrapper for all Deezer's APIsInstalling and using the libraryYou can install this library withpip install deezer-pyLicenseThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program.  If not, seehttps://www.gnu.org/licenses/.
Package: deezer-python
Deezer Python ClientDocumentation:https://deezer-python.readthedocs.ioSource Code:https://github.com/browniebroke/deezer-pythonA friendly Python wrapper around theDeezer API.InstallationThe package is published onPyPIand can be installed by running:pip install deezer-pythonBasic UseEasily query the Deezer API from you Python code. The data returned by the Deezer
API is mapped to python resources:>>>client=deezer.Client()>>>client.get_album(680407).title'Monkey Business'Ready for more? Look at our wholedocumentationon Read The Docs or have a play in pre-populated Jupyter notebookon Binder.ContributorsBruno Alla💻📖🤔🚧📦⚠️misuzu💻📖🤔⚠️Pascal💻⚠️khamaileon📖Nikolay Sheregeda💻⚠️Matheus Horstmann💻📖Kieran Wynne💻Jonathan Virga💻📖Hugo💻allcontributors[bot]🚇nrebena🐛💻⚠️Pavel🐛Samuel Gaist💻⚠️🛡️Thomas Morelli🐛💻🤔Naveen M K💻🚇Carababusha💻Bertrand Jacquin💻Pierre💻📖Jonathan💻📖⚠️This project follows theall-contributorsspecification.
Contributions of any kind are welcome!
Package: deezersdk
This is a python sdk to manipulate the deezer's APIInstallationpipinstalldeezersdkImportimportdeezersdkAuthentication to the APIYou need to have a Deezer account to use the API.You have to go onhttps://developers.deezer.com/myappsand create an a new appYou will need, your Application ID, Secret Key and the Redirect URL.First we use theget_oauth_login_urlmethod to get a login urlurl=Deezer.get_oauth_login_url(app_id=DEEZER_APP_ID,redirect_uri=DEEZER_REDIRECT_URI)We have to go the url (if the pop up will open and we will be able to login to your deezer account.)You will then be redirected to your redirect url with an authorization code in your url.With this code you can, request your access tokenDeezer.get_oauth_token(app_id=DEEZER_APP_ID, app_secret=DEEZER_APP_SECRET, code=code)You now have your access token, and can use the SDK.Using the sdkInstantiate the Deezer objectdz=Deezer(app_id=DEEZER_APP_ID,app_secret=DEEZER_APP_SECRET,code=YOUR_URL_CODE,token=YOUR_ACCESS_TOKEN)Query the APIGet my playlistsdz.get_my_playlists()Will return an array of Playlist objects witch contains the title of the playlist,
the url of the picture, and a booleanis_loved_trackto True if it's your loved playlistPlay a music with the Deezer pluginsplaylists=dz.get_my_playlists()url=dz.get_widget(playlist=playlists[0])This will give an of the plugin loaded with your playlist. You can add the url in an iframe to display the plugin
or you can open it directly with :importwebbrowser
webbrowser.open(url)You call also play a list of tracksplaylists=dz.get_my_playlists()url=dz.get_widget(tracks=tracks)Get your Flowtracks=dz.get_flow()Get my favorites artistsartists=dz.get_my_favorite_artists()Methods on a Trackalbum=tack.get_album()artist=tack.get_artist()Methods on an Albumtracks=album.get_tracks()artist=album.get_artist()Methods on an Artisttracks=artist.get_tracks()
Package: deez-py
deez_pyis a python implementation of a lexical analyzer that provides comprehensive scanning, and lookahead capabilities. It also implements a parser that comes with awesome functionalities.🛠️ Requirementsdeez_pyrequires Python 3.10 or above.To install Python 3.10.1, we recommend usingpyenv.# install pyenvgitclonehttps://github.com/pyenv/pyenv~/.pyenv# setup pyenv (you should also put these three lines in .bashrc or similar)
# if you are using zshcat<< EOF >> ~/.zshrc
# pyenv config
export PATH="${HOME}/.pyenv/bin:${PATH}"
export PYENV_ROOT="${HOME}/.pyenv"
eval "$(pyenv init -)"
EOF# or if you using the default bash shell, do this instead:cat<< EOF >> ~/.bashrc
# pyenv config
export PATH="${HOME}/.pyenv/bin:${PATH}"
export PYENV_ROOT="${HOME}/.pyenv"
eval "$(pyenv init -)"
EOF# Close and open a new shell session
# install Python 3.10.1pyenvinstall3.10.1# make it available globallypyenvglobalsystem3.10.1To manage the Python 3.10.1 virtualenv, we recommend usingpoetry.# install poetrycurl-sSLhttps://install.python-poetry.org|python3-poetry--versionPoetry\(version1.5.1\)# Having the python executable in your PATH, you can use it:poetryenvuse3.10.1# However, you are most likely to get the following issue:Creatingvirtualenvdeez_py-dxc671ba-py3.10in~/.cache/pypoetry/virtualenvsModuleNotFoundErrorNomodulenamed'virtualenv.seed.via_app_data'at<frozenimportlib._bootstrap>:973in_find_and_load_unlocked# To resolve it, you need to reinstall virtualenv through pipsudoaptremove--purgepython3-virtualenvvirtualenvpython3-mpipinstall-Uvirtualenv# Now, you can just use the minor Python version in this case:poetryenvuse3.10.1Usingvirtualenv:~/.cache/pypoetry/virtualenvs/deez_py-dxc671ba-py3.10🚨 InstallationWithpip:python3 -m pip install deez-py🚸 Usage>>>fromdeez_pyimportLexer>>>lex=Lexer('=+(){},;')>>>for_inrange(9):>>>print(lex.get_next_token())...Token(type=<TokenType.Equal:'='>,literal='=')Token(type=<TokenType.Plus:'+'>,literal='+')Token(type=<TokenType.LParen:'('>,literal='(')Token(type=<TokenType.RParen:')'>,literal=')')Token(type=<TokenType.LSquirly:'{'>,literal='{')Token(type=<TokenType.RSquirly:'}'>,literal='}')Token(type=<TokenType.Comma:','>,literal=',')Token(type=<TokenType.Semicolon:';'>,literal=';')Token(type=<TokenType.Eof:'EOF'>,literal='EOF')👨‍💻 DevelopmentFor local development, you can install all dependencies by running:makeinstall🧪 Testingmaketest# orpytest-vvtests💡 TipsTo run a subset of tests:maketestmakelintmakecoverage🚀 DeployingA reminder for maintainers on how to deploy. Run the following commands in order:bump2versionpatch# possible: major / minor / patchgitpushgitpush--tagsmakedistmakerelease📝 LicenseTodo.
Package: deez-stats
deez_statsPython connection to Yahoo! Fantasy API implementing the yahoo_fantasy_api fromspilchenBuild StatusI'll figure this out one dayInstallationEventually, this package can be installed via pip:python3 -m pip install deez-stats (mac)
python -m pip install deez-stats (windows)Getting StartedFirst, you need to register your application on Yahoo Developer network to get Oauth credentials. Details found atRegistering Your Application.After it is registered, you can see your Client ID (Consumer Key) and Client Secret (Consumer Secret) on theapps page.With these two elements, the need to be put into a JSON file with the following format for theyahoo_oauthpackage to read it in correctly.oauth2.json file format{
   "consumer_key": "my_very_long_and_weird_consumer_key",
   "consumer_secret": "my_not_that_long_consumer_secret"
}Sample API UsageNow with your Yahoo Oauth2 credentials, we will use theyahoo_oauthpackage to generate a token.First, let's import the needed packages and modules:>>> from yahoo_oauth import OAuth2
>>> import deez_stats as dsNow, we want to generate the Yahoo Oauth2 token from the file containing our credentials:>>> file = 'tokens/yahoo/oauth2.json'
>>> oauth2_token = OAuth2(None, None, from_file=file)After that, we are all set to begin! Right now, there is limited functionality but we can create an object that contains all the league information. Optionally, you can pass it a season and week for a snapshot of the past. Otherwise, it will return the current league information/status.>>> li = ds.LeagueInfo(oauth2_token, season=2021, week=None)You can also get information about all the weekly matchups. Additionally, you can get all the historical info about the matchup.>>> wm = li.weekly_matchups
>>> wmh = li.weekly_matchup_historiesLastly, you can see the classes with a simple method to display the info above.li.display_matchup_info()Have fun and reach out if you have any cool statistical ideas!
Package: deface-social
deface: Liberate Your Posts From Facebookdefacecleans and consolidates posts exported from Facebook. It helps you
extricate your content from Facebook, so that you can extricate yourself from
the social network. That matters because Facebook is an imminent threat to human
rights and democracy all over the world. I madethe case against
Facebookas an invited talk atRebase/SPLASHin November 2020.To installdeface:$pipinstalldeface-socialTo rundeface:$deface-hPlease seethe documentationfor more
information aboutdeface, including on usage and background.defacehas been
released as open source under theApache 2.0 license.
Package: defang
Defangs and refangs malicious URLsUsageAs a script: use thedefangcommand to defang or “refang”
content, supporting
both stdin/stdout streams as well as to/from files on disk:$ echo http://evil.example.com/malicious.php | defang
hXXp://evil.example[.]com/malicious.phpAs a library:>>> from defang import defang
>>> url = "http://evil.example.com/malicious.php"
>>> defang(url)
'hXXp://evil.example[.]com/malicious.php'We’ve added a few new keyword argument options:>>> defang(url, colon=True)
'hXXp[:]//evil.example[.]com/malicious.php'
>>> defang(url, all_dots=True)
'hXXp://evil[.]example[.]com/malicious.php'
>>> defang(url, zero_width_replace=True)
'h\u200bt\u200bt\u200bp\u200b:\u200b/\u200b/\u200be\u200bv\u200bi\u200bl\u200b.\u200be\u200bx\u200ba\u200bm\u200bp\u200bl\u200be\u200b.\u200bc\u200bo\u200bm\u200b/\u200bm\u200ba\u200bl\u200bi\u200bc\u200bi\u200bo\u200bu\u200bs\u200b.\u200bp\u200bh\u200bp'
# printed as 'h​t​t​p​:​/​/​e​v​i​l​.​e​x​a​m​p​l​e​.​c​o​m​/​m​a​l​i​c​i​o​u​s​.​p​h​p'Releases0.5.3:Merged in optional feature to split characters with the zero-width character.0.5.2:left in a debug print message in my last patch… removed it.0.5.1:refangs boxed in colons [:]0.5.0:added new options to defangall_dots=Truewill turn all dots into [.] and not just the one before the TLDcolon=Truewill translatehttp://into http[:]// as well as other protocols0.4.0:added support for URIs with IPv40.3.0:added some regex fixes and arbitrary protocol defanging
Package: defang-api
Defang APIDefang API runs a local server or Docker that can assist in defanging URLs to make them safe to
post in various apps or tp log in case logs.Capabilities:Defang URLRefang URLBase64 DecodeBase64 EncodeThe defang functionality is ran using a a modified version of the defang package from Johan Nestaas.
I currently a pull request in to incorporate the changes I have made to it to better support more
protocols and defanging options.Original:https://bitbucket.org/johannestaas/defang/src/master/Mine:https://bitbucket.org/zpriddy/defang/src/master/Pull Request:https://bitbucket.org/johannestaas/defang/pull-requests/4/add-better-support-for-defanging/diffInstalling and RunningUsing PIP (Easy)InstallRun :pip install defang-apiRunningRun:defang-serverBy default this will run onlocalhoston port5000but that can be changed at runtime:defang-server --port=8080 --host-0.0.0.0Using Docker (Advanced)InstallRequirements:Docker Installedbrew install dockerDocker Compose installedbrew install docker-composeClone the repo:git clone https://github.com/zpriddy/defang_api.gitRunningRun:cd defang_apiRun:docker-compose upUsing Defang APIWhen you launch the server by default it will run onlocalhost:5000.
There is fullSwaggerdocumentation if you point your browser athttp://localhost:5000. This will give you full details on all of the available options for each
endpoint of the API as well as the ability to test each of the endpoints.By default the API will return its results in JSON but ifacceptheader is set totext/plainthen it will return the results in plain text.ExamplesIf you run:curl-XGET"http://localhost:5000/api/defang?url=http%3A%2F%2Fexample.com"-H"accept: text/plain"You will get backhXXp://example[.]comcurl-XGET"http://localhost:5000/api/defang?url=http%3A%2F%2Fexample.com"-H"accept: application/json"Will give you back JSON:{
  "error": [],
  "output": "hXXp://example[.]com"
}If you have a list of URLS:curl-XPOST"http://localhost:5000/api/defang"-H"accept: application/json"-H"Content-Type: "\"application/json"-d"{ \"colons\": false, \"dots\": false, \"url\": [ \"https://example.com\", \"https://foo.bar\" ]}"Will give you:{
  "error": [],
  "output": [
    "hXXps://example[.]com",
    "hXXps://foo[.]bar"
  ]
}But if you set the accept totext/plainyou will get:hXXps://example[.]com,hXXps://foo[.]barNotesThe simpleGETmethod endpoints are limited on the scope of options that there are in passing
data in. For this reason I recommend using thePOSTmethod endpoints
Package: defaultcontext
Tiny util for creating `tensorflow`_-like context managers for default instances of classes.InstallationYou can installdefaultcontextusing pip:pip install defaultcontextUsageThe library provides thewith_default_contextclass decorator which simply does two things:Adds static methodClass.get_default()which returns the default object in the current context block.Adds methodinstance.as_default()to the class, which manages a context within which theinstancebecomes defaultThis is useful for creating psuedo-global objects that can be accessed from any code executed within a
given context block without passing such objects around.This idea is inspired byGraphandSessionclasses from Google’stensorflow.Basic usage:fromdefaultcontextimportwith_default_context@with_default_contextclassEnvironment:def__init__(self,name):self.name=namedef__str__(self):return'Environment%s'%self.namewithEnvironment(name='A').as_default():print(Environment.get_default())# AwithEnvironment(name='B').as_default():print(Environment.get_default())# Bprint(Environment.get_default())# NoneIfwith_default_contextwas called without parameters the global default value of a class will beNone.
The global default can be added usingglobal_default_factory:defmake_default_env():returnEnvironment(name='default')@with_default_context(global_default_factory=make_default_env)classEnvironment:def__init__(self,name):self.name=namedef__str__(self):returnself.nameEnvironment.get_default()# defaultwithEnvironment(name='custom').as_default():print(Environment.get_default())# customEnvironment.get_default()# defaultAlternatively, if the class can be constructed without arguments, global default can be set toClass()by
settinguse_empty_inittoTrue:@with_default_context(use_empty_init=True)classEnvironment:def__init__(self,name='default'):self.name=namedef__str__(self):returnself.nameEnvironment.get_default()# defaultwithEnvironment(name='custom').as_default():print(Environment.get_default())# customEnvironment.get_default()# default
Package: defaultdict-NickNackGus
DefaultDictThis is a package for a defaultdict that deep copies its default value.This can be used to implement a simple counter object, similar to the example code this is based on.counter=DefaultDict()foritemin['spam','egg','spam','spam','bacon','spam']:counter[item]+=1print("Menu contents:")foritemincounter:print("{}x{}".format(counter[item],item))Output:Menu contents:
  1x bacon
  1x egg
  4x spamUnlikecollections.defaultdict, the default value is an object - not a factory. This allows for easier creation of nested data structures. For example, the following is valid and encouraged:# shapes_by_color[color][shape] = countshapes_by_color=DefaultDict(default=DefaultDict({'total':0},default=0))withopen('test/shapes.log','r')asfp:forlineinfp:color,shape=line.split()shapes_by_color[color][shape]+=1shapes_by_color[color]['total']+=1forcolor,shapesinshapes_by_color.items():print("{}:".format(color))forshape,countinshapes.items():ifshape=='total':continueprint("{}x{}".format(count,shape))print("  Total:{}".format(count))Output:green:
  2x triangle
  1x circle
  Total: 3
red:
  1x octagon
  2x rhombus
  Total: 3
blue:
  1x triangle
  1x square
  Total: 2Note that the default value is a reference, and is affected by external changes. This only affects new uses of the default value, not previous uses.spam=DefaultDict(default=['Hello'])print(spam['eggs'])spam.default.append('world')print(spam['sausage'])print(spam)Output:['Hello']
['Hello', 'world']
DictWithDefault(init={'sausage': ['Hello', 'world'], 'eggs': ['Hello']}, default=['Hello', 'world'])
Package: defaultencodinghack
Sets default encoding to utf8 in a hacky manner. While this isconsidered
harmful, it is
sometimes necessary.Encouraging pysqlite, SQLAlchemy and Archetypes to play togetherIn your buildout.cfg:[versions]
pysqlite = 2.4.1

[instance]
eggs +=
    defaultencodinghack
zcml +=
    defaultencodinghack