Saravanan666/pypi-org huggingface dataset:
Package: falca
FalcaFalca is an intuitive REST APIs framework.Powered by https://falconframework.org/.:warning:This is a BETA version please don't use it in a production environment. Thank you!:construction:Goals of this project:Validates request body based on type hints.(Pydantic & Marshmallow) support as object serialization and deserializationRequest body mappingNested routersPlugin supportSettings (Global Configuration) supportAsync SupportRouting sub-applicationCLIDependency injectionResource shortcut (get,post,put,delete,websocket, etc)ContributionDo not hesitate!if you want to contribute like bug fixes, feature additions, etc. Please read ourcontribution guidelines.Also bug reports are welcome :)InstallationUsingpip:pip install falcaAlternatively, clone this repository and go to thefalcadirectory:git clone https://github.com/aprilahijriyan/falca
cd falcaInitialize the environment with python v3.7 usingpoetrypoetry env use $(which python3.7)Install dependenciespoetry install --no-devUsageLet's see how beautiful it is# app.pyfromtypingimportOptionalfromfalca.appimportASGIfromfalca.depends.pydanticimportQueryfromfalca.responsesimportJSONResponsefromfalca.serializers.pydanticimportSchemaclassLimitOffsetSchema(Schema):limit:Optional[int]offset:Optional[int]classSimple:asyncdefon_get(self,query:dict=Query(LimitOffsetSchema)):returnJSONResponse(query)app=ASGI(__name__)app.add_route("/",Simple())Save the code above with filenameapp.pyAnd run it with the command:falcarunserverNOTE: For the ASGI app, you need to installuvicornbefore running it.
Also for other examples, you can find themhere
Package: falco
client-pyPython client and SDK for FalcoUsageOutput subscribeimportfalcoclient=falco.Client(endpoint="localhost:5060",client_crt="/tmp/client.crt",client_key="/tmp/client.key",ca_root="/tmp/ca.crt")foreventinclient.sub()):print(event)or try it directly (make sure you have the client certificates in/tmpor use the unix socket address), for example:python -m examples.tls_sub_events -o json
python -m examples.unixsocket_get_events -o json
python -m examples.unixsocket_get_versionOutput formatCurrently there are two output formats available: JSON and Python classes.
To change output format, pass theoutput_formatparameter to the Client object.DevelopmentDependenciesTo install development dependencies, runpip install -r requirements-dev.txt.Update protosPerform the following edits to the Makefile:Update the PROTOS array with the destination path of the .proto file.Update the PROTO_URLS array with the URL from which to download it.Update thr PROTO_SHAS array with the SHA256 sum of the file to download.Execute the following commands:make cleanmake protosTestsTo run the tests, runmake test.MiscTo format the code, runmake lint.
Package: falcon-api-browse
This project provides a middleware forFalcon Web Frameworkthat will render the
response in an HTML form for documentation purpose. It uses the docstring from
the Resource object and all the supported HTTP methods for the resource.It is inspired by Django Rest Framework’sBrowsable APIand is written
using jinja2 templating language.InstallingThis project is currently in early stages of development. Once it is stable
enough to be used by other projects, it will be provided via PyPI.pip install git+https://github.com/maxking/falcon-api-browseUsingSince this is a middleware for Falcon, you can use it by passing an initialized
instance during Falcon App creation.from falcon import App
from falcon_api_browse import HTMLResponseMiddleware

app = App(middleware=HTMLResponseMiddleware())ExamplesThere are some runnable examples inexamples/directory.LICENSEThis project and contents of this repo are licensed under Apache 2.0 License.
Package: falcon-apispec
falcon-apispecapispecplugin that generates OpenAPI specification (aka Swagger) forFalconweb applications.Installationpip install falcon-apispecWorks withapispec v1.0+.Example ApplicationfromapispecimportAPISpecfromapispec.ext.marshmallowimportMarshmallowPluginimportfalconfromfalcon_apispecimportFalconPluginfrommarshmallowimportSchema,fields# Optional marshmallow supportclassCategorySchema(Schema):id=fields.Int()name=fields.Str(required=True)classPetSchema(Schema):category=fields.Nested(CategorySchema,many=True)name=fields.Str()# Create Falcon web appapp=falcon.API()classRandomPetResource:defon_get(self,req,resp):"""A cute furry animal endpoint.---description: Get a random petresponses:200:description: A pet to be returnedschema: PetSchema"""pet=get_random_pet()# returns JSONresp.media=pet# create instance of resourcerandom_pet_resource=RandomPetResource()# pass into `add_route` for Falconapp.add_route("/random",random_pet_resource)# Create an APISpecspec=APISpec(title='Swagger Petstore',version='1.0.0',openapi_version='2.0',plugins=[FalconPlugin(app),MarshmallowPlugin(),],)# Register entities and pathsspec.components.schema('Category',schema=CategorySchema)spec.components.schema('Pet',schema=PetSchema)# pass created resource into `path` for APISpecspec.path(resource=random_pet_resource)Generated OpenAPI Specspec.to_dict()# {#   "info": {#     "title": "Swagger Petstore",#     "version": "1.0.0"#   },#   "swagger": "2.0",#   "paths": {#     "/random": {#       "get": {#         "description": "A cute furry animal endpoint.",#         "responses": {#           "200": {#             "schema": {#               "$ref": "#/definitions/Pet"#             },#             "description": "A pet to be returned"#           }#         },#       }#     }#   },#   "definitions": {#     "Pet": {#       "properties": {#         "category": {#           "type": "array",#           "items": {#             "$ref": "#/definitions/Category"#           }#         },#         "name": {#           "type": "string"#         }#       }#     },#     "Category": {#       "required": [#         "name"#       ],#       "properties": {#         "name": {#           "type": "string"#         },#         "id": {#           "type": "integer",#           "format": "int32"#         }#       }#     }#   },# }spec.to_yaml()# definitions:#   Pet:#     enum: [name, photoUrls]#     properties:#       id: {format: int64, type: integer}#       name: {example: doggie, type: string}# info: {description: 'This is a sample Petstore server.  You can find out more ', title: Swagger Petstore, version: 1.0.0}# parameters: {}# paths: {}# security:# - apiKey: []# swagger: '2.0'# tags: []ContributingSetting Up for Local DevelopmentFork falcon-apispec on GithubInstall development requirements. Virtual environments are highly recommendedpip install -r requirements.txtRunning Testspytest
Package: falcon-ask
Falcon-AskMinimal Python3 toolkit to create Amazon Alexa skills withFalcon.Builds on top ofAlexa Skills Kit (ASK)to bootstrap boilerplate code so you don't have to!Inspired byFlask-AskandAlexandra.SynopsisA Falcon app might look like this.importjsonimportfalconfromfalcon_askimportdispatch_request,FalconAskMiddleware,responddefintent_fn(body):# "body" contains request POST data.return'Congratulations! Your new alexa skill works great.'classAlexaResource(object):# Dictionary mapping of "IntentRequest" to function.intent_maps={'GreetingIntent':intent_fn,}# Message to return when "LaunchRequest" is received.welcome='Hi, welcome to your new alexa skill.'defon_post(self,req,resp):response=dispatch_request(req)resp.body=json.dumps(respond(response,end_session=False))app=falcon.API(middleware=[# Do validation of request certificate and timestamp.FalconAskMiddleware(AlexaResource,validate=True),])app.add_route('/',AlexaResource())Save above code toalexa.pyand run via$ gunicorn alexa:app. Make suregunicornis installed.InstallationTo install Falcon-Ask, simply usepipenv(or pip, of
course):$pipinstallfalcon-ask
✨🍰✨Satisfaction guaranteed.Thank YouThanks for checking this library out! I hope you find it useful.Of course, there's always room for improvement. Feel free to open an issue so we can make Falcon-Ask better.Special thanks to@muxspacefor giving me an Echo Dot.
Package: falcon-auth0
Falcon Auth0 Authorization MiddlewareAuth0 Authorization Middleware for The Falcon Web FrameworkInstallInstall through pip via$pipinstallfalcon-auth0UsageYou will need to supply a Dictionary containing Auth0 settings. These configurations can be supplied in two different
ways. For the average user, you can supply a Dictionary of String keys and String values, such as:cfg={'alg':['RS256'],'audience':'my.app.name.auth0.com/userinfo','domain':'my.app.name.auth0.com',# or 'https://my.app.name.auth0.com/''jwks_uri':'https://my.app.name.auth0.com/.well-known/jwks.json'}If your application has multiple environments (Development, Test, QA, User Acceptance, Production), you may supply a
Dictionary of String environment keys and Dictionary values of String keys with String Values, such as:cfg={'dev':{'alg':['RS256'],'audience':'my.dev.environment.auth0.com/userinfo','domain':'my.dev.environment.auth0.com',# or 'https://my.dev.environment.auth0.com/''jwks_uri':'https://my.dev.environment.auth0.com/.well-known/jwks.json'},'test':{'alg':['RS256'],'audience':'my.test.environment.auth0.com/userinfo','domain':'my.test.environment.auth0.com',# or 'https://my.test.environment.auth0.com/''jwks_uri':'https://my.test.environment.auth0.com/.well-known/jwks.json'},'uat':{'alg':['RS256'],'audience':'my.uat.environment.auth0.com/userinfo','domain':'my.uat.environment.auth0.com',# or 'https://my.uat.environment.auth0.com/''jwks_uri':'https://my.uat.environment.auth0.com/.well-known/jwks.json'},'prod':{'alg':['RS256'],'audience':'my.prod.environment.auth0.com/userinfo','domain':'my.prod.environment.auth0.com',# or 'https://my.prod.environment.auth0.com/''jwks_uri':'https://my.prod.environment.auth0.com/.well-known/jwks.json'}}Once complete, you'll inject the middleware directly into Falcon'sfalcon.API([...,Auth0Middleware(cfg),...]).
Package: falcon-avishan
Avishan is a set of tools for building fast, comfortable and reliable falcon apps.Quick startOn linux remember to install this packages:pip install cython
pip install -v --no-binary :all: falconCreate virtual environment for your project:sudo -H pip3 install virtualenvCreate your views with inheriting classes from “AvishanView”:class NewsView(AvishanView):
    url = 'news/'

def get(self):
    # entire get method
    pass

def post(self):
    # entire post method
    passAt the end of your file, add this to create server:stage = AvishanFalconStage()You can run your server simply with wsgiref:if __name__ == '__main__':
    from wsgiref import simple_server

    httpd = simple_server.make_server('127.0.0.1', 8000, stage.app)
    httpd.serve_forever()Features
Package: falcon-client
CSFalcon-ClientPython API client wrapper for CrowdStrike Falcon Query API.FeaturesRetrieve prevention policy detailsSearch for falcon agentsRetrieve falcon agent detailsContain host (RTR)ReferencesCrowdStrike Falcon Swagger UIFalcon oAuth2 Token APICrowdStrike OAuth2-Based APIsHost and host group management APIsDetection and Prevention Policy APIsReal Time Response APIsInstallpipinstallfalcon-clientConfiguration file[falcon]client_id=4uxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxclient_key=bAt1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx# HTTP Interception Proxy;proxy_host = localhost;proxy_port = 8080ExamplesInitialize clienttry:# default config ~/.crowdstrike/csfalcon.inifc=falcon_client.FalconClient()# fc = falcon_client.FalconClient(config_file_path='~/csfalcon.ini')# fc = FalconClient.basic(client_id='',#                         client_key='',#                         proxy_host='localhost', proxy_port=8080)exceptExceptionaserr:sys.exit(err)else:fc.login()print(fc)Retrieve prevention policy details# POLICY DETAILSprint("Prevention Policies")forresultinfc.prevention_policies_details(ids=None):print(json.dumps(result,indent=2))Device ScrollSearch for hosts in your environment by platform, hostname, IP, and other criteria with continuous pagination capability (based on offset pointer which expires after 2 minutes with no maximum limit)print("DEVICE SCROLL")hosts_resp=fc.device_scroll(limit=10,fql_filter='platform_name: "Linux" +first_seen: >= "2020-12-11T00:00:00Z"')forhostinhosts_resp:print(json.dumps(host,indent=2))Device SearchSearch for hosts in your environment by platform, hostname, IP, and other criteria.Device Search supports the same options as Device Scroll. The only difference between Device Search and Device Scroll is their pagination and response limit:Device Search: Standard pagination (page number, page size) up to 150,000 devicesDevice Scroll: Continuous pagination (based on an offset pointer) with no maximum limitprint("DEVICE SEARCH")hosts_resp=fc.device_search(limit=10,fql_filter='platform_name: "Windows"',q="dubai")# hosts_resp = fc.device_search(limit=10, q="rooster")forhostinhosts_resp:print(json.dumps(host,indent=2))Device DetailsGet details on one or more hosts by providing agent IDs (AID).# find host AIDshosts_resp=fc.device_search(limit=10,q="rooster")aids=set()forhostinhosts_resp:aids.update(host)# Get details for each AIDhost_details=fc.device_details(aids)forhostinhost_details:print(json.dumps(host,indent=2))Device ContainmentContain or lift containment on a specified host. When contained, a host can only communicate with the CrowdStrike cloud and any IPs specified in your containment policy.# DEVICE CONTAINMENTaids=set(['7983795a198d40xxxxxxxxxx418aa385','fb8456dfe15xxxxxxxxxxxc9893e1a06'])print("DEVICE CONTAINMENT")forhostsinfc.device_details(list(aids)):forhostinhosts:print(json.dumps(host['hostname'],indent=2))success,fail,err=fc.lift_containment(list(aids))print(f"Success:{success}")print(f"Failure:{fail}")print(f"Errors:{err}")
Package: falcon-core
falcon CoreFalcon Core Inspired by Django for Falcon API Framework.Installationpipinstallfalcon-coreUser guideStarting projectfalcon-corestartprojectapiCreate project api and folder apiapi/api/manage.pyapy/api/apy/api/__init__.pyapy/api/settings.pyapy/api/routes.pyapy/api/wsgi.pyfalcon-corestartprojectapi.Create project api in my location foldermy_location/manage.pymy_location/api/my_location/api/__init__.pymy_location/api/settings.pymy_location/api/routes.pymy_location/api/wsgi.pyfalcon-corestartprojectapifolderCreate project api in folderfolder/manage.pyfolder/api/folder/api/__init__.pyfolder/api/settings.pyfolder/api/routes.pyfolder/api/wsgi.pyStarting project apppythonmanage.pystartappexampleCreate app in project direxample/__init__.pyexample/resources.pyexample/routes.pypythonmanage.pystartappexample.example1Create app in appexample/example1/__init__.pyexample/example1/resources.pyexample/example1/routes.pypythonmanage.pystartappexample2.example3example2/__init__.pyexample2/example3/__init__.pyexample2/example3/resources.pyexample2/example3/routes.pyCreate resource in example.resource.pyimport falcon

from falcon_core.resources import Resource


class ExampleResource(Resource):
    def on_get(self, req, resp, **kwargs):
        resp.status = falcon.HTTP_OK
        resp.media = {'key': 'value'}Add resource to routesexample.routes.pyfrom falcon_core.routes import route

from example.resources import ExampleResource

routes = [
    route('/example', ExampleResource()),
](1) api.resource.pyfrom falcon_core.routes import route, include

from example.routes import routes as example_routes

routes = [
    route('', include(example_routes)),
](2) api.routes.pyfrom falcon_core.routes import route, include

routes = [
    route('', include('example.routes')),
]Add middlewareIn api.settings.py...
MIDDLEWARE = [
    'module.MiddlewareOrMiddlewareInstance'
]
...Add router convertersIn api.settings.py...
ROUTER_CONVERTERS = [
    'name': 'module.Converter'
]
...Change root routesIn api.settings.py...
ROUTES = 'module.routes'  # must have routes list
...
Package: falcon-crossorigin
falcon-crossoriginA simpleFalconmodule for Cross-Origin Resource Sharing (CORS).Installpipinstallfalcon-crossoriginUsageimportfalconfromfalcon_crossoriginimportCrossOrigincross_origin=CrossOrigin(allow_origins="https://app.example.com",allow_methods="GET,POST",allow_headers="Pragma,Expires,Cache-Control",allow_credentials=True,expose_headers="Link",max_age=3600,)api=falcon.API(middleware=[cross_origin])CreditsPort ofEcho'sCORS middleware.
Package: falcondale
Falcondale Software Development Kit (SDK) is an open source project aiming to ease the barrier for Data Scientists entering the field of Quantum Machine Learning.DocumentationOfficial documentation can be found here:https://falcondale.readthedocs.io/en/latest/To check the roadmap of the project, have a look to:https://github.com/orgs/stafford-computing/projects/2How to contributeCheck out thewikifor the latest convention on how to contribute.AuthorsStafford Computing LLCLicenseThis project is licensed under the terms of the MIT license.
Package: falcon-datamover
Falcon: Online File Transfers OptimizationThe application can only correctly function on Linux-based operating systems due to several Linux-based functional dependencies.InstallationYou can install the falcon-datamover package fromPyPI:pip install falcon-datamoverorpython3 -m pip install falcon-datamoverThe Falcon package is supported on Python 3.6 and above.UsageFalcon is a command line application. please run help to find required arguments$ falcon --help
usage: falcon [-h] [--host HOST] [--port PORT] [--data_dir DATA_DIR] [--method METHOD] [--max_cc MAX_CC] [--direct DIRECT] [--checksum CHECKSUM] agent

positional arguments:
agent                Please choose agent type: sender or receiver

optional arguments:
-h, --help           show this help message and exit
--host HOST          Receiver host address; default: 127.0.0.1
--port PORT          Receiver port number; default: 50021
--data_dir DATA_DIR  data directory of sender or receiver
--method METHOD      choose one of them : gradient, probe
--max_cc MAX_CC      maximum concurrency
--direct DIRECT      enable direct I/O
--checksum CHECKSUM  enable checksum verificationfor example: on the receiver node:$ falcon receiver --host 10.10.1.2 --port 5000 --data_dir /data/dest/similarly, on the sender node:$ falcon sender --host 10.10.1.2 --port 5000 --data_dir /data/src/ --method probe
Package: falcon-dbapi
Falcon API resources for databases. See thefulldocumentation <http://falcon-api.readthedocs.io>.InstallationRun:pipinstallfalcon_dbapiPackages required for specific databases:PostgreSQL or other RDBMS:SQLAlchemy,alchemyjsonschemaElasticSearch:elasticsearch-dslMongoDB:mongoengineUsageBelow is an example app with:an index of available resourcesautomapped tablesbasic authentication using a tokenimportfalconfromfalcon_dbapi.middlewares.auth_middlewareimportAuthMiddlewarefromfalcon_dbapi.middlewares.json_middlewareimportRequireJSON,JSONTranslator,JsonErrorfromfalcon_dbapi.resources.indeximportIndexResourcefromfalcon_dbapi.resources.sqlalchemyimportCollectionResource,SingleResourcefromsqlalchemy.ext.automapimportautomap_basefromsqlalchemyimportcreate_enginefromwsgirefimportsimple_serverengine=create_engine("sqlite:///mydatabase.db")Base=automap_base()Base.prepare(engine,reflect=True)app=application=falcon.API(middleware=[AuthMiddleware('/',{'project-id':'token-value'}),RequireJSON(),JSONTranslator(),])forname,modelinBase.classes.items():app.add_route('/'+name,CollectionResource(model,engine)),app.add_route('/'+name+'/{id}',SingleResource(model,engine)),app.add_route('/',IndexResource(['/'+namefornameinBase.classes.keys()]))app.add_error_handler(Exception,JsonError.handle)simple_server.make_server('localhost',8888,app).serve_forever()Test it using httpie:httphttp://localhost:8888/
Package: falcon-elastic-apm
falcon-elastic-apmFalconelastic-apm middleware for application performance monitoring.Installationpip install falcon-elastic-apmUsageAdd middleware to your app:fromfalcon_elastic_apmimportElasticApmMiddleware...app=falcon.API(middleware=[ElasticApmMiddleware(service_name='falcon_apm',server_url='http://localhost:8200')])
Package: falcon-filtering
A small falcon hook to parse filtering elements from the request.UsageThe easiest way to use this hook is the following:classResource:filtering_fields=("foo","bar")# List of fields allowed for filtering@falcon.before(FilteringHook())defon_get(self,req,resp,user):# Here req['context']['filters'] is setThe Hook will look in the query parameters for parameters looking likefilter[key]=value.It will create a filters dict into the request context accessible atreq.context['filters'].
Inside this dict the key will be the one extracted from between the brackets.
i.e.keyin the example above.Configuration optionsAllowing fields to be filteredFor security reasons, the fields allowed for filtering must be specified in thefiltering_fieldsattribute of the resource.All the fields not defined in it will be discarded by the hook.Hook configurationOne parameter can be passed to the hook:filtering_key : The base name of the key used for the filters. Default:filter.Example:@falcon.before(PaginationFromRequestHook(filtering_key='custom_filter',))defon_get(self,req,resp,user):# Get request
Package: falcon-heavy
AboutThe framework for building app backends and microservices by specification-first API design approach based on theOpenAPI Specification 3.Falcon Heavy converts and validates requests and renders responses corresponded specification. It can be used withDjango,FalconandFlaskweb frameworks.InstallationRecommended way (via pip):$pipinstallfalcon-heavyUsageImplement all abstract methods from a corresponding decorator class.Set up routing based on a specification.Decorate views with your decorator.LimitationsXML is not supported.Can’t use reserved characters in path and query parameters.Recursive dependencies detection not implemented.LicenseCopyright 2019-2020 Not Just A Toy Corp.Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Package: falconify
The Scaffolding tool for Falconify.This scaffolding tool includes a set of commands that allows you to bootstrap your modules following the suggested structure for the Falconify template.Scaffold usage:Start a project:falconify bootstrapBoot a module:falconify create-module Pricing or Pricing_TierThis will create:Bridging:The Command Handler: - this will create a new directory under Application/Features and it will place the handler there. You don't need to modify anything here.Port:The Request Handler: - this will create a new directory under Application/Infrastructure/Port/Request and it will place the handler there. You don't need to modify anything here.The Router: - this will create a new file and add it to the Application/Infrastructure/Port/Request/. You don't need to modify anything here for your general CRUD.The Transformer: - this will create a new transformer under Application/Infrastructure/Port/Transformer. You will need to modify this file to implement your contract.Adapter:The Repository: - this will create a new file on Adapters/Repository. You will need to modify the methods (create / update) in this file to fulfil your data requirementsDomain:The Model: - this will create a new file on Domain/Model. You will need to model your object in this file.The Use Case: - this will create a new file on Domain/UseCases. You don't need to do much in this file, unless you're doing something out of the normal CRUD. But yes, your business logic should be implemented here.Once all of this is done, you can implement your route on Application/Main.py, by:Importing your new route - found on Application/Infrastructure/Port/Request/Routes.pyTo invoke the route by: Routes().define(self)You're ready to consume.This does not cater for migration. Falconify currently uses alembic to manage the migrations.