Saravanan666/pypi-org huggingface dataset:
Package: orwynn-rbac
👮 Role-Based-Access-Control module for Orwynn frameworkGives controls to roles and their permissions in your backend application.InstallationVia Poetry:poetryaddorwynn_rbacUsageDefine default roles in your application:DefaultRoles=[DefaultRole(name="sergeant",title="Sergeant",description="Flexible policeman",permission_names=set("yourcompany.yourproject.citizen.permission.citizen:get","yourcompany.yourproject.tax.permission.tax:create","yourcompany.yourproject.pursue.permission.start:do")),...]NOTE: Default roles are initialized only once per fresh database.In your Boot setup, initialize a RBACBoot class and get a bootscript from it:fromorwynn_rbacimportRBACBootBoot(...,bootscripts=[...,RBACBoot(default_roles=DefaultRoles).get_bootscript()])In any module, where RBAC functionality is required (e.g. user access
checkers), importorwynn_rbac.module:importorwynn_rbacyour_module=Module(...,imports=[...,orwynn_rbac.module])Checking accessTo check an access to your controller you are free to implement own middleware,
retrieve an user id, e.g. from HTTP authorization header, and pass it to ourAccessService.check_user()method. A minimal middleware might look like this:classAccessMiddleware(HttpMiddleware):def__init__(self,covered_routes:list[str],service:AccessService,)->None:super().__init__(covered_routes)self.service:AccessService=serviceasyncdefprocess(self,request:HttpRequest,call_next:Callable,)->HttpResponse:user_id:str|None=request.headers.get("user-id",None)self.service.check_user(user_id,str(request.url.components.path),request.method)response:HttpResponse=awaitcall_next(request)returnresponseThe methodAccessService.check_user()will raise aForbiddenErrorif an
user with given id has no access to the route and method, so you just need to
call it with these arguments.
Package: oryks-docstring-generator
documentation-generatorOvereviewThis is a python library for generating documentation for python projects. It is built to:Generate function docstringsGenerate class docstrings include class method docstrings (still under development)Generate sphinx documentation (still under development)The library usesopenai'sgpt model to generate the function docstrings. You pass it a file or folder path togther with anopenaiapi key. It then parses the folder for python files, then for each file, it finds the functions and classes, generates their documentation and updates their docstrings.RequirementsPython 3.10+Works on Linux, Windows, macOS, BSDInstallationpipinstalloryks-docstring-generatorUsageFirst, provide theopenaiapi key:exportOPENAI_API_KEY=sk-xxxxxxxxxxxThen run the application, providing the path to the python file to generate docs for or the folder containing the python files:python-mdocstring_generator--path/home/lyle/tutorial/test-docstrings-generator/test/--directories-ignorevenv
--files-ignoretest.py--overwrite-function-docstringTrue--overwrite-class-docstringTrue--overwrite-class-methods-docstringTrue--documentation-styleNumpy-StyleDocumentation and TutorialsTo learn more about the library including the documentation and tutorials, check out thelibraries' documentation.How to ContributeTo contribute, chack out thecontribution guideline.LicenseThe API uses anMIT LicenseDeveloperLyle Okoth –@lyleokothon twitterlyle okothon mediumMy email islyceokoth@gmail.comHere is myGitHub ProfileYou can also find me onLinkedin
Package: oryks-google-calendar
google-calendarOverviewA python library for working with the google calendar. Allows the developer to programatically perform the following tasks:Schedule an eventFind all scheduled eventsSearch for specific scheduled eventsDelete or update scheduled eventsCreate calendarsGetting startedTou use this library, you will need a Google (GMail) Account and Google Credentials. Follow the instructions in this shortarticleto get an API key.Installing the librarypipinstalloryks-google-calendarSchedulin an eventfromgoogle_calendarimportGoogleCalendarclient_secret:str='client_secret.json'google_calendar:GoogleCalendar=GoogleCalendar(secret_file=client_secret)google_calendar.authenticate()print(google_calendar.quick_add('Meeting with emmanuel at 10.00 am tommorrow.'))
Package: oryks-youtube
youtubeOverviewA python library that wraps around the YouTube V3 API. You can use it find and manage YouTube resources including Videos, Playlists, Channels and Comments.The library is modelled afterGoogle's own documentation.RequirementsPython 3.10+Works on Linux, Windows, macOS, BSDInstallationpipinstalloryks-youtubeGet startedTo get started, you need a verified Google Account and Google API keys with the correct permissions.How to Get A Google API KeyFollow the instructions in this shortarticleto get an API key.To get a particular video using the videos' id:Create an instance of the YouTube API passing in the path to the downloaded client secret file:fromyoutubeimportYouTubeclient_secrets_file='/home/lyle/Downloads/secrets.json'youtube=YouTube(client_secrets_file)youtube.authenticate()Use the video id to find the video:video=youtube.find_video_by_id('rfscVS0vtbw')To find many videos using their id's:ids=['rfscVS0vtbw','TFa38ONq5PY']videos=youtube.find_videos(ids)To find the most popular videos in a given region e.g Kenya, pass in the region code:popular_kenyan_videos=youtube.find_most_popular_video_by_region('ke')To search for videos (this returns an iterator):fromyoutube.schemasimport(SearchFilter,SearchOptionalParameters,SearchPart,YouTubeResponse,YouTubeRequest)fromtypingimportIteratorfromyoutube.modelsimportVideoquery:str='Python programming videos'max_results:int=10part:SearchPart=SearchPart()optional_parameters:SearchOptionalParameters=SearchOptionalParameters(q=query,maxResults=max_results,type=['video','playlist','channel'])search_request:YouTubeRequest=YouTubeRequest(part=part,optional_parameters=optional_parameters)video_iterator:Iterator=youtube.get_search_iterator(search_request)videos:list[Video]=next(video_iterator)Documentation and TutorialsTo learn more about the library including the documentation and tutorials, check out thelibraries' documentation.How to ContributeTo contribute, chack out thecontribution guideline.LicenseThe API uses anMIT LicenseDeveloperLyle Okoth –@lylethedesigneron twitterlyle okothon mediumMy email islyceokoth@gmail.comHere is myGitHub ProfileYou can also find me onLinkedin
Package: orzo
OrzoRendering Client Application for NOODLES and PythonDescriptionOrzo is the first client application to build on the NOODLES protocol to render 3d scenes in Python. NOODLES allows multiple client
applications to interact collaboratively with data in real-time, and now these scenes can be easily displayed in Python.DocumentationFor more information, check outthe documentation.InstallationInstallation is as simple as:pipinstallorzoSimple Exampleimportorzoorzo.run("ws://localhost:50000")Hungry for more NOODLES?For more information and other related repositories check outthis collection
Package: os0
This module extends python os module with a few new functionality
to interface operating system.It recognizes file name structure and manages both URI standard name
both local name, as UNC and ODS5.URI (Uniform Resource Identifier) is standard posix filename.UNC (Uniform Naming Convention) is windows standardODS5 is used for define OpenVMS standard filenamesAn example of URI filename is ‘/home/myfile’.UNC example for the same of previous URI name is ‘homemyfile’
(with single backslash).ODS5 (OpenVMS) for the same of previous URI name is ‘[home]myfile’
Package: os2borgerpc-client
This repository contains os2borgerpc-client, a Python library which functions as a
client for the OS2borgerPC Admin system.The code was developed by Magenta ApS (https://www.magenta.dk) and is part of the
OS2borgerPC project.For more information about the OS2borgerPC project, please see the
official home page:https://os2.eu/produkt/os2borgerpcand the offical Github project:https://github.com/OS2borgerPC/Read the documentation for this project in the docs/ directory or atRead The Docs.This library is available to you according to the conditions in version 3 of
the GNU General Public License. See the LICENSE file for details.
Package: os2mo-dar-client
OS2mo DAR ClientOS2mo DAR Client is a client forDAWA / DAR.RequirementsPython 3.8+Dependencies:More ItertoolsAIOHTTPRA UtilsInstallation$pipinstallos2mo-dar-clientUsagefromos2mo_dar_clientimportDARClientdarclient=DARClient()withdarclient:print(darclient.healthcheck())LicenseThis project is licensed under the terms of the MPL-2.0 license.
Package: os2mo-fastapi-utils
OS2MO-FastAPI-UtilsUtility library with various reusable FastAPI components.Instrumentation UsageInstall into your project usingpip:pip install os2mo-fastapi-utilsThen import it inside a Python file:from fastapi import FastAPI
from os2mo_fastapi_utils.tracing import setup_instrumentation

app = FastAPI()

@app.get("/")
async def root():
    return {"message": "Hello World"}

app = setup_instrumentation(app)Keycloak AutenticationTheauthpackage in this module provides a Keycloak authDependscoroutine
for FastAPI. Do (e.g.) the following to use this in FastAPI:from fastapi import FastAPI, Depends
from structlog import get_logger

from os2mo_fastapi_utils.auth.exceptions import AuthenticationError
from os2mo_fastapi_utils.auth.oidc import get_auth_dependency
from os2mo_fastapi_utils.auth.oidc import get_auth_exception_handler
from myproject.models import MyToken

logger = get_logger()

auth = get_auth_dependency(
           host='keycloak',
           port=8081,
           realm='mo',
           token_url_path='service/token',
           token_model=MyToken
       )

app = FastAPI()
app.add_exception_handler(
    AuthenticationError,
    get_auth_exception_handler(logger)
)

@app.get("/")
async def root(token: Token = Depends(auth)):
    return {"message": "Hello World"}
Package: os2mo-http-trigger-protocol
OS2mo HTTP Trigger ProtocolThis package contains the interfaces used for the OS2mo http trigger protocol.UsageInstall into your project usingpip:pip install os2mo-http-trigger-protocolThen import it inside a Python file:from typing import List

from os2mo_http_trigger_protocol import (
    EventType,
    MOTriggerPayload,
    MOTriggerRegister,
    RequestType,
)
from fastapi import FastAPI

app = FastAPI()


@app.get(
    "/triggers",
    summary="List triggers to be registered.",
    response_model=List[MOTriggerRegister],
)
def triggers():
    """List triggers to be registered."""
    return [
        {
            "event_type": EventType.ON_BEFORE,
            "request_type": RequestType.EDIT,
            "role_type": "org_unit",
            "url": "/triggers/ou/edit",
        }
    ]

@app.post(
    "/triggers/ou/edit",
    summary="Print that an organizational unit has been edited",
)
async def triggers_ou_create(payload: MOTriggerPayload):
    """Fired when an OU has been created."""
    return {"Hello": "World"}
Package: os2mo-init
OS2mo InitOS2mo Initialiser.Builddocker build . -t os2mo-initWhich yields:...
Successfully built ...
Successfully tagged os2mo-init:latestAfter which you can run:docker run --rm os2mo-init --helpWhich yields:Usage: __main__.py [OPTIONS]

Options:
  --lora-url TEXT              Address of the LoRa host  [env var: LORA_URL;
                               default: http://localhost:8080]

  --root-org-name TEXT         Name of the root organisation  [env var:
                               ROOT_ORG_NAME; default: Magenta Aps]

  --municipality-code INTEGER  Municipality code of the root organisation
                               [default: 1234]

  --help                       Show this message and exit.

  In addition to the listed environment variables, the program accepts
  parameters from environment variables using the format
  'OS2MO_INIT_<OPTION>'; for example 'OS2MO_INIT_MUNICIPALITY_CODE'.
  Furthermore, the following environment variables are used to establish a
  connection to LoRa:

  CLIENT_ID [default: mo]
  CLIENT_SECRET [required]
  AUTH_REALM [default: lora]
  AUTH_SERVER [default: http://localhost:8080/auth]UsageThe primary usage of the tool is to initialise OS2mo's LoRa database.docker run --rm os2mo-init --client-secret='hunter2'VersioningThis project usesSemantic Versioningwith the following strategy:MAJOR: Incompatible changes to existing commandline interfaceMINOR: Backwards compatible updates to commandline interfacePATCH: Backwards compatible bug fixesThe fileformat is versioned directly, and the version is exported in the file itself.LicenseThis project:MPL-2.0This project usesREUSEfor licensing. All licenses can be found in theLICENSES folderof the project.
Package: os2mo-sd-connector
SDConnectorConnector library for SDLon webservicesUsageInstall into your project usingpip:pip install os2mo-sd-connectorThen import it inside a Python file:import asyncio
from os2mo_sd_connector import SDConnector

async def print_org():
    sd_connector = SDConnector("BZ", "username", "password")
    organization = await sd_connector.getOrganization()
    print(organization)

asyncio.run(print_org())
Package: osada
Installpip install osadaDescriptionThis is a module for my own use.It has some useful features to solve what I usually find troublesome.
Please use it if you like.The functions are as follows. - Colored print - Generation of sequenceIf I’m writing Python and find it annoying, I’ll add function more.Usageimport osadaColored printosada.cprint(string, color, background, end, bloom, **kwarg)osada.cprint("hello!", "orange", "white")

# # The writing below is the same as the sentence above
# osada.cprint("hello!", "ff8844", "ffffff")
# osada.cprint("hello!", color="ff8844", background="ffffff")osada.colored(string, color, background, bloom)print(f"The three primary colors of light are \
{osada.colored('red', color='red')}, \
{osada.colored('green', color='green')}、\
{osada.colored('blue', color='blue')}.")Generation of sequenceosada.array(inf, sup, number)inf : start numbersup : end numbernumber : element countosada.array(1, 2, 2)
# [1.0, 2.0]

osada.array(1, 2, 5)
# [1.0, 1.25, 1.5, 1.75, 2.0]

osada.array(1, 2, 11)
# [1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7000000000000002, 1.8, 1.9, 2.0]osada.randomArray(inf, sup, number, isint)inf : start numbersup : end numbernumber : element countisint : is integer valueosada.randomArray(0, 1, 5)
# [0.8081470327591642, 0.8900165197747789, 0.3057814178026007, 0.005010722833622361, 0.7636094070498007]

osada.array(1, 10, 10, True)
# [5, 8, 2, 10, 9, 4, 10, 3, 5, 6]
Package: osadl-matrix
osadl-matrixThis is a machine readable version of theOSADL license compatibility matrixas a python library.Changelog of the provided dataA detailed changelog of the provided data can be foundhereLicenseThis module is licensed underUnlicensedlicense. Feel free to do whatever you want with it.Data licenseThe raw data of the OSADL Open Source License Checklists are licensed under the Creative Commons Attribution 4.0 International license (CC-BY-4.0),https://creativecommons.org/licenses/by/4.0/.© 2017 - 2021 Open Source Automation Development Lab (OSADL) eG and contributors,info@osadl.orgFurther information can be foundhereA copy of the CC-BY-4.0 text can be foundhereDisclaimerWe are not affiliated, associated, endorsed by, or in any way officially connected with the Open Source Automation Development Lab (OSADL) eG, or any of its subsidiaries or its affiliates. The official OSADL website can be found athttps://www.osadl.org.UsageUsing builtin functionsimportosadl_matrixresult=osadl_matrix.is_compatible("BSD-3-Clause","MIT")# result is either# True - licenses are compatible# False - licenses are *NOT* compatibleresult=osadl_matrix.get_compatibility("GPL-2.0-only","MIT")# result is either# osadl_matrix.OSADLCompatibility.YES - licenses are compatible# osadl_matrix.OSADLCompatibility.NO - licenses are *NOT* compatible# osadl_matrix.OSADLCompatibility.UNKNOWN - license compatibility is uncertain# osadl_matrix.OSADLCompatibility.CHECKDEP - compatibility has depencies that need to be checked# osadl_matrix.OSADLCompatibility.UNDEF - at least one of the licenses are not present in the OSADL matrixresult=osadl_matrix.supported_licenses()# result is a set of supported license (identifiers)Using the raw dataimportcsvimportosadl_matrixwithopen(osadl_matrix.OSADL_MATRIX)ascsvinput:creader=csv.reader(csvinput,delimiter=',',quotechar='"')forrowincreader:print(row)or as jsonimportjsonimportosadl_matrixwithopen(osadl_matrix.OSADL_MATRIX_JSON)asjsoninput:cnt=json.read(jsoninput)print(cnt)
Package: osafe
OSafe PythonA Python implementation of OSafe.RequirementsPython 3.6+Installation# use --user unless in virtual envpip3.6installosafe--userUsageosafeThat's it!Distributepython3.6-mvenvvenv
.venv/bin/activate

pipinstall--upgradepipsetuptoolswheeltwine
rm-rfdist/
pythonsetup.pysdistbdist_wheel
twineupload--repository-urlhttps://test.pypi.org/legacy/dist/*
Package: osaft
osaftThe OSAFT Python package implements classical theories for the
computation of the acoustic scattering, acoustic streaming, and the acoustic
radiation force on a particle subjected to an ultrasonic wave. The package
provides a unified API that allows for the simple evaluation of quantities
often used in the research field of microscale acoustofluidics.
Also included in the package are plotting tools (using Matplotlib), so
generated results can easily be illustrated.InstallationAll systems withpip/pythoninstalledpython-mpipinstallosaftIf you want to learn more go to the documentation'sinstallation page.Usage exampleExamples how the OSAFT library can be used can be found on ourexamples pageof the
documentation.PublicationAresearch article(open-access) on the OSAFT library has been published the Frontiers in Physics.Release HistoryFind the changes introduced with new releases in theCHANGELOG.md.LicenseThe distribution is licenced under the GNU Lesser General Public License. SeeLICENSE.mdto learn more.ContributingFork it (https://gitlab.com/acoustofluidics/osaft/-/forks/new)Create your feature branch (git checkout -b feature/fooBar)Commit your changes (git commit -am 'Add some fooBar')Push to the branch (git push origin feature/fooBar)Create a new Pull Request
Package: os-aio-pod-channel
os-aio-pod-channelA os-aio-pod component for transporting.This lib is designed as a component ofos-aio-podframework. It is mainly used for transporting data between TCP endpoints. The os-aio-pod built-in TCP server is used as background drive engine. With the middleware/extension mechanism, you can easily build aio programs like Proxy or MITM server.Installpip install os-aio-pod-channelConceptionEngine: Used to adapt with os-aio-pod framework, drive the whole event loop. It is also an access point for the components communicate with each other.Endpoint: Each incoming or outgoing connection is called endpoint. typically, just engine use it's APIs to read, write data or close connection.Channel: When incoming and outgoing endpoints all connected, a channel between them established. The engine is in charge of it's inner transporting status.Middleware: Used to communicate with channel and handle data.Extension: Used for functional expansion. Can be accessed from engine instance.UsageThis lib is used withos-aio-pod. Typically, you should define a configure file and run with os-aio-pod command line tool.A minimal configure file (do nothing, just accept TCP connection, read and drop):# config.py
BEANS  = [
    {
        'core'  : 'os_aio_pod.contrib.tcp_server.TCPServerAdapter',
        'server': 'os_aio_pod_channel.engine.Engine',
        'MIDDLEWARES': [],
        'EXTENSIONS': [],
    }
]os-aio-pod run -c config.py --debugMiddlewareWhen data transporting or channel closed the corresponding method of middlewares will be invoked in specific order. You should inherit fromos_aio_pod_channel.middleware.Middlewareand configure class, id and other parameters of each middleware inMIDDLEWARESlist.ExtensionYou shold inherit fromos_aio_pod_channel.extension.Extensionand config class, name and other parameters of each extension inEXTENSIONSlist. You can get extension byengine.extension_manager.get_extension(extension_name)Unit TeststoxLicenseMIT licensed.
Package: osais
osaisThe osais Python lib for connecting AIs to OSAIS cloudInstallpip install osaisRequirementsKept minimal (boto3, Jinja2, requests, schedule, watchdog, Werkzeug)AI that includes osais package must have a ./_input and a ./_output directory, for receiving and generating files
Support of uploading to AWS S3 is providedSupporteric [at] incubiq [dot] com
Package: osam
OsamGet up and running with segment-anything models locally.Osam(/oʊˈsɑm/) is a tool to run open-source segment-anything models locally
(inspired byOllama).Osamprovides:Segment-Anything Models- original SAM, Efficient-SAM;Local APIs- CLI & Python & HTTP interface;Customization- Host custom vision models.InstallationPippipinstallosamQuickstartTo run with Efficient-SAM:osamrunefficient-sam--image<image_file>Model libraryHere are models that can be downloaded:ModelParametersSizeDownloadSAM 91M91M100MBosam run sam:91mSAM 308M308M320MBosam run sam:308mSAM 636M636M630MBosam run samEfficient-SAM 10M10M40MBosam run efficient-sam:10mEfficient-SAM 25M25M100MBosam run efficient-samPS.sam,efficient-samis equivalent tosam:latest,efficient-sam:latest.UsageCLI# Run a model with an imageosamrunefficient-sam--imageexamples/_images/dogs.jpg>output.png# Get a JSON outputosamrunefficient-sam--imageexamples/_images/dogs.jpg--json# {"model": "efficient-sam", "mask": "..."}# Give a promptosamrunefficient-sam--imageexamples/_images/dogs.jpg\--prompt'{"points": [[1439, 504], [1439, 1289]], "point_labels": [1, 1]}'>output.pngInput and output images ('dogs.jpg', 'output.png').Pythonimportosam.apisimportosam.typesrequest=osam.types.GenerateRequest(model="efficient-sam",image=np.asarray(PIL.Image.open("examples/_images/dogs.jpg")),prompt=osam.types.Prompt(points=[[1439,504],[1439,1289]],point_labels=[1,1]),)response=osam.apis.generate(request=request)PIL.Image.fromarray(response.mask).save("mask.png")Input and output images ('dogs.jpg', 'mask.png').HTTP# Get up the serverosamserve# POST requestcurl127.0.0.1:11368/api/generate-XPOST\-H"Content-Type: application/json"\-d"{\"model\": \"efficient-sam\", \"image\": \"$(catexamples/_images/dogs.jpg|base64)\"}"\|jq-r.mask|base64--decode>mask.pngLicenseMIT
Package: os-api-cache
[![Travis](https://img.shields.io/travis/openspending/os-api-cache/master.svg)](https://travis-ci.org/openspending/os-api-cache)
[![Coveralls](http://img.shields.io/coveralls/openspending/os-api-cache/master.svg)](https://coveralls.io/r/openspending/os-api-cache?branch=master)# os-api-cache
Manage a cache for OpenSpending API
Package: osara
micro-framewaork on top of kappa architectureOn the top of kappa --- is a disk, called "kappa no sara" in Japanese Yokai.Syntax was inspired fromfaustandflask.from osara import Tap

tap = Tap({"bootstrap.servers":"127.0.0.1", "group.id":"demo"})

@tap.handler("topic_x")
def handle_x(msg):
	print("Got %s" % msg)

if __name__=="__main__":
	tap.start().wait()shema supportpydantic schema can be attached to topic.from pydantic import BaseModel
from osara import Tap
tap = Tap({"bootstrap.servers":"127.0.0.1", "group.id":"demo"})

@tap.schema("topic_x")
class X(BaseModel):
	msg: str

@tap.handler("topic_x")
def handle_x(msg):
	# you can access parsed data via "model" method
	print("Got %s" % msg.model().msg)

if __name__=="__main__":
	tap.start().wait()produce, then consumeSometime, we want RPC style message flow.from osara import Tap
tap = Tap({"bootstrap.servers":"127.0.0.1", "group.id":"demo"})
for msg in tap.map_reduce("topic_x", b"hello", topic_filter=["topic_x"]):
	print(msg)
	if msg.value == b"hello":
		break