Saravanan666/pypi-org huggingface dataset:
Package: python-ls
python-lsA better replacement for Python's built-indirfunction with searching in mind.Sometimes when you're developing using Python's interactive shell, or IPython, or working with a Jupyter Notebook or even debugging using pdb, you find yourself having to navigate through complex object structures. If you're not entirely familiar with the class in hand you usually have two options: resort to the documentation of the libraries and projects you're working with, or put the explorer's hat on and go down a trial-and-error route, using Python's builtindirfunction to see which attributes and functions an object may have and then take a good guess on the next object you will be inspecting.There must be a better way, right?Well, now yes, you havelsto help you with that task. If you have rough idea of what you're looking for, you can search for that "thing" by name (fingers crossed here: hopefully the developers of the APIs/libraries you're dealing with were careful enough about their naming conventions). Even if (often) your target object may be a few levels deep down the object structure.lsgoes recursively through your object structure, it tries to visit attributes searching for the name you're looking for. It also considers dictionary keys if it stumbles across dictionaries, and in the end it prints out the matching occurrences and tells you their types too.>>>ls(ls,'code',depth=3)func_codecodefunc_code.co_codestr200func_code.co_code.decode()builtin_function_or_methodfunc_code.co_code.encode()builtin_function_or_methodfunc_code.co_filename.decode()builtin_function_or_methodfunc_code.co_filename.encode()builtin_function_or_methodfunc_code.co_lnotab.decode()builtin_function_or_methodfunc_code.co_lnotab.encode()builtin_function_or_methodfunc_code.co_name.decode()builtin_function_or_methodfunc_code.co_name.encode()builtin_function_or_methodfunc_globals['xdir'].func_codecodefunc_globals['iter_ls'].func_codecodeInstallpip install python-lslsavailable as builtinpython-lswill inject thelsfunction in the__builtin__namespace at installation step.It does this by using a.pthfile which simply performs that injection.SecurityIf you're running this against objects that have properties, lazy attributes or any other dynamic code, keep in mind thatlswill try to fetch the value of the property/lazy attribute usinggetattr(). This will cause the body of the function to be executed, so you can imagine already the potential hazard here, right?TODO: make a defaultunsafe=Falsekwarg and then only visit properties ifunsafeis explicitly set toTrue.About the namelsPython hasdiras a builtin. The equivalent of that command-line command in GNU/Linux world isls. We had considered calling itxdir, which by the way is a function that works likedir()by returning a list of occurrences to you.Contribute!Please send your issues, bug reports and, even more welcome, your Pull Requests ;-)Enjoy!
Package: python-lsp-autoimport
python-lsp-autoimportAuto Import plugin forpython-lsp-server.This plugin will runautoimportandisorton your code.pylsp plugin code is taken frompyls-isort.InstallationInstall in same environment as python-lsp-server. I recommend to use pipx:pipinstall--userpipx
pipxinstallpython-lsp-server
pipxinjectpython-lsp-serverpython-lsp-autoimport
Package: python-lsp-black
python-lsp-blackBlackplugin for thePython LSP Server.InstallIn the samevirtualenvaspython-lsp-server:pipinstallpython-lsp-blackUsageThis plugin will disable the yapf and autopep8 plugins if installed.python-lsp-blackcan either format an entire file or just the selected text.The code will only be formatted if it is syntactically valid Python.Text selections are treated as if they were a separate Python file.
Unfortunately this means you can't format an indented block of code.python-lsp-blackwill use your project'spyproject.tomlif it has one.python-lsp-blackonly officially supports the latest stable version ofblack. An effort is made to keep backwards-compatibility
but older black versions will not be actively tested.The plugin can cache the black configuration that applies to each Python file, this
improves performance of the plugin. When configuration caching is enabled any changes to
black's configuration will need the LSP server to be restarted. Configuration caching
can be disabled with thecache_configoption, seeConfigurationbelow.ConfigurationThe plugin followspython-lsp-server's
configuration. These are
the valid configuration keys:pylsp.plugins.black.enabled: boolean to enable/disable the plugin.pylsp.plugins.black.cache_config: a boolean to enable black configuration caching (seeUsage).falseby default.pylsp.plugins.black.line_length: an integer that maps toblack'smax-line-lengthsetting. Defaults to 88 (same as black's default). This can also be set through black's
configuration files, which should be preferred for multi-user projects.pylsp.plugins.black.preview: a boolean to enable or disableblack's--previewsetting.falseby default.pylsp.plugins.black.skip_string_normalization: a boolean to enable or disable black's--skip-string-normalizationsetting.falseby default.pylsp.plugins.black.skip_magic_trailing_comma: a boolean to enable or disable black'sskip-magic-trailing-commasetting.falseby default.DevelopmentTo install the project for development you need to specify the dev optional dependencies:python-mvenv.venv
..venv/bin/activate
pipinstall-e.[dev]This project usespre-commithooks to control code quality,
install them to run automatically when creating a git commit, thus avoiding seeing errors
when you create a pull request:pre-commitinstallTo run tests:maketestTo run linters:makelint# just a shortcut to pre-commit run -amake<linter_name># black, flake8, isort, mypyTo upgrade the version of the pre-commit hooks:pre-commitautoupdate# check and git commit changes to .pre-commit-config.yaml
Package: python-lsp-isort
python-lsp-isortisortplugin for thePython LSP Server.InstallIn the samevirtualenvaspython-lsp-server:pipinstallpython-lsp-isortConfigurationThe plugin followspython-lsp-server's configuration.
These are the valid configuration keys:pylsp.plugins.isort.enabled: boolean to enable/disable the plugin.trueby default.pylsp.plugins.isort.*: any other key-value pair underpylsp.plugins.isortis passed toisort.settings.Config. See thereferencefor details.Note that any configurations passed to isort viapylspare ignored when isort detects a config file, such aspyproject.toml.
Package: python-lsp-jsonrpc
Python JSON RPC ServerA Python 3.8+ server implementation of theJSON RPC 2.0protocol. This library has been pulled out of thePython LSP Serverproject.Installationpip install -U python-lsp-jsonrpcExamplesThe examples directory contains two examples of running language servers over websockets.examples/langserver.pyshows how to run a language server in-memory.examples/langserver_ext.pyshows how to run a subprocess language server, in this case the Python LSP Server.Start by installingtornadoandpython-lsp-serverpip install python-lsp-server[all] tornadoThen runningpython examples/langserver.pyorpython examples/langserver_ext.pywill host a websocket onws://localhost:3000/python.
Package: python-lsp-pylama
python-lsp-pylamais a plugin forpython-lsp-serverthat makes it aware
ofpylama.InstallIn the samevirtualenvaspython-lsp-server:> python -m pip install python-lsp-pylamaAnd then in your configuration forpython-lsp-server:settings = {
    pylsp = {
        plugins = {
            pylama = { enabled = true },
        }
    }
},The options also includeargswhich are a list of strings that are added to the
command line arguments used forpylama.Note that if you havenoseOfYetiinstalled, then it will know how to transform anyspeccoding tests so that it may
runpylamaover them.
Package: python-lunrclient
LunrClientAn HTTP Client for use with the Lunr Storage Backend for CinderInstallation$ pip install python-lunrclientUsageThis package provides 2 command line toolslunran inteface to the
lunrAPI andstoragean interface to the storage API.Lunr API commandline usage$ lunr -h
Usage: lunr <command> [-h]

Command line interface to the lunr api

Available Commands:
   node
   account
   volume
   export
   env
   backupStorage API commandline usage$ storage -h
-- Warning: Failed to load tools module, Missing dependency?
Usage: storage <command> [-h]

Command line interface to the lunr storage api

Available Commands:
   volume
   status
   export
   backup
   envBothlunrandstoragecan use environment variables for
convenience.Uselunr envandstorage envto list environment variables that
are used.Currently the following are supported:export OS_TENANT_NAME='thrawn'
export LUNR_ADMIN='admin'
export LUNR_TENANT_ID='admin'
export LUNR_STORAGE_URL='http://localhost:8081'
export LUNR_API_URL='http://localhost:8080'Lunr API ExamplesCreate a 1 gig volume with a uuid for a name and use the default volume
type:$ lunr volume create 1List the available volumes forOS_TENANT_NAME:$ lunr volume listDelete a volume:$ lunr volume delete my-volumeStorage API ExamplesCreate a 1 gig volume with a uuid for a name:$ storage volume create 1List the available volumes on the storage node:$ storage volume listDelete a volume:$ storage volume delete my-volumeStorage ToolsThere are some additional storage server tools that are only available
when run on the storage node:$ storage tools -h
Usage: storage tools <command> [-h]

A collection of misc Storage Node tools

Available Commands:
   read
   randomize
   clone
   write
   backup
Package: python-luup
Python-luup library allow you to interact with the Luup API from your Vera Controller. It provides
interface for most Luup requests and an EventLoop to monitor changes and job asynchronously.InstallationThe latest stable version can be installed using$ pip install python-luupUsage>>> import luup
>>> luupc = luup.Client('http://127.0.0.1/port_3480/')
>>> evtl = luup.EventLoop(luupc)
>>> def print_device(self, device):
...             print(device)
...
>>> evtl.on_device_change = print_device
>>> evtl.loop_start() # Now monitoring every device changes
>>> luupc.action(3, 'urn:upnp-org:serviceId:SwitchPower1', 'SetTarget', dict(newTargerValue=1))See help(luup) for more usage examples
Package: python-luxio
INSTALLinstallLux IOandCython.then$ python setup.py installHOW TO USE>>> import luxio
>>> io = luxio.LuxIO('test')
>>> io.put('key', 'value')
True
>>> io.get('key')
'value'
>>> io.append('key', '123')
True
>>> io.get('key')
'value123'
>>> io.delete('key')
True
Package: python-lvis
python-lvisPython bindings forhttps://www.veoseleht.eeAPI (aka ELVIS), requires ELVIS proxy that translates requests from
rest to SOAP (you can usehttps://gitlab.com/thorgate-public/lvisproxy/proxy for this)ChangelogAll notable changes to this project will be documented in this file.The format is based onKeep a Changelog,
and this project adheres toSemantic Versioning.1.1.0- 2021-07-07AddedRequests timing out in 2 minutes (can be overridden by subclassing theElvisClient),
previously, there was no timeout and requests could hang for long time causing resource
leaksAdd helper to provide choices tuples from Enums (can be used with Django)This changelogChangedDate fields are now properly parsed to datetimeElvis proxy exception formatting is improved so that exceptions can actually
be readFixedElvisModel was mutating its constructor argument, sometimes causing undesired data changesGetting transport orders now works in python 31.0.1- 2017-01-05AddedReleased to PyPiFixedMisc fixes related to automated deploys and quality checks
Package: python-ly
This package provides a Python librarylycontaining various Python
modules to parse, manipulate or create documents in LilyPond format.
A command line programlyis also provided that can be used to do various
manipulations with LilyPond files.The LilyPond format is a plain text input format that is used by the
GNU music typesetter LilyPond (www.lilypond.org).The python-ly package is Free Software, licensed under the GPL. This package
is written by the Frescobaldi developers and is used extensively by the
Frescobaldi project. The main author is Wilbert Berendsen.Download from:https://pypi.org/project/python-lyDevelopment homepage:https://github.com/frescobaldi/python-lyThelycommand line toolWithlyyou can reformat, or re-indent LilyPond files, transpose music,
translate pitch names, convert LilyPond to syntax-colored HTML, etc.There is also experimental support for converting LilyPond to MusicXML.Use:ly -hto get a full list of the features of thelycommand.Here is an example to re-indent and transpose a LilyPond file:ly "indent; transpose c d" -o output.ly file.lyTo test thelymodule from the current directory without installing, use:python -m ly <args...>This will behave like running thelycommand when the package is installed.ThelyPython moduleThelymodule supports both Python2 and Python3. This is a short description
of some modules:ly.slexer: generic tools to build parsers using regular expressionsly.node: a generic list-like node object to build tree structures withly.document: a tokenized text document (LilyPond file)ly.lex: a parser for LilyPond, Scheme, and other formats, usingslexerly.music: a tree structure of the contents of a documently.pitch: functions for translating, transposing etcly.indent: indent LilyPond textly.reformat: format LilyPond textly.dom: (deprecated) tree structure to build LilyPond text fromly.words: words for highlighting and autocompletionly.data: layout objects, properties, interfaces, font glyphs etc extracted
from LilyPondDocumentationThe documentation is built using Sphinx and located in the doc directory.
If you have Sphinx installed, you can build nicely formatted HTML documentation
by typingmake htmlin the doc directory.You can also read the docs online athttp://python-ly.readthedocs.org/.
Package: python-lzf
python-lzf: liblzf python bindingsThis package is just a straight translation of the C api of liblzf to python.
It has two functions: compress() and decompress().compress() accepts a string to compress and an optional maximum length for the
output. If it cannot compress the string down to the requested size is to
return None. The default behavior if no size is explicitly requested is to use
one less than the length of the input, so the caller must always be prepared
for a return value of None.decompress() accepts a string and a size in which the uncompressed result must
fit. If the uncompressed version doesn’t fit in the specified size then the
function returns None.
Package: python-lzrw1-kh
python-lzrw1-khThis is a pure Python implementation of LZRW1/KH compression algorithm.
Python 2 and Python 3 are supported.
This implementation is based onthe C implementation by Kurt Haenenandthe Delphi implementation by Danny Heijl.This implementation is slow and not suitable for large files.Installationpip3 install python-lzrw1-khpip3 install https://github.com/nmantani/python-lzrw1-kh/archive/refs/heads/master.zipUsagelzrw1_kh.compress() and lzrw1_kh.decompress() take bytes as an argument and return compressed / decompressed bytes.>>>importlzrw1_kh>>>lzrw1_kh.compress(b'AAAAAAAABBBBBBBBCCCCCCCC')b'\x0c\x00@T\x00A\x00\x14B\x00\x14C\x00\x14'>>>lzrw1_kh.decompress(b'\x0c\x00@T\x00A\x00\x14B\x00\x14C\x00\x14')b'AAAAAAAABBBBBBBBCCCCCCCC'>>>>>>importhashlib>>>importlzrw1_kh>>>data=b"\x90"*1024>>>hashlib.md5(data).hexdigest()'e03067ea0b33933f67508ff1f8d0d4d0'>>>compressed=lzrw1_kh.compress(data)>>>len(compressed)9>>>decompressed=lzrw1_kh.decompress(compressed)>>>len(decompressed)1024>>>hashlib.md5(decompressed).hexdigest()'e03067ea0b33933f67508ff1f8d0d4d0'>>>AuthorNobutaka Mantani (Twitter: @nmantani)LicenseThe BSD 2-Clause License (http://opensource.org/licenses/bsd-license.php)
Package: python-magic-file
python-magic-fileSmall Python module to aid developers in getting file extensions from files.PurposeThe main motivation behind this package is to easily get the file extension from given file instead of trusting the arbitrary file extension in the filename, for example in a web application which accepts file uploads.UsageSome examples on how to use this module.Get extension from filefrompython_magic_fileimportMagicFilefile_path='path/to/file'withopen(file_path'rb')asf:magic_file=MagicFile(f)extension=magic_file.get_extension()Get extensions from filefrompython_magic_fileimportMagicFilefile_path='path/to/file'withopen(file_path'rb')asf:magic_file=MagicFile(f)extensions=magic_file.get_extensions()Register unknown/non-standard mimetypesThere may be some cases whereget_extension()emits a following warning:UserWarning: File extension for mimetype "video/x-m4v" is None, consider adding an extension for this mimetype using MagicFile.We have to register file extension usingMagicFile.add_type_to_mimetypes_moduleforvideo/x-m4vsoget_extension()returns the registered extension instead ofNone.MagicFile.add_type_to_mimetypes_modulesimply just callsmimetypes.add_type.frompython_magic_fileimportMagicFile# A dictionary of mimetype/extension pairsnew_types={'video/x-m4v':'.m4v'}formimetype,extensioninnew_types.items():MagicFile.add_type_to_mimetypes_module(mimetype,extension)withopen('path/to/m4v-file.m4v','rb')asf:magic_file=MagicFile(f)extension=magic_file.get_extension()# .m4vGet human readable name for filefrompython_magic_fileimportMagicFilefile_path='path/to/file.txt'withopen(file_path'rb')asf:magic_file=MagicFile(f)human_readable_name=magic_file.get_name()# ASCII text, with no line terminatorsUsage with FlaskimportosfromflaskimportFlask,request,abortfrompython_magic_fileimportMagicFilefromwerkzeug.utilsimportsecure_filenamefromwerkzeug.securityimportsafe_joinapp=Flask(__name__)# Allowed extensions for file uplaodUPLOAD_ALLOWED_EXTENSIONS=('.jpg','.jpeg','.png')@app.post('/upload')defupload_file():uploaded_file=request.files.get('file')ifuploaded_fileisNone:abort(400)extension=MagicFile(uploaded_file.stream).get_extension()ifextensionnotinUPLOAD_ALLOWED_EXTENSIONS:abort(400)filename,_=os.path.splitext(secure_filename(uploaded_file.filename))save_path=safe_join(os.getcwd(),filename+extension)uploaded_file.save(save_path)return'OK'if__name__=='__main__':app.run()
Package: python-magnumclient
Python bindings to the Magnum APIThis is a client library for Magnum built on the Magnum API. It
provides a Python API (themagnumclientmodule) and a command-line
tool (magnum).Development takes place via the usual OpenStack processes as outlined
in thedeveloper guide.License: Apache License, Version 2.0PyPi- package installationOnline DocumentationStoryboard project- story and task managementBugs- issue trackingSource
Package: python-mailchimp
MailChimp Python wrapper for MailChimp API 1.3[ usage ]
>>> from mailchimp import MailChimp
>>> mailchimp_api = MailChimp(‘YOUR MAILCHIMP API KEY’)
>>> mailchimp_api.ping()
u”Everything’s Chimpy!”[ note ]
API parameters must be passed by name. For example:
>>> mailchimp_api.listMemberInfo(id=’YOUR LIST ID’,email_address=’name@example.com’)Requires Python 2.6 or later.[ MailChimp API v1.3 documentation ]http://www.mailchimp.com/api/1.3/
Package: python-mail-sender
Mail Sender ModuleTable of ContentsAbout The ModuleGetting StartedAbout The ModuleMail Sender Module is a python module that helps you send your emails perfectly.it also supports send mails with attachments.(back to top)Getting StartedHow To Installusing python pippipinstallpython-mail-senderHow To UseJust do the following steps:defineSENDER_ADDR&SENDER_PASS&SMTP_PORT&SMTP_SERVERenv variablesUsing python:importosos.environ["SENDER_ADDR"]="sender_address"os.environ["SENDER_PASS"]="sender_pass"os.environ["SMTP_PORT"]="smtp_port"os.environ["SMTP_SERVER"]="smtp_server"Or using the os terminal.Or using the venv activate file:depending on the os open the corresponding activate fileon windowsactivate.batsetSENDER_ADDR=sender_addresssetSENDER_PASS=sender_passsetSMTP_PORT=smtp_portsetSMTP_SERVER=smtp_serveron non-windowsactivate.shexportSENDER_ADDR=sender_addressexportSENDER_PASS=sender_passexportSMTP_PORT=smtp_portexportSMTP_SERVER=smtp_serverinitialize an instance from theMailSenderclassfrommail_senderimportMailSendermail_sender=MailSender()call thesend_mailmethod and provide the mail attributes:Receiver AddressSubjectEmail Contentattached files (optional)noreply@gmail.comany subjectcontent messageattached file listmail_sender.send_mail(receiver_address="test@gmail.com",subject="email subject",content="message content",attach_files=(("filename.ext",file),))(back to top)
Package: python-malicious-url-block
Python_Malicious_Url_BlockPython Malicious Url Block check if it is a malicious URLFree software: MIT licenseDocumentation:https://python-malicious-url-block.readthedocs.io.FeaturesDetermine if the URL does not fit into an arbitrary list of domain based.Malicious Url Blocklist is always used.CreditsThis package is usedMalicious Url Blocklist:https://github.com/curbengh/urlhaus-filter.
This package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2023-01-04)First release on PyPI.0.1.1 (2023-01-04)Small fixesDocumentation update0.1.2Fix Import Error
Package: python-mandrill-inbound
# Mandrill Inbound Python Wrapper [![Build Status](https://travis-ci.org/jpadilla/mandrill-inbound-python.png?branch=master)](https://travis-ci.org/jpadilla/mandrill-inbound-python)This is a simple API wrapper for [Mandrill's inbound email webhook](http://help.mandrill.com/entries/22092308-What-is-the-format-of-inbound-email-webhooks-)in Python inspired by this other Python wrapper library I made for [Postmark Inbound](https://github.com/jpadilla/postmark-inbound-python).## InstallUsing Github:```git clone git://github.com/jpadilla/mandrill-inbound-python.git```Using pip:```pip install python-mandrill-inbound```Using easy_install:```easy_install python-mandrill-inbound```Usage-----```pythonfrom mandrill_inbound import MandrillInbound# Load from JSON stringjson_data = open('./tests/fixtures/valid_http_post.json').read()inbound = MandrillInbound(json=json_data)# Load Python dictionaryjson_data = json.loads(open('./tests/fixtures/valid_http_post.json').read())inbound = MandrillInbound(source=json_data)# Contentprint inbound.subjectprint inbound.senderprint inbound.toprint inbound.ccprint inbound.recipientsprint inbound.message_idprint inbound.mailbox_hashprint inbound.html_bodyprint inbound.text_bodyprint inbound.send_dateprint inbound.ts# Spam and Spoofing Detectionprint inbound.spfprint inbound.dkimprint inbound.spam_score# headersprint inbound.headers  # default to get all headersprint inbound.headers['MIME-Version']print inbound.headers['Received-SPF']# attachmentsprint inbound.has_attachments # booleanattachments = inbound.attachmentsfirst_attachment = attachments[0]print first_attachment.namesecond_attachment = attachments[1]print second_attachment.content_lengthfor a in attachments:print a.nameprint a.content_typeprint a.read()print a.download('./tests/', ['image/png'])# raw dataprint inbound.sourceprint inbound.msg```Bug tracker-----------Have a bug? Please create an issue here on GitHub!Contributions-------------* Fork* Write tests* Write Code* Pull requestThanks for your help.License---------------------MIT License