Saravanan666/pypi-org huggingface dataset:
Package: asfpy-aridyckovsky
ASFPyA collection of Python scripts for the Application Statement Feedback Program's
logistic needs.InstallationUsageContributingPackagingAuthorsInstallationThis package requires Python 3.6+ and pip 20+, and recommends using the Python
3.8 runtime. To install, runpip install asfpy-aridyckovskyUsageCurrent usage requires importing the namespace directly:from asfpy import asfpyThis can then be used to work with internal methods. For instance:asfpy.allocate(applicants, editors)will run the allocation algorithm, which returns a list of matchings between
applicants and two editors each. If two editors cannot be matched, the
applicant remains in an unmatched list.ContributingPackagingInstall via pip:setuptools,wheelandtwine. Update version number insetup.pybefore creating a new distribution.From root of project, runpython setup.py sdist bdist_wheelto create
distribution indist/*. Then runtwine upload dist/*.AuthorsAri Dyckovsky
Package: asfpy-phd
ASFPyA collection of Python scripts for the Application Statement Feedback Program's
logistic needs.InstallationUsageContributingPackagingAuthorsInstallationThis package requires Python 3.6+ and pip 20+, and recommends using the Python
3.8 runtime. To install, runpip install asfpy-phdYou can find further installation instructions and versioned distributions athttps://pypi.org/project/asfpy-phd/.UsageCurrent usage requires importing the namespace directly:from asfpy import asfpyThis can then be used to work with internal methods. For instance:asfpy.allocate(applicants, editors)will run the allocation algorithm, which returns a list of matchings between
applicants and two editors each. If two editors cannot be matched, the
applicant remains in an unmatched list.ContributingPackagingInstall via pip:setuptools,wheelandtwine. Update version number insetup.pybefore creating a new distribution.From root of project, runpython setup.py sdist bdist_wheelto create
distribution indist/*. Then runtwine upload dist/*.AuthorsAri Dyckovsky
Package: asfquart
asfquart - a Quart framework for the ASFThis repository will house the futureQuartframework for use
within ASF web applications. Nothing much to see here yet...Primerimportasfquartimportasfquart.authimportasfquart.genericsdefmy_app():asfquart.construct("my_app_service")asfquart.generics.setup_oauth()# Sets up /auth for OAuth handlingasfquart.generics.enforce_login()# If not logged in, redirect to the above default login flow@asfquart.APP.route("/")asyncdefhomepage():return"Hello!"@asfquart.APP.route("/secret")@asfquart.auth.require(asfquart.auth.Requirements.committer)asyncdefsecret_page():return"Secret stuff!"asfquart.APP.run(port=8000)if__name__=="__main__":my_app()
Package: asg
An Automatic Schematic Generation ToolThis tool generates schematics from a SPICE netlist, usually of output fromqflow. It was initially developed
during Summer 2020 under the mentorship of Tim Edwards. The schematic entry
tools currently supported are Xschem and EESchema.Usageasg can be installed using PIP by runningpip install asg.Once installed, it can be run withasg [netlist] [library]Full usage:usage: asg [-h] [-f FORMAT] [-d DEPTH] [--vcc VCC] [--vss VSS] [-l] [-e] [-D] input library

positional arguments:
  input
  library

optional arguments:
  -h, --help            show this help message and exit
  -f FORMAT, --format FORMAT
                        output format - one of xschem, eeschema
  -d DEPTH, --depth DEPTH
                        depth to unpack subcircuits
  --vcc VCC             vcc net name
  --vss VSS             vss net name
  -l, --include-library-name
                        include the library name in xschem output. should be used if xschem library env var is a directory instead of a list
  -e, --no-embed-symbols
                        don't embed symbols in xschem schematic output
  -D, --debug           output intermediate steps of the ASG to ./out/ContributingTo run in a development environment, runpython -m asg.main, with appropriate
arguments as seen aboveThe program is organized into a few different submodules underasg/:generation: Constraint classes and the algorithm which optimizes themgrammar: Generic classes for parsing and writing files (currently only used
for s-expressions for EESchema)input: Reading a netlist from qflow or other synthesis toollibrary_source: Reads symbols and parses out metadata and pin locationsoutput: Writes a schematic from an internal representation to a schematic fileentities.py: A collection of geometry classes and representations of
schematic componentsintermediate_lang.py: Representations of schematics and netlists as
collections of components and connections
Package: asgardeo-auth-python-sdk
Asgardeo-auth-python-sdkAsgardeo Auth Python SDK provides the core methods that are needed to implement OIDC authentication in Python based apps. This SDK can be used to build SDKs for Web Applications from different frameworks such as Flask, Django and various other frameworks that use Python.Table of ContentIntroductionInstallGetting StartedDevelopContributeLicenseIntroductionPython Authentication SDK for WSO2 Identity server (aka Product IS) brings up the fast and secure way to add user login to a Python web applications with the help of the WSO2 Identity Server(WSO2 IS).InstallInstall the library from PyPI.pip install asgardeo-auth-python-sdkGetting StartedPython Authentication SDK is architectured in a way that any python framework could be integrated with the Core SDK
. Currently the SDK itself supports Flask framework.
you can find the documentationhere.Still you can implement your own way of implementation using the APIs provided by the core.DevelopPrerequisitesPythonpippackage manager.Installing DependenciesThe repository is a mono repository. The SDK repository is found in theasgardeo_authdirectory. You can install the dependencies by running the following command at the root.pip3 install -r requirements.txtContributePlease readContributing to the Code Basefor details on our code of conduct, and the process for submitting pull requests to us.Reporting issuesWe encourage you to report issues, improvements, and feature requests creatingGithub Issues.Important: And please be advised that security issues must be reported to security@wso2com, not as GitHub issues, in order to reach the proper audience. We strongly advise following the WSO2 Security Vulnerability Reporting Guidelines when reporting the security issues.LicenseThis project is licensed under the Apache License 2.0. See theLICENSEfile for details.
Package: asgardpy
Agardpy: Analysis Software for GAmma-Ray Data in Python'User-friendly' configuration-centred pipeline built overGammapyto allow for easy simultaneous analysis of various datasets of different formats.
Example: 3D Fermi-LAT (with various source models in the Region of Interest stored in XML file) + 1D energy-dependent directional cuts MAGIC/LST [PointSkyRegion geometry for ON region] + 1D global directional cut VERITAS [CircleSkyRegion geometry for ON region].Follow the documentation athttps://asgardpy.readthedocs.io/en/latest/for the main functionality of this pipeline.
Follow theGammapy v1.1documentation for understanding the core Gammapy objects.The various Data Levels	used here follow the descriptions suggested byGADF v0.3and CTAO Data ModelPipeline developmentThe pipeline was developed with first testing with Fermi-LAT (enricoandfermipy) files and LST-1 (cta-lstchain) DL3 files (with energy-dependent and global directional cuts) for point-like sources.
The pipeline can be further expanded to support more types of DL3 files of gamma-ray instruments.Examples with DataAn example of configuration file that can be used with asgardpy can be found atasgardpy/config/template.yamlFor working with some public data to check the pipeline functionality, one should first download the public dataset available with gammapy as indicated inGammapy v1.1 Introductionand then run thescripts/download_asgardpy_data.shscript to add separate Fermi-LAT dataset for the usecase of the pipeline.Examples of usage of asgardpy is shown in jupyter notebooks innotebooks/.CiteIf you use Asgardpy in a publication, please cite the exact version you used from ZenodoCiteashttps://doi.org/10.5281/zenodo.8106369Pipeline TemplatePipeline generated based on the template bypython-package-templatewith additional standards being followed -PEP 518PyPA specs following PEP 621PEP 517PEP 660
Package: asgi_amqp
An ASGI channel layer that uses AMQP as its backing store with group support.SettingsTheasgi_amqpchannel layer looks for settings inASGI_AMQPand
has the following configuration options. URL and connection settings
are configured throughCHANNEL_LAYERsame as any channel layer.MODELSet a customChannelGroupmodel to use. See more about this in the ChannelGroup
Model section of this README.Usage:ASGI_AMQP = {'MODEL': 'awx.main.models.channels.ChannelGroup'}INIT_FUNCA function that you want run when the channel layer is first instantiated.Usage:ASGI_AMQP = {'INIT_FUNC': 'awx.prepare_env'}ChannelGroup ModelThis channel layer requires a database model calledChannelGroup. You
can use the model and migation provided by addingasgi_amqpto your
installed apps or you can point theASGI_AMQP.MODELsetting to a
model you have already defined.Installed Apps:INSTALLED_APPS = [
    ...
    'asgi_amqp',
    ...
]Settings:ASGI_AMQP = {
    'MODEL': 'awx.main.models.channels.ChannelGroup',
}
Package: asgi-auth-github
asgi-auth-githubASGI middleware that authenticates users against GitHub.(Originally part ofdatasette-auth-github, now split off as a separate project.)Setup instructionsInstall the package -pip install asgi-auth-githubCreate a GitHub OAuth app:https://github.com/settings/applications/newSet the Authorization callback URL tohttp://127.0.0.1:8001/-/auth-callbackAdding this to your ASGI applicationfromasgi_auth_githubimportGitHubAuthfromyour_asgi_appimportasgi_appapp=GitHubAuth(asgi_app,client_id="github_client_id",client_secret="github_client_secret",require_auth=True,# Other options:# cookie_ttl=24 * 60 * 60,# disable_auto_login=True,# allow_users=["simonw"],# allow_orgs=["my-org"],# allow_teams=["my-org/engineering"],)See thedatasette-auth-github 0.12 documentationfor documentation of the other parameters.Once wrapped in this way, your application will redirect users to GitHub to authenticate if they are not yet signed in. Authentication is recorded using a signed cookie.The middleware adds a new"auth"key to the scope containing details of the signed-in user, which is then passed to your application. The contents of thescope["auth"]key will look like this:{"id":"1234 (their GitHub user ID)","name":"Their Display Name","username":"their-github-username","email":"their-github@email-address.com","ts":1562602415}The"ts"value is an integertime.time()timestamp representing when the user last signed in.If the user is not signed in (and you are not using required authentication) the"auth"scope key will be set toNone.Example using StarletteHere's an example using theStarletteASGI framework. You'll need to add yourclient_idandclient_secretto this code before running it.Save the following asstarlette_demo.py:fromasgi_auth_githubimportGitHubAuthfromstarlette.applicationsimportStarlettefromstarlette.responsesimportJSONResponsefromstarlette.routingimportRouteimportuvicornapp=Starlette(debug=True)asyncdefhomepage(request):returnJSONResponse({"auth":request.scope["auth"]})app=Starlette(debug=True,routes=[Route("/",homepage),])authenticated_app=GitHubAuth(app,client_id="...",client_secret="...",require_auth=True,)if__name__=="__main__":uvicorn.run(authenticated_app,host="0.0.0.0",port=8001)Install the dependencies like this:pip install uvicorn starlette asgi-auth-githubThen run it with:python starlette_demo.py
Package: asgi-aws
asgi-awsBuild API with ASGI in AWS Lambda with API Gateway HTTP API or REST API, or with Function URL ✨Installationpipinstallasgi_awsExampleCreate a filemain.pywith:fromasgi_awsimportAsgifromtypingimportOptionalfromfastapiimportFastAPIapp=FastAPI()@app.get("/")defread_root():return{"Hello":"World"}@app.get("/items/{item_id}")defread_item(item_id:int,q:Optional[str]=None):return{"item_id":item_id,"q":q}entry_point=Asgi.entry_point(app)Deploy itLet's create for example a yaml file with the following content:AWSTemplateFormatVersion:"2010-09-09"Transform:AWS::Serverless-2016-10-31Resources:ExFunctionUrlAPI:Type:AWS::Serverless::FunctionProperties:Runtime:python3.10CodeUri:src/Handler:main.entry_pointMemorySize:256Timeout:30FunctionUrlConfig:AuthType:NONENow, we can deploy the function with the following command:# deploy HTTP APIsambuild-tapi.yaml--use-container
samrundeployNote:You can also deploy the function under Deployment for Rest API or with
a Function URL.Development 🚧Setup environment 📦You should create a virtual environment and activate it:python-mvenvvenv/sourcevenv/bin/activateAnd then install the development dependencies:# Install dependenciespipinstall-e.[test,lint]Run tests 🌝You can run all the tests with:bashscripts/test.shFormat the code 🍂Execute the following command to applypre-commitformatting:bashscripts/format.shExecute the following command to applymypytype checking:bashscripts/lint.shLicenseThis project is licensed under the terms of the MIT license.
Package: asgi-babel
asgi-babel– Adds internationalization (i18n) support to ASGI applications (Asyncio/Trio/Curio)ContentsRequirementsInstallationUsageUsage with Curio async libraryOptionsHow to extract & compile locales:Bug trackerContributingLicenseRequirementspython >= 3.8Installationasgi-babelshould be installed using pip:pip install asgi-babelUsageCommon ASGI applications:fromasgi_babelimportBabelMiddleware,current_locale,gettextasyncdefmy_app(scope,receive,send):"""Get a current locale."""locale=current_locale.get().language.encode()hello_world=gettext('Hello World!').encode()awaitsend({"type":"http.response.start","status":200})awaitsend({"type":"http.response.body","body":b"Current locale is%s\n"%locale})awaitsend({"type":"http.response.body","body":hello_world})app=BabelMiddleware(my_app,locales_dirs=['tests/locales'])# http GET /## Current_locale is en# Hello World!# http GET / "accept-language: ft-CH, fr;q-0.9"## Current_locale is fr# Bonjour le monde!AsASGI-ToolsInternal middlewarefromasgi_toolsimportAppfromasgi_babelimportBabelMiddleware,gettextapp=App()app.middleware(BabelMiddleware.setup(locales_dirs=['tests/locales']))@app.route('/')asyncdefindex(request):returngettext('Hello World!')@app.route('/locale')asyncdeflocale(request):returncurrent_locale.get().languageUsage with Curio async libraryTheasgi-babeluses context variable to set current locale.  To enable the
context variables with curio you have to runCuriowithcontextvarssupport:fromcurio.taskimportContextTaskcurio.run(main,taskcls=ContextTask)OptionsThe middleware’s options with default values:fromasgi_babelimportBabelMiddlewareapp=BabelMiddleware(# Your ASGI applicationapp,# Default localedefault_locale='en',# A path to find translationslocales_dirs=['locales']# A function with type: typing.Callable[[asgi_tools.Request], t.Awaitable[t.Optional[str]]]# which takes a request and default locale and return current localelocale_selector=asgi_babel.select_locale_by_request,)How to extract & compile locales:http://babel.pocoo.org/en/latest/messages.htmlhttp://babel.pocoo.org/en/latest/cmdline.htmlBug trackerIf you have any suggestions, bug reports or
annoyances please report them to the issue tracker
athttps://github.com/klen/asgi-babel/issuesContributingDevelopment of the project happens at:https://github.com/klen/asgi-babelLicenseLicensed under aMIT license.
Package: asgi-background
asgi-backgroundBackground tasks for any ASGI framework.Example (Starlette)fromasgi_backgroundimportBackgroundTaskMiddleware,BackgroundTasksfromstarlette.applicationsimportStarlettefromstarlette.middlewareimportMiddlewarefromstarlette.requestsimportRequestfromstarlette.responsesimportResponsefromstarlette.routingimportRouteasyncdeftask(num:int)->None:awaitanyio.sleep(1)print(num)asyncdefendpoint(request:Request)->Response:tasks=BackgroundTasks(request.scope)awaittasks.add_task(task,1)returnResponse()app=Starlette(routes=[Route("/",endpoint)],middleware=[Middleware(BackgroundTaskMiddleware)])ExecutionUnlike Starlette, we do not execute background tasks within the ASGI request/response cycle.
Instead we schedule them in aTaskGroupthat is bound to the application's lifespan.
The only guarantee we make is that background tasks will not block (in the async sense, not the GIL sense) sending the response and that we will (try) to wait for them to finish when the application shuts down.
Just like with Starlette's background tasks, you should only use these for short lived tasks, they are not a durable queuing mechanisms like Redis, Celery, etc.
For context, the default application shutdown grace period in Kubernetes is 30 seconds, so 30 seconds is probably about as long as you should allow your tasks to run.
Package: asgi-caches
asgi-cachesasgi-cachesprovides middleware and utilities for adding server-side HTTP caching to ASGI applications. It is powered byasync-caches, and inspired by Django's cache framework.Documentation is available at:https://asgi-caches.florimond.devNote: this project is in an "alpha" status. Several features still need to be implemented, and you should expect breaking API changes across minor versions.FeaturesCompatibility with any ASGI application (e.g. Starlette, FastAPI, Quart, etc.).Support for application-wide or per-endpoint caching.Ability to fine-tune the cache behavior (TTL, cache control) down to the endpoint level.Clean and explicit API enabled by a loose coupling withasync-caches.Fully type annotated.100% test coverage.Installationpipinstall"asgi-caches==0.*"Quickstartfromasgi_caches.middlewareimportCacheMiddlewarecache=Cache("locmem://null")asyncdefapp(scope,receive,send):assertscope["type"]=="http"headers=[(b"content-type","text/plain")]awaitsend({"type":"http.response.start","status":200,"headers":headers})awaitsend({"type":"http.response.body","body":b"Hello, world!"})app=CacheMiddleware(app,cache=cache)This example:Sets up an in-memory cache (see theasync-caches docsfor specifics).Sets up an application (in this case, a raw-ASGI 'Hello, world!' app).Applies caching on the entire application.To learn more, head to thedocumentation.CreditsDue credit goes to the Django developers and maintainers, as a lot of the API and implementation was directly inspired by theDjango cache framework.LicenseMITChangelogAll notable changes to this project will be documented in this file.The format is based onKeep a Changelog.0.3.1 - 2019-11-23ChangedDisallow applying cache middleware multiple times. (Pull #21)0.3.0 - 2019-11-12AddedAdd@cache_control()decorator and its underlying middleware. (Pull #19)0.2.0 - 2019-11-12AddedAdd@cached()decorator. (Pull #15)0.1.1 - 2019-11-12AddedAddDEBUGandTRACElogs. (Pull #14)0.1.0 - 2019-11-12AddedAddCacheMiddleware. (Pull #8)Prevent caching of responses that have cookies when the request has none. (Pull #9)Prevent caching of responses if the cache TTL is zero. (Pull #10)
Package: asgi-cgi-handler
✨ asgi-cgi-handler ✨run cgi scripts inside an asgi serversimple usageimportuvicornfromasgi_cgiimportHTTPCGIHandler,WebsocketCGIHandleruvicorn.run(HTTPCGIHandler())A more complex examplefromfastapiimportFastAPIfromasgi_cgiimportHTTPCGIHandler,WebsocketCGIHandlerapp=FastAPI(title="CGI Server")app.mount("/cgi-bin",HTTPCGIHandler())# type: ignoreapp.mount("/ws",WebsocketCGIHandler())# type: ignoreAs you can see, we have websocket support, which is inspired bywebsocketd. Currently, more tests are needed.TheWebsocketCGIHandlerroute requests to endpoint executables and feed websocket data
into process's stdin and send stdout to client line by line.ApisErrHandler=Callable[[bytes],Union[Awaitable[None],None]]classHTTPCGIHandler:def__init__(self,directory:str=...,error_handler:ErrHandler=...)->None:...classWebsocketCGIHandler:def__init__(self,directory:str=...,error_handler:ErrHandler=...)->None:...
Package: asgi-cli
ASGI CLICallASGIPython application from command line, just like CURL.If you’re using this tool,★Starthis repository to show your interest, please!Installpipinstall-Uasgi-cliUsageasgi-cli--helpusage: asgi-cli [-h] [-V] [-X COMMAND] [-H HEADER] [-d DATA | -F MULTIPART]
                [-I] [-b] [-p] [-n NUMBER] [-v]
                app [url]

positional arguments:
  app                   an application module
  url                   a uniform resource locator or path (default /)

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -X COMMAND, --request COMMAND
                        specify request command to use, e.g. POST (default
                        GET)
  -H HEADER, --header HEADER
                        pass custom header line, e.g. -H='Accept:
                        application/json'
  -d DATA, --data DATA  request body data, e.g. '{"msg":"hello"}', 'msg=hello'
  -F MULTIPART, --form MULTIPART
                        specify HTTP multipart POST data, e.g. name=value or
                        name=@file
  -I, --head            show status and headers only
  -b, --benchmark       issue a number of requests through repeated iterations
                        (reports throughtput and average call time)
  -p, --profile         prints out a report of top 10 functions ordered by
                        internal time, saves to 'stats.cprof' file
  -n NUMBER             a number of requests to issue (default 100K)
  -v, --verbose         make the operation more talkativeExamplesexample.py:START={"type":"http.response.start","status":200,"headers":[(b"content-length",b"13"),(b"content-type",b"text/html; charset=utf-8"),],}BODY1={"type":"http.response.body","body":b"Hello"}BODY2={"type":"http.response.body","body":b", world!"}asyncdefapp(scope,receive,send)->None:awaitsend(START)awaitsend(BODY1)awaitsend(BODY2)Then run the examples:asgi-cli example:appprints response body:Hello, world!asgi-cli -v example:apppretty prints scope and sent messages:{'scope': {'asgi': {'spec_version': '2.1', 'version': '3.0'},
           'client': ('127.0.0.1', 49327),
           'headers': [(b'accept', b'*/*'),
                       (b'user-agent', b'asgi-cli/0.0.1'),
                       (b'host', b'127.0.0.1:8000')],
           'http_version': '1.1',
           'method': 'GET',
           'path': '/',
           'query_string': b'',
           'raw_path': b'/',
           'root_path': '',
           'scheme': 'http',
           'server': ('127.0.0.1', 8000),
           'type': 'http'}}
{'message': {'headers': [(b'content-length', b'13'),
                         (b'content-type', b'text/html; charset=utf-8')],
             'status': 200,
             'type': 'http.response.start'}}
{'message': {'body': b'Hello', 'type': 'http.response.body'}}
{'message': {'body': b', world!', 'type': 'http.response.body'}}asgi-cli -b example:appshows execution stats (runs in 3 iterations, for each iteration displays requests per second and an average call time):#1 => 477.74K, 2.09μs
 #2 => 438.12K, 2.28μs
 #3 => 446.90K, 2.24μs