Saravanan666/pypi-org huggingface dataset:
Package: pyapns-client
Simple, flexible and fast Apple Push Notifications on iOS, OSX and Safari using the HTTP/2 Push provider API.FeaturesUses the new Apple APNs HTTP/2 protocol with persistent connectionsUses token-based authentication (no need to renew your certificates anymore)Uses the httpx HTTP client librarySupports the new iOS 10 features such as Collapse IDs, Subtitles and Mutable NotificationsMakes the integration and error handling really simple with auto-retry on APNs errorsCautionsWorks only with Python 3.6 and higherInstallationInstall using pip:pipinstallpyapns_clientUsagefrompyapns_clientimportAPNSClient,IOSPayloadAlert,IOSPayload,IOSNotification,APNSDeviceException,APNSServerException,APNSProgrammingException,UnregisteredExceptionclient=APNSClient(mode=APNSClient.MODE_DEV,root_cert_path='/path/to/root_cert.pem',auth_key_path='/path/to/auth_key.p8',auth_key_id='AUTHKEY123',team_id='TEAMID1234')# `root_cert_path` is for the AAACertificateServices root cert (https://apple.co/3mZ5rB6)# with token-based auth you don't need to create / renew your APNS SSL certificates anymore# you can pass `None` to `root_cert_path` if you have the cert included in your trust store# httpx uses 'SSL_CERT_FILE' and 'SSL_CERT_DIR' from `os.environ` to find your trust storetry:device_tokens=['device_token_1','device_token_2']alert=IOSPayloadAlert(title='Title',subtitle='Subtitle',body='Some message.')payload=IOSPayload(alert=alert)notification=IOSNotification(payload=payload,topic='domain.organization.app')fordevice_tokenindevice_tokens:try:client.push(notification=notification,device_token=device_token)exceptUnregisteredExceptionase:print(f'device is unregistered, compare timestamp{e.timestamp_datetime}and remove from db')exceptAPNSDeviceException:print('flag the device as potentially invalid and remove from db after a few tries')exceptAPNSServerException:print('try again later')exceptAPNSProgrammingException:print('check your code and try again later')else:print('everything is ok')finally:client.close()
Package: py-apollo
PyApollo - Python Client for Ctrip's Apollo方便Python接入配置中心框架Apollo所开发的Python版本客户端。
Tested with python 2.7 & 3.6Installationpythonsetup.pyinstallFeatures实时同步配置灰度配置Missing Features客户端容灾Usage启动客户端长连接监听client=ApolloClient(app_id=<appId>,cluster=<clusterName>,config_server_url=<configServerUrl>)client.start()获取Apollo的配置client.get_value(Key, DefaultValue)ContributionSource Code:https://github.com/filamoon/pyapollo/Issue Tracker:https://github.com/filamoon/pyapollo/issuesLicenseThe project is licensed under theApache 2 license.ReferenceApollo :https://github.com/ctripcorp/apollo
Package: py-apollo-client
携程 Apollo(阿波罗) 配置客户端说明这是一个携程 Apollo(阿波罗) 配置客户端。链接GitHubPyPI安装pip install py-apollo-client依赖pip install requests使用环境变量获取客户端：import os

from ApolloClient import ApolloClient

os.environ.setdefault('ENV_PREFIX_APOLLO', 'apollo')
os.environ.setdefault('APOLLO_URI', 'http://192.168.68.251:8080')
os.environ.setdefault('APOLLO_APPID', 'equipment-services')

client = ApolloClient.env()拉取配置：print(client.pull())获取配置(缓存)：print(client.get('debug'))获取配置：print(client.get('debug', cache=False))属性属性默认值说明uriNone服务地址appidNone应用编号ipNone客户端地址，为 True 则自动获取clusterdefault集群别名namespaceapplication空间别名releaseNone最后版本last0最后获取配置时间戳rate5速率限制，几秒内只请求一次接口setting{}获取到的配置
Package: py-apollo-config
携程 Apollo(阿波罗) 配置库说明这是一个携程 Apollo(阿波罗) 配置获取库，支持环境变量和用户自定义配置。配置优先级(可通过参数控制)：环境变量 > 阿波罗 > 自定义链接GitHubPyPI安装pip install py-apollo-config依赖pip install config-registry
pip install py-apollo-client使用初始化：import os

from ApolloClient import ApolloClient
from ApolloConfig import ApolloConfig
from ConfigRegistry import ConfigRegistry

os.environ.setdefault('ENV_PREFIX_APOLLO', 'apollo')
os.environ.setdefault('APOLLO_URI', 'http://192.168.68.251:8080')
os.environ.setdefault('APOLLO_APPID', 'equipment-services')

config = ApolloConfig(prefix='{环境变量前缀}')
#config.setting = ConfigRegistry()
#config.apollo = ApolloClient()
config.init()获取配置：config.get('debug', default=False, apollo=False, env=Fals)
Package: pyapp
Let us handle the boring stuff!DocsBuildQualityPackagepyApp takes care of the boring boilerplate code for building a CLI, managing
settings and much more so you can focus on your application logic.So what does pyApp handle?Configuration- Loading, merging your settings from different sourcesPython modulesFile and HTTP(S) endpoints for JSON and YAML files.Instance Factories- Configuration of plugins, database connections, or just
implementations of anABC.
Leveraging settings to make setup of your application easy and reduce coupling.Dependency Injection- Easy to use dependency injection without complicated setup.Checks- A framework for checking settings are correct and environment is
operating correctly (your ops team will love you)?Extensions- Extend the basic framework with extensions. Provides deterministic
startup, extension of the CLI and the ability to register checks and extension
specific default settings.Application- Provides a extensible and simple CLI interface for running
commands (including async), comes with built-in commands to execute check, setting
and extension reports.Logging- Initialise and apply sane logging defaults.Highly tested and ready for production use.Extensions🔌 SQLAlchemy -pyapp.sqlalchemy🔌 Redis -pyapp.redisIn Beta🐛 Rollbar -pyapp.rollbar📧 AIO SMTPlib -pyapp.aiosmtplibExtension for aiosmtplib☁ Boto3 -pyapp.boto3☁ AIOBotocore -pyapp.aiobotocore📨 Messaging -pyapp.messaging- Extension to provide abstract interfaces for Message Queues.📨 AWS Messaging -pyapp.messaging-aws- Messaging extension for AWS (SQS/SNS)In development📧 SMTP -pyapp.SMTP📨 Aio-Pika -pyapp.aiopika- Messaging extension for pika (RabbitMQ/AMQP)🔌 PySpark -pyapp.pyspark- Extension for PySpark🔎 Elastic Search -pyapp.elasticsearch- Extension for ElasticsearchComing soon📨 AMQP Messaging - Messaging extension for AMQP (RabbitMQ)ContributionsContributions are most welcome, be it in the form of a extension and factories
for your favourite service client of bug reports, feature enhancements.The core of pyApp is intended to remain simple and only provide required features
with extensions providing optional more specific functionality.
Package: pyappacitive
Python SDK for AppacitiveWebsite         : www.appacitive.comDocumentation   :http://help.appacitive.comBuild Status    : [![Build Status](https://travis-ci.org/appacitive/pyappacitive.png)](https://travis-ci.org/appacitive/pyappacitive)Code Coverage   : [![Coverage Status](https://coveralls.io/repos/appacitive/pyappacitive/badge.png)](https://coveralls.io/r/appacitive/pyappacitive)[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/appacitive/pyappacitive/trend.png)](https://bitdeli.com/free“Bitdeli Badge”)
Package: pyApp-AIOBotocore
Let us handle the boring stuff!This extension providesSessionandclientfactories foraiobotocoreto allow authorization
details to be configured via pyApp settings.The extension also provides checks to confirm the settings are correct.The extension now supports the standardisedpyApp-Messaginginterface.InstallationInstall usingpip:pip install pyapp-aiobotocoreInstall usingpipenv:pipenv install pyapp-aiobotocoreOptionally add theAWS_CREDENTIALSblock into your runtime settings file, this
is only required if you need to apply specific credentials, the default settings
provided by this extension work with assumed roles within of the AWS environment:AWS_CREDENTIALS = {
    "default": {
        "region_name": None,
        "aws_access_key_id": None,
        "aws_secret_access_key": None,
        "aws_session_token": None,
    }
}UsageThe following example obtains an S3 client:from pyapp_ext.aiobotocore import create_client

s3 = create_client("S3")APIpyapp_ext.aiobotocore.create_client(service_name: str, *, credentials: str = None, **client_kwargs)Get an async botocore service client instance.pyapp_ext.aiobotocore.get_session(default: str = None) -> SessionGet namedSessioninstance.
Package: pyappauto
PyAppAutoControl an app without disturbing your everyday life.RequirementsWindows 10+Python 3.7 or higher.Latest PatchFixed_close_handlerrecursion error.FeaturesAttach to a created window by hwnd, or create one by path.Left and right click the window. (Without using your mouse)Keypress and typewrite directly to the window.Find an image on the window without focusing it.Set the monitor index of the window.Enter and exit fullscreen.Get the window size and position.Set the window size and position.Double click (Simulates a double click, sending a double click crashes the window)pyappauto.utils.keys.KeyCodesInstallationInstall with pip.pip install pyappautoAuthors@User00092LicenseMIT
Package: pyappcache
pyappcachePyappcache is a library to make it easier to use application-level
caching in Python.Allows putting arbitrary Python objects into the cacheUses PEP484 type hints to help you typecheck cache return valuesSupports Memcache, Redis and SQLiteSupports working as a "read-through" and "write-through" cacheNative support for key"namespacing" <https://github.com/memcached/memcached/wiki/ProgrammingTricks#namespacing>__Provides a few handy extrasA plugin for thecachecontrol <https://pypi.org/project/CacheControl/>__ library
so you can also use it as an HTTP cache withrequests <https://pypi.org/project/requests/>__A simple example.. code:: pythonfrom datetime import date

from pyappcache.redis import RedisCache
from pyappcache.keys import Key, SimpleStringKey

cache = RedisCache()

# Annotate the type here to let mypy know this key is used for dates
key: Key[date] = SimpleStringKey("mifid start date")
cache.set(key, date(2018, 1, 3), ttl_seconds=3600)

... # later...

# This variable's type will be inferred as datetime.date
special_date = cache.get(key)How it compares to alternativesUsing the redis/memcache/sqlite client directly- Explicit key objects allow for type inference and encapsulation of keying
- Keys are prefix to help prevent collisions
- Optional, pluggable, compression
- Hopefully the overhead is small (not yet tested!)
- Portable between redis/memcache/sqlite, etc

dogpile.cache
~~~~~~~~~~~~~

- Explicit key objects allow for type inference and encapsulation of keying
- dogpile.cache provides locking, pyappcache does not
- Reduced temptation to use the problematic decorator pattern
  - This often causes import order problems as you need to have your cache at import time
- Pyappache doesn't provide DBM/file backends, SQLite instead
Package: py-app-conf
py-app-confOverviewStrongly typed and validated configuration supporting multiple file types, dynamic instantiation, and environment variablesGetting StartedInstallpy-app-conf:pip install py-app-confA simple example:importpyappconf# Do something with pyappconfSee amore in-depth tutorial here.Development StatusThis project is currently in early-stage development. There may be
breaking changes often. While the major version is 0, minor version
upgrades will often have breaking changes.DevelopingFirst ensure that you havepipxinstalled, if not, install it withpip install pipx.Then clone the repo and runnpm installandpipenv sync. Runpipenv shellto use the virtual environment. Make your changes and then runnoxto run formatting,
linting, and tests.Develop documentation by runningnox -s docsto start up a dev server.To run tests only, runnox -s test. You can pass additional arguments to pytest
by adding them after--, e.g.nox -s test -- -k test_something.AuthorCreated by Nick DeRobertis. MIT License.LinksSee thedocumentation here.
Package: py-appconfig
py-AppConfigPersistent configuration storage for python applications. Based on similarnpmmodules,
because of the lack of apythonpackage that does something similar.Note: This package is still under development. Core functions work just fine,
and as intended. But a few QOL features need to be worked in.Installation# still in testing, pip package coming soonpipinstallpy-appconfig# for now, package is active and working on TestPyPIpipinstall-ihttps://test.pypi.org/simple/py-appconfigUsagefromappconfigimportAppConfigconfig=AppConfig(project_name="myProject",defaults={'a':10,'b':'this is a b'})config_values={'number':1234,'string':'some random string'}foriteminconfig_values:config.set(item,config_values[item])print(config.get_all())print(config.get('number'))print(config.get('string'))# reset and delete config valuesconfig.reset('a')config.reset_all()config.delete('string')Option/args during initproject_name:str->requiredproject_id:str->optional, default =project_nameversion:str->optional, default =0.0.1conf_name:str->optional, default =config(filename of config file)conf_ext:str->optional, default =.json(file extension for config file)verbose:bool->optional, default =False(for verbose logging, needs more work)defaults:dict->optional, no default value, can be used to set project default settingsNote: 2 and 3 not necessary, but may be used later for project config identification and things like version migrationModule functionsfromappconfigimportAppConfigconfig=AppConfig(project_name="myProject")config.set('key','value')config.get('key')config.get_all()To-doAtomically writing configs to prevent corruptions due to runtime errors or system crashes.A better validation system for config values. Right now it only makes sure it does not try to store a function.Type annotations. (partially done)RelatedLoosely based on the same basic concept as somenpmpackages commonly used with javascript applications.confandappconfig.LicenseMITCopyright (c) 2019-2021 Anuj Datar
Package: py-app-config
Python Application Configuration. Py-config organizes hierarchical configurations for your app deployments.UsageInstallationpipinstallpy-app-configBest PracticeFirstly, you should have aconfigfolder under the codebase of your application, like this:.├──config│├──__init__.py│├──default.json│├──development.json│├──production.json│└──test.json.Secondly, set environment variablePY_ENVto one of the names of JOSN files in theconfigfolder, and it defaults to bedevelopment.In your__init__.pyunderconfigfolder, these codes can be used:importosfrompy_configimportset_config_dir,get_configconfig_dir=os.path.abspath(os.path.dirname(__file__))set_config_dir(config_dir)config=get_config()Then, you can usefrom config import configto import your app config in any other places in you codebase.The finalconfigwouldmergedefault.jsonand<PY_ENV>.json. Seedict-recursive-updatefor therecursiveupdate rules.APIs# Set the config directory pathset_config_dir(config_dir=None# Directory path of `config` folder)# Get final config according to the `config_dir`.# It should be executed every time after a new `config_dir` is set.get_config()Relativesdict-recursive-updatenode-configLicenseMIT
Package: py-appdata
Python App DataThe py-appdata aims to solve the issue of storing simple application data and accessing it in an easy way.The core idea is to expose a simple interface that has two propertiesA get/set interface to simple valuesA simple way of saving and retrieving files from the application directoryStoresTheAppDataclass provides an interface to two storage-abstractions: A file system and a key-value store. This lets
you easily save/retrieve files as well as setting/loading key/values which is a common app-data usage.Installationpipinstallpy-appdataGet startedfromappdataimportappdatafromdatetimeimportdatetime,timezone# defaults to app_dataappdata.set_file_store("my_app_data_dir")# defaults to kv_storeappdata.set_key_value_store("my_store")appdata["last_login"]=datetime.utcnow().replace(tzinfo=timezone.utc)withappdata.write("some_file.txt")asf:f.write("Mjello")Auto saveThe AppData object will auto save as a default. This means, whenever the KeyValue-store has been altered, it will
automatically flush.
This can be disabled, but then you are in charge of flushing. This can either be via the context manager or directly
via the save method.fromappdataimportappdataappdata.set_auto_save(False)withappdata:appdata["kv1"]="something"appdata["kv2"]="something else"# Or directlyappdata["kv3"]="something completely else"appdata.save()Dataclass supportIf you like type hints, you can register adataclassinstance as a proxy for the key-value storefromappdataimportappdatafromdatetimeimportdatetime,timezonefromdataclassesimportdataclass# Define the dataclass@dataclassclassKV:last_login:datetime=None# Create an object to be referenced and register it to appdatakv=KV()appdata.register(kv)# The KeyValue object now acts as a proxy, and can be used throughout your projectkv.last_login=datetime.utcnow().replace(tzinfo=timezone.utc)Custom KeyValue StoreYou can create a custom KeyValue store by extending theKeyValueStorebase class, or theDictKeyValueStoreif you
want to use a dict internally, and serialize it in a special way. Remember to registering it to the AppData object.fromappdataimportappdatafromappdata.kv_storeimportKeyValueStoreclassMyKeyValueStore(KeyValueStore):...# defaults to app_dataappdata.set_key_value_store(MyKeyValueStore())Custom File StoreYou can create a custom file store by extending theFileStoreclass and registering it to the AppData objectfromappdataimportappdatafromappdata.file_storeimportFileStoreclassMyFileStore(FileStore):...# defaults to app_dataappdata.set_file_store(MyFileStore())
Package: py-app-dev
Python App DevelopmentMy application development modules.InstallationInstall this via pip (or your favourite package manager):pip install py_app_devStart developingThe project uses Poetry for dependencies management and packaging.
If you do not have Poetry installed, you can run theboostrap.ps1script.
This will install Python and Poetry as configured inscoopfile.json.Set-ExecutionPolicy-ExecutionPolicyBypass-ScopeCurrentUser-Force.\bootstrap.ps1To install the development dependencies in a virtual environment, type:poetryinstallThis will also generate apoetry.lockfile, you should track this file in version control. To execute the test suite, call pytest inside Poetry's virtual environment viapoetry run:poetryrunpytestCheck out the Poetry documentation for more information on the available commands.For those usingVS Codethere are tasks defined for the most common commands:install development dependenciesrun testsrun all checks configured for pre-commitgenerate documentationSee the.vscode/tasks.jsonfor more details.Committing changesThis repository usescommitlintfor checking if the commit message meets theconventional commit format.Contributors ✨Thanks goes to these wonderful people (emoji key):This project follows theall-contributorsspecification. Contributions of any kind welcome!CreditsThis package was created withCopierand thebrowniebroke/pypackage-templateproject template.
Package: pyappframework
PyApplicationFrameworkIntroductionThe PyApplicationFramework is a set of library wrappers related to application development in Python.
This framework allows developers to write a GUI application more simply, with a programming paradigm similar to SwiftUI.
The declarative syntax of User Interface markup, inspired by SwiftUI, is one of the critical functionalities in this project.A Basic "Hello, World!" Code with ExplanationimportwxclassHelloWorldFrame(wx.Frame):def__init__(self,parent):wx.Frame.__init__(self,parent)self.SetTitle("HelloWorldWindow")panel=wx.Panel(self)sizer=wx.BoxSizer(wx.VERTICAL)text=wx.StaticText(panel,label="Hello, World!")sizer.Add(text)panel.SetSizer(sizer)if__name__=="__main__":app=wx.App()frame=HelloWorldFrame(None)frame.Show()app.MainLoop()The code above creates a simple window with an text "Hello, World!" at the top-left corner of it as shown as the image below:The code below written with PyApplicationFramework is a code which shows the same result:importwxfrompyappframework.uiimportWindowfrompyappframework.ui.controlsimportPanel,StaticTextclassHelloWorldWindow(Window):def__init__(self,*args,**kw):super().__init__(*args,**kw)self.SetTitle("HelloWorldWindow")defbody(self)->Panel:return(Panel(wx.BoxSizer(wx.VERTICAL)).body[[StaticText(label="Hello, World!")]])if__name__=="__main__":app=wx.App()frame=HelloWorldWindow()frame.Show()app.MainLoop()As you can see, you can recognize the hierarchical structures of the UI, without using external markup language (likeXRC), which is still needed to instantiate every single control defined inside of it.Mutable ValuesMutations of a variable or an attribute defined byclass Mutable[]()can be observed by adding an event handler or synchronized to one or more attributes of the views or controls.importwximportpyappframeworkaspyaffrompyappframeworkimportuifrompyappframework.uiimportcontrolsasctlclassMutableWindow(ui.Window):def__init__(self,*args,**kw):self.textbox_value=pyaf.Mutable[str]("Initial value")super().__init__(*args,**kw)self.SetTitle("MutableWindow")defbody(self)->ctl.Panel:return(ctl.ScrollablePanel(wx.BoxSizer(wx.VERTICAL)).body[[ctl.StaticText(label=self.textbox_value).sizer(wx.SizerFlags().Border(wx.TOP|wx.LEFT)),ctl.TextCtrl(value=self.textbox_value).sizer(proportion=0,flag=wx.EXPAND),ctl.SearchCtrl(value=self.textbox_value).sizer(proportion=0,flag=wx.EXPAND),]])if__name__=="__main__":app=wx.App()frame=MutableWindow()frame.Show()app.MainLoop()Default ControlsButtonCheckBoxChoiceCollapsiblePanelControlDataViewCtrlGaugeInfoBarListBoxNotebookPanelPlotScrollablePanelSearchCtrlSplitterWindowStaticBitmapStaticBoxStaticLineStaticTextTextCtrlToolBarTreeCtrlWebViewControls with Additional RequirementsGLCanvas (PyOpenGL)Plot (matplotlib)
Package: pyapplemusicapi
pyapplemusicapiA simple Python interface to search the Apple Music and Apple TV libraries by using the still-functional iTunes Store API.  Formerly known as "pitunes".How it WorksRather than using theApple Music API, which requires the developer to register for an Apple Developer Account and a MusicKit API key, this package takes advantage of the olderiTunes Search API.  This older API is still functional, and provides the same results as the newer one.InstallationTo install withpip, just run this in your terminal:$ pip install pyapplemusicapiOr clone the code fromGithuband:$ python setup.py installCachingThis module caches responses from the iTunes Search API to speed up repeated
queries against the same resources. Note, however, that there's no
persistent caching that happens between Python processes. i.e., once a
Python process exits, the cache is cleared.ExamplesSearchimport pyapplemusicapi

# Search band U2
artist = pyapplemusicapi.search_artist('u2')[0]
for album in artist.get_albums():
    for track in album.get_tracks():
        print(album.name, album.url, track.name, track.duration, track.preview_url)

# Search U2 videos
videos = pyapplemusicapi.search(query='u2', media='musicVideo')
for video in videos:
    print(video.name, video.preview_url, video.artwork)

# Search Volta album by Björk
album = pyapplemusicapi.search_album('Volta Björk')[0]

# Global Search 'Beatles'
items = pyapplemusicapi.search(query='beatles')
for item in items:
    print('[' + item.type + ']', item.artist, item.name, item.url, item.release_date)

# Search 'Angry Birds' game
item = pyapplemusicapi.search(query='angry birds', media='software')[0]
vars(item)

# Search 'Family Guy Season 1'
item = pyapplemusicapi.search_season('Family Guy Season 1')[0]
vars(item)

# Search 'Episode 5 of Family Guy Season 1'
items = pyapplemusicapi.search_episode('Family Guy Season 1')
for ep in items:
    if ep.episode_number == 5:
        vars(ep)Lookup by Apple Music IDimport pyapplemusicapi

# Lookup Achtung Baby album by U2
U2_ACHTUNGBABY_ID = 475390461
album = pyapplemusicapi.lookup(U2_ACHTUNGBABY_ID)

print(album.url)
print(album.artwork)

artist = album.artist
tracks = album.get_tracks()

# Lookup song One from Achtung Baby album by U2
U2_ONE_ID = 475391315
track = pyapplemusicapi.lookup(U2_ONE_ID)

artist = track.artist
album = track.get_album()Lookup by UPCimport pyapplemusicapi

# Lookup Arcade EP by glitch_d using UPC
ARCADE_EP_UPC = 5057917815772
album = pyapplemusicapi.lookup_upc(ARCADE_EP_UPC)

print(album.url)
print(album.artwork)

artist = album.artist
tracks = album.get_tracks()Tests$ py.test testsReferencesiTunes Search APIpipGithub