Saravanan666/pypi-org huggingface dataset:
Package: python-ironicclient
Team and repository tagsOverviewThis is a client for the OpenStackBare Metal API. It provides:a Python API: theironicclientmodule, anda command-line interfaces:openstack baremetalDevelopment takes place via the usual OpenStack processes as outlined in thedeveloper guide.
The master repository is onopendev.org.python-ironicclientis licensed under the Apache License, Version 2.0,
like the rest of OpenStack.Project resourcesDocumentation:https://docs.openstack.org/python-ironicclient/latest/Source:https://opendev.org/openstack/python-ironicclientPyPi:https://pypi.org/project/python-ironicclientBugs:https://storyboard.openstack.org/#!/project/959Release notes:https://docs.openstack.org/releasenotes/python-ironicclient/Python APIQuick-start Example:>>> from ironicclient import client
>>>
>>> kwargs = {'os_auth_token': '3bcc3d3a03f44e3d8377f9247b0ad155',
>>>           'ironic_url': 'http://ironic.example.org:6385/'}
>>> ironic = client.get_client(1, **kwargs)openstack baremetalCLITheopenstack baremetalcommand line interface is available when the bare
metal plugin (included in this package) is used with theOpenStackClient.There are two ways to install the OpenStackClient (python-openstackclient)
package:along with this python-ironicclient package:# pip install python-ironicclient[cli]directly:# pip install python-openstackclientAn example of creating a basic node with theipmidriver:$ openstack baremetal node create --driver ipmiAn example of creating a port on a node:$ openstack baremetal port create --node <UUID> AA:BB:CC:DD:EE:FFAn example of updating driver properties for a node:$ openstack baremetal node set --driver-info ipmi_address=<IPaddress> <UUID or name>For more information about theopenstack baremetalcommand and
the subcommands available, run:$ openstack help baremetal
Package: python-ironic-inspector-client
OverviewThis is a client library and tool forIronic Inspector.Free software: Apache licenseSource:https://opendev.org/openstack/python-ironic-inspector-client/Documentation:https://docs.openstack.org/python-ironic-inspector-client/latest/Bugs:https://storyboard.openstack.org/#!/project/958Downloads:https://pypi.org/project/python-ironic-inspector-clientRelease Notes:https://docs.openstack.org/releasenotes/python-ironic-inspector-client/Please follow usual OpenStackGerrit Workflowto submit a patch, seeInspector contributing guidefor more detail.Refer to theHTTP API referencefor information on theIronic InspectorHTTP API.
Package: pythonish-validator
Data validation library for Python without complex schemas.
It’s how you write Python code:🐍 Works with Python >= 3.7fromreimportcompileasregexfrompythonish_validator.commonimportValidatorvalidator=Validator({'name':str,'age':int,'email':regex(r'^\w+@\w+.\w{2,5}$')'skills':[str]})validator.is_valid({'name':'Georgy','age':29,'email':'bugov@cpan.org''skills':['Python','Perl','C']})What can be easier?Installpip3installpythonish-validatorError messagesfrompythonish_validator.commonimportvalidatevalidator=validate({'name':str,'age':int,'skills':[str]},{'name':'Georgy','age':None,'skills':['Python','Perl',42]})assertvalidator.repr_errors()==["{'age'}->NoneType(None)","{'skills'}->[2]->int(42)"]Basic typing module supportSupported types: List, Dict, Optional, Union.fromtypingimportDict,List,Optional,Unionfrompythonish_validator.commonimportvalidateschema_example={'name':str,'age':Optional[int],# None if undefined'skill':Union[str,List[str]],# Awful API, but who cares...'level_by_skill':Dict[str,str]}valid_data={'name':'Georgy','age':None,'skill':['Python','ECMA Script'],'level_by_skill':{'Python':'senior','ECMA Script':'middle',}}validator=validate(schema_example,valid_example)Features🗣️ Speak the language of Python classes:frompythonish_validator.commonimportValidatorclassUser:__validation_schema__={'id':int,'name':str}validator=Validator({"users":[User]})# valid structurevalidator.is_valid({"users":[{'id':1,'name':'Alice'},{'id':2,'name':'Bob'},]})# invalid structurevalidator.is_valid({"users":[{'id':'1','name':'Alice'},{'id':2},]})assertvalidator.repr_errors()==["{'users'}->[0]->{'id'}->str('1')","{'users'}->[1]->{'name'}",]🎓 And even custom validation:importrefrompythonish_validator.commonimportValidatorclassEmailType:@staticmethoddef__validation_schema__(data):ifnotisinstance(data,str):returnFalseifre.match(r'^\w+@\w+.\w{2,5}$',data)isNone:returnFalsereturnTrueclassUser:__validation_schema__={'id':int,'name':str,'email':EmailType,}validator=Validator({"users":[User]})validator.is_valid({"users":[{'id':1,'name':'Alice','email':'alice@example.com'},{'id':2,'name':'Bob','email':'bob@example.com'},]})If you find any mistake – please write to the issue list 🐨 (https://github.com/bugov/pythonish-validator/issues).
Package: python-isl
Python ISLA python package to communicate with ISL's api and authenticate ISL employees in Django.APIInstallationpip install python-islUsagefrom pythonisl import ISLClient

    access_token = os.environ.get('ISL_ACCESS_TOKEN')
    isl_endpoint = os.environ.get('ISL_API_ENDPOINT')

    isl = ISLClient(access_token, isl_endpoint)

    for employee in isl.employees():
        print(employee)
    for team in isl.teams():
        print(team)
    for dog in isl.dogs():
        print(dog)

    print(isl.teams().get('antimatter'))  # this line is the
    print(isl.teams('antimatter').get())  # same as this lineAUTHInstallationpip install python-islConfigurationinsettings.pyAUTHENTICATION_BACKENDS = (
    'pythonisl.backends.ISLAuthBackend',
    'django.contrib.auth.backends.ModelBackend',
)inurls.pyurlpatters += [url('', include('pythonisl.urls')),]this adds the urls:login/,auth/callback/, andlogout/you can include the individual views if you would like insteadfrom pythonisl.views import login, callback, logoutthecallbackurl must be named "islauth_callback"UsageJust point a user to /login/?next=/my-next-url/
The ISLAuthBackend will take care of logging the user in by email address
or creating a new user by email address and the user portion of the email
being the username.The user will stay logged in as long as the session is still valid, and
you can request that they login by directing them to the /login/ url whenever
you want.
Package: python-iso4217
python-iso4217: fast currency data package for PythonThis python package automatically updates its own
currency data using github actions and immediately release
new version of package with updates. So it's super fast and at the same time always contains fresh data.InstallationPippipinstallpython-iso4217Poetrypoetryaddpython-iso4217Usagefromiso4217importfind_currency,iter_currency# Filters that could be applied:#   * currency_name#   * alphabetical_code#   * entity#   * decimal_places#   * numeric_code#   * withdrawal_date# The filters correspond to attributes of `Currency` class# accept arbitrary filters as key/value pairscurrency=find_currency(currency_name="usd")# if currency was not found, the lib will immediately raise CurrencyNotFoundErrordefunct_currency=find_currency(currency_name="abc123")# You need generator to lazy iter currencies? Okforciniter_currency():# do somethingAdvancedWork with pydanticimportinspectfromiso4217importCurrencyas_Currency,find_currencyfrompydanticimportBaseModel,root_validator,StrictIntclassCurrency(BaseModel,_Currency):__root__:StrictInt@root_validator(skip_on_failure=True)defhumanize(cls,values):currency_numeric_code:int=values.get("__root__")# inspect.getfullargspec(_Currency.__init__) will contain `self`, so we cut it offorig_currency_cls_dunder_init_arg_names=inspect.getfullargspec(_Currency.__init__).args[1:]currency=find_currency(numeric_code=currency_numeric_code)return{k:getattr(currency,k,None)forkinorig_currency_cls_dunder_init_arg_names}
Package: python-isodata
ISODATAThis project just helps you get data from the major energy markets.  Currently PJM Public reports are supported.  Also - there is no 'secret-sauce' in here that you cannot glean from market documentation.RoadmapAfter making this an installable PIP package, the future simply entails pulling all documents from all markets and then providing a simple consumer that will convert the response into a dataframe or dictionary for easy loading into backend systems.Installing And Documentationpip install python-isodatahttps://python-isodata.readthedocs.io/en/latest/CredentialsYour credential should look like this, and if required, your Certificate needs to be supplied just as two file paths would be to a requests post or get.{
  "user": "caffeinelab",
  "credentials":
  {
    "pjm":
    {
      "username": "***USERNAME***",
      "password": "***PASSWORD***"
    }
  }
}Queryingmarket_dayis magical?If you pass it as a string it will be converted into a datetime and if you forget it
altogether it just becomes datetime.utc_now().  As a side note - remember that if you
are using .isoformat(), you'll want to replace the microseconds with 0 before submitting
to the API.from pathlib import Path
from isodata import Session

pjm = Session('pjm')
pjm.authorize(username=creds['credentials']['pjm']['username'],
              password=creds['credentials']['pjm']['password'],
              certificate=(path_cert, path_key))

for fp in Path('./isodata/pjm/query').glob('*.py'):
    logger.info(fp.name.replace('.py', ''))
    report = pjm.query(report=fp.name.replace('.py', ''))
    if report is not None:
        logger.debug(report[:120])PJM Market Notesit is on the client to procure appropriate credentials and possible NAESB approved certificate for connecting to the market API(s).More information can be found on the PJM website:https://www.pjm.com/markets-and-operations/etools/markets-gatewayhttps://www.pjm.com/-/media/etools/security/pki-faqs.ashxhttps://www.pjm.com/-/media/etools/security/pki-authentication-guide.ashxhttps://www.pjm.com/-/media/etools/markets-gateway/external-interface-specification-guide.ashxWhile PJM does publish a wsdl (in a word doc) it hasn't been updated since 2016,
this along with there being no true service on the backend allows us to bypass more
complicated libraries for submitting simple requests for reports.  Because of this,
the majority of pjm queries are just simple string builders with some simple token
replacements.  If you want/need to use LXML to create your request, there is an
example in pjm.query.QueryBidNodes
Package: pythonista
pythonA shortcut command forPythonInstallationpython3 -m pip install --upgrade pythonistaUsespy==pythoni.e[admin@thispc] ~ $ py
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>[admin@thispc] ~ $ py --version
Python 3.9.2
Package: pythonista-api-client
Pythonista API ClientInstallationThere's a package onPyPIjust type:pipinstallpythonista_api_clientDesktopTo test your installation you can try one of the examples:pythonexamples/konektom.pyiOSBefore you are able to install the package from PyPI, you have to installStaSha shell for pythonista.ApiTo create an api client just inherit from BaseClient which will
handle authentication and settings for you. Requests should be
done by importing requests from api client which will then behave
like the usual requests module.Depending on which platform your script will be run one of following
methods will be called:python_main (normal python)pythonista_main (started with pythonista play button)appex_main (invoked via share sheet)Token AuthenticationIf you wnat to use token authentication you need to set obtain_token_endpoint.JWT AuthenticationFor JWT Authentication obtain_jwt_endpoint and refresh_jwt_endpoint have to
be set.Example with token authentictaionHere's a minimal example which should work with token and jwt authentication:fromurllib.parseimporturljoinfromapi_clientimportrequestsfromapi_clientimportBaseClientclassBookmark(BaseClient):obtain_jwt_endpoint='api/auth/token/obtain/'refresh_jwt_endpoint='api/auth/token/refresh/'obtain_token_endpoint='/api/api-token-auth/'bookmarks_endpoint='api/v1/bookmarks/'deflist_bookmarks(self):list_url=urljoin(self.base_url,self.bookmarks_endpoint)returnrequests.get(list_url,auth=self.auth).json()defpython_main(self):print('running in normal python')print(self.list_bookmarks())defpythonista_main(self):print('Running in Pythonista app, using test data...\n')print(self.list_bookmarks())defappex_main(self):print('running in share sheet')print(self.list_bookmarks())defmain():Bookmark(auth_method='token').main()if__name__=='__main__':main()
Package: pythonista-docgen
docgenPythonista markdown document generator from a single file, intended to be used to generate documentation for Github. Included in the generated documentation are:Module-level docstring.Classes and their functions, with
docstrings.Module-level functions and their docstrings.Decorators are included, with the following special cases:Properties are placed in a separate section, using the docstring of the getter.on_main_threaddecorators are ignored.A table of contents.Functions and methods that start with '_' are not included in the documentation.UsageInclude this script in the Pythonista action (wrench) menu, and run it to generate documentation for the file currently open in the editor.You can choose to just view the resulting documentation as HTML, or also save it as eitherREADME.mdor<script_name>.md.Table of contents is included after the module docstring.There are some special directives you can use to fine-tune the output. These are magic comment strings that must be preceeded only by white space.#docgen-toc- Table of contents will replace this string if found in the module docstring, so that you can have the ToC in the middle of it instead of at the end.#docgen:(with a space after the colon) - Use to group functions into related groups. The text you provide after the colon will be included in the table of contents.APIClass: ProcessorMethodsFunctionsUtility functionsClass: ProcessorMethods to generate markdown documentation
from source classes, functions and their
docstrings.Methodsget_markdown(self, include_undocumented=False)Produces the markdown for the file.Optional arguments:include_undocumented- set toTrueto include classes and methods without a docstring.get_sections(self)get_section_title(self, line_no)for_classes(self)for_functions(self, c, heading, toc_level)build_toc(self, toc)FunctionsUTILITY FUNCTIONSel(parent, astdef)eldoc(body, astdef)slugify(s)Simplifies ugly strings into something URL-friendly.slugify("[Some] _ Article's Title--") --> some-articles-titleFromhttp://blog.dolphm.com/slugify-a-string-in-python/
Package: pythonista-stubs
Pythonista StubsStubs for thePythonista iOS API. This allows for better error detection and IDE / editor autocomplete.Installation and Usagepip install pythonista-stubs --upgradeN.b. you may need topip3, particularly if you installed python3 with homebrewType checking can then be performed withmypyPyCharm: Works immediatelyVim:vim-mypyEmacs: usingFlycheckandFlycheck-mypySublime Text:SublimeLinter-contrib-mypyAtom:linter-mypyVS Code: providesbasic integrationwith mypy.flake8:flake8-mypySee also:mypy integrationsAPI CoverageModuleStatusappex✔canvas✘cb✘clipboard✔console✔dialogs✘contacts✘editor✘keychain✘linguistictagger✘location✘motion✘notification✘objc_util✘photos✘reminders✔scene✘sound✔speech✔twitter✘ui✘Built WithmypyTyping ExtensionsPEPsPEP 484  -- Type HintsPEP 561  -- Distributing and Packaging Type InformationPEP 3107 -- Function AnnotationsContributingPleasefile a bug reportfor any issues you find. Even more excellent than a good bug report is a fix for a bug, or the implementation of a much-needed stub. We'd love to have your contributions.We use the usual GitHub pull-request flow, which may be familiar to
you if you've contributed to other projects on GitHub.  For the
mechanics, seeMypy's git and GitHub workflow help page,
orGitHub's own documentation.Code FormattingThis project is linted withpyflakesand makes strict use ofBlackfor code formatting.Conventionslong functions and methods should be split up with one argument per lineall function bodies should be emptyprefer...overpassprefer...on the same line as the class/function signatureavoid vertical whitespace between consecutive module-level functions, names, or methods and fields within a single classuse a single blank line between top-level class definitionsdo not use docstringsuse variable annotations instead of type commentsfor arguments with a type and a default, use spaces around the=usefloatinstead ofUnion[int, float]avoid Union return types:https://github.com/python/mypy/issues/1693imports in stubs are considered private unless they use the formfrom library import name as nameavoid using theAnytype when possibletype variables and aliases for legibility reasons should be prefixed with an underscore to make it obvious to the reader they are not part of the stubbed API.these conventions derived fromtypeshedCode of ConductEveryone participating in this community is expected to treat other people with respect and more generally to follow the guidelines articulated in thePython Community Code of Conduct.AuthorsHarold Martin- harold.martin at gmailDisclaimerThis is not an official project and is not associated with omz:softwareLicenseApache License 2.0
Package: pythonista-uiutils
Repository of small UI and other utilities, install withpip install pythonista-uiutilsIncluded:uiutils.gridview.GridView - places subviews in grid that is optimized to show as even rectangles as possibleuiutils.richlabel.RichLabel - use markup to create fancier labelsuiutils.safearea.SafeAreaView - avoids edges on iPhonesuiutils.sfsymbol.SymbolImage - use Apple SFSymbols as icon images. Repository root includes an icon browser.
Package: python-jade
PyJade is a high performance port of Jade-lang for python, that converts any .jade source to the each Template-language (Django, Jinja2, Mako or Tornado).UTILITIESTo simply output the conversion to your console:pyjade [-c django|jinja|mako|tornado] input.jade [output.html]INSTALLATIONFirst, you must do:pip install pyjadeOr:python setup.py installNow simplyname your templates with a `.jade` extensionand this jade compiler
will do the rest.  Any templates with other extensions will not be compiled
with the pyjade compiler.DjangoInsettings.py, add aloadertoTEMPLATESlike so:TEMPLATES=[{'BACKEND':'django.template.backends.django.DjangoTemplates','DIRS':[],'OPTIONS':{'context_processors':['django.template.context_processors.debug','django.template.context_processors.request','django.contrib.auth.context_processors.auth','django.contrib.messages.context_processors.messages','django.core.context_processors.request'],'loaders':[# PyJade part:   ##############################('pyjade.ext.django.Loader',('django.template.loaders.filesystem.Loader','django.template.loaders.app_directories.Loader',))],'builtins':['pyjade.ext.django.templatetags'],# Remove this line for Django 1.8},},]Jinja2Just addpyjade.ext.jinja.PyJadeExtensionas extensionjinja_env=Environment(extensions=['pyjade.ext.jinja.PyJadeExtension'])MakoJust addpyjade.ext.mako.preprocessoras preprocessorfrompyjade.ext.makoimportpreprocessorasmako_preprocessormako.template.Template(haml_source,preprocessor=mako_preprocessor)FlaskJust addpyjade.ext.jinja.PyJadeExtensionas extension to the environment of the appapp.jinja_env.add_extension('pyjade.ext.jinja.PyJadeExtension')PyramidAdjust your “your_project/__init__.py” and add the following line somewhere to in the main() functionconfig.include('pyjade.ext.pyramid')Tornado TemplatesAppend this after importing tornado.templatefromtornadoimporttemplatefrompyjade.ext.tornadoimportpatch_tornadopatch_tornado()(...)SyntaxExactly the same as the Jade Node.js module (except of cases, which are not implemented)https://github.com/visionmedia/jade/blob/master/README.mdExampleThis code!!! 5html(lang="en")headtitle=pageTitlescript(type='text/javascript')if(foo) {bar()}bodyh1.titleJade - node template engine#containerifyouAreUsingJadepYou are amazingelsepGet on it!Converts to<!DOCTYPE html><htmllang="en"><head><title>{{pageTitle}}</title><scripttype='text/javascript'>if(foo){bar()}</script></head><body><h1class="title">Jade - node template engine</h1><divid="container">{%if youAreUsingJade%}<p>You are amazing</p>{%else%}<p>Get on it!</p>{%endif%}</div></body></html>Register filtersIf you want to register a function as a filter, you only have to
decorate the function withpyjade.register_filter("filter_name")importpyjade@pyjade.register_filter('capitalize')defcapitalize(text,ast):returntext.capitalize()TESTINGYou must havenosepackage installed.
You can do the tests with:./test.shTODOs and BUGSSee:http://github.com/syrusakbary/pyjade/issues
Package: python-jam
python_jamAn asynchronous python implementation
ofJust Authenticate Me's REST Api.InstallationInstall normally from pypi.org:pip install python-jamIt depends onaiohttp, so if aiohttp is installed
with extras or speedups, those will be used automatically. It will also
useujsonfor serialization if installed. (
Defaults to build-in json)Basic UsageCreate the JustAuthenticateMe object by supplying the AppId from you Just Authenticate
Me app, then call the corresponding functions as needed. The primary ones are in the
example below.frompython_jamimport(JustAuthenticateMe,JAMUnauthorized,JAMBadRequest,JAMNotVerified)jam=JustAuthenticateMe('APP_ID')try:awaitjam.authenticate('user@example.com')exceptJAMBadRequestase:print("Something went wrong",e)try:headers,claims=awaitjam.verify_token('user_id_token')exceptJAMNotVerified:print("Unauthorized, invalid token")try:new_token=awaitjam.refresh('user_refresh_token')exceptJAMBadRequestase:print("Refresh not allowed",e)exceptJAMUnauthorized:print("invalid refresh token")Available MethodsThese are the methods available on a JustAuthenticateMe instance. All Exception inherit
fromJustAuthenticateMeError. This is also the exception raised by an unexpected
error. If the JustAuthenticateMe api returns a message with the error, that is passed
through as exception text.jam.authenticate(email)- Initialize authentication flow for a user given an email
address. ReturnsNoneon success. RaisesJAMBadRequestwhen a 400 bad request is
received from justauthenticate.me (usually an invalid email) orJAMNotFoundWhen a
404 not found is received back from justauthenticate.mejam.verify_token(id_token)- Verify a JustAuthenticateMe token against jwks (loaded
lazily). Call with parameterid_token(jwt) from JustAuthenticateMe.
Returnsheaders, claims: headers and claims encoded in the user jwt. (passed through
frompython-jwt) or
raisesJAMNotVerifiedif verification fails on a token.jam.refresh(refresh_token)- Refresh id tokens with refresh token.refresh_token:
user's refreshToken from JustAuthenticateMe. Returns: new idToken (JWT) from
JustAuthenticateMe. RaisesJAMBadRequestwhen app doesn't allow refresh or request
is malformed. RaisesJAMInvalidwhen the refresh token was invalid. RaisesJAMNotFoundwhen the appId or refresh token was not found.jam.delete_refresh_token(id_token, refresh_token)- Delete a user's refresh token.
(i.e. logout) Called withid_token: User's id token (JWT) from Just Authenticate Me,
andrefresh_token: The refresh token to delete. ReturnsNoneor
raisesJAMUnauthorizedwhen the id_token is invalid orJAMNotFoundwhen the refresh_token or app_id cannot be foundjam.delete_all_refresh_tokens(id_token)- Delete all of a user's refresh tokens.
(i.e. logout) Called withid_token: User's id token (JWT) from Just Authenticate Me.
ReturnsNoneor raisesJAMUnauthorizedwhen the id_token is invalid.