Saravanan666/pypi-org huggingface dataset:
Package: openai-usage-logger
openai_usage_loggerThis library provides a simple way to log OpenAI API usage and costs. It maintains a record of the number of prompt and completion tokens used for different OpenAI models, as well as the associated costs.Installpip install openai-usage-loggerFeaturesTracks usage and costs for different tags and models.Allows logging of token usage and costs in a structured format.Provides flexibility to use a custom logger.UsageBasic UsageUse the library to log responses from OpenAI's completion API, including the model used and the associated costs.importopenaifromopenai_usage_loggerimportusageLogger# Example OpenAI completion API callresponse=openai.ChatCompletion.create(model='gpt-3.5-turbo-0125',messages=messages,)usageLogger().log(response)Logging the response with a usage tagusageLogger().log(response,tag='usage_tag')Advanced Usage with Custom LoggerYou can also pass a custom logger to the log method if you want to use a specific logging configuration.importloggingfromopenai_usage_loggerimportusageLoggerSet up your custom loggercustom_logger=logging.getLogger('my_custom_logger')logging.basicConfig(level=logging.INFO)Using the custom loggerusageLogger().log(response,tag='usage_tag',logger=custom_logger)Model Costs
The package currently supports cost calculation for the following models:GPT-4 models (including various versions)
GPT-3.5-Turbo models (including various versions)
Costs are based on the number of tokens used for prompts and completions, with different rates for different models.
Package: openai-utilities
This is a privately maintained wrapper library on top of openai python Driver/SDK. Currently openai python Driver/SDK can be used to access both OpenAI and Anyscale public endpoints. This wrapper provides abstraction to access the models hosted by both of the endpoints. It currently uses the openai.OpenAI().chat.completions to make synchronous calls. It automatically handles rate limit error, context window resizing and large message splitting to fit within message token limit. Look athttps://github.com/soumitsalman/openai-utilitiesfor more info.
Package: openai-utilties
OpenAI Utility LibraryThis library provides a set of utility functions to interact with OpenAI's API, focusing on generating chat responses, creating text embeddings, formatting response data, and generating images from prompts. It leverages the OpenAI Python client to facilitate these tasks.Table of ContentsInstallationUsageFunctionsgenerate_chat_responsecreate_text_embeddingformat_response_datagenerate_image_from_promptExamplesContributingLicenseInstallationTo use this library, you need to have Python installed on your system. You also need to install the OpenAI Python client. You can do this by running the following command in your terminal:pipinstallopenaiUsageTo use the functions provided by this library, you need to import the library and then call the desired function. Here's a basic example:importopenai_utility_libraryasoai# Generate a chat responsecontext="Hello, how can I help you today?"response=oai.generate_chat_response(context)print(response)# Create a text embeddinginput_string="This is a sample text."embedding=oai.create_text_embedding(input_string)print(embedding)# Format response dataformatted_data=oai.format_response_data(response)print(formatted_data)# Generate an image from a promptprompt="A beautiful sunset over the ocean."image=oai.generate_image_from_prompt(prompt)print(image)Functionsgenerate_chat_responseThis function generates a chat response based on the provided context. It supports both string and list inputs for the context.Parameters:context: The context for the chat response. Can be a string or a list of message objects.model: The model to use for generating the response. Default is "gpt-3.5-turbo-1106".temperature: The temperature for the model. Default is  1.Returns:The generated chat response as a string.create_text_embeddingThis function creates a text embedding for the given input string.Parameters:input_string: The string for which to create the text embedding.Returns:A list representing the text embedding.format_response_dataThis function formats the response data from OpenAI's API into a more readable format.Parameters:response: The response object from OpenAI's API.Returns:A dictionary containing the formatted response data.generate_image_from_promptThis function generates an image based on the provided prompt.Parameters:prompt: The prompt for generating the image.quality: The quality of the generated image. Default is 'standard'.Returns:The generated image.ExamplesFor detailed examples on how to use each function, refer to theUsagesection.ContributingContributions are welcome! Please feel free to submit a pull request or open an issue if you find any bugs or have suggestions for improvements.LicenseThis library is licensed under the MIT License. See the LICENSE file for more details.
Package: openalias
Privex PyrewallA Python tool to queryOpenAlias records- for easily grabbing all cryptocurrency addresses associated with a domain. Uses DNS-over-HTTPs by default for security, but also supports plain DNS if needed.OpenAlias.py - A Python tool for easily querying OpenAlias records
Copyright (c) 2023    Privex Inc. ( https://www.privex.io )

Copyright::

    +===================================================+
    |                 © 2023 Privex Inc.                |
    |               https://www.privex.io               |
    +===================================================+
    |                                                   |
    |        OpenAlias.py - A python OpenAlias Client   |
    |        License: X11/MIT                           |
    |                                                   |
    |        https://github.com/Privex/openalias-py     |
    |                                                   |
    |        Core Developer(s):                         |
    |                                                   |
    |          (+)  Chris (@someguy123) [Privex]        |
    |                                                   |
    +===================================================+Quickstart InstallWe recommend that you use Python 3.7 or newer, as the tool makes use of dataclasses.It might be possible to run on 3.6 at the lowest, but you'll need to install thedataclassesbackport packageInstall via PyPi with Pippython3-mpipinstall-UopenaliasInstall from sourcegitclonehttps://github.com/Privex/openalias-py.gitcdopenalias-py# You can either use pip to install it, or setup.py# Via pippip3install.# Via setup.pypython3setup.pyinstallUsage# You can either use the command which is supposed to be auto-installed into /usr/local/bin# or ~/.local/bin - or you can use python3 -m openalias# View help (independent command script)openaliaspy--help# View help (using the command via python module call)python3-mopenalias--help# Get the XMR address associated with the domain privex.ioopenaliaspygetprivex.ioxmr# Get JUST the LTC address on it's own associated with the domain privex.io# (useful for programmatic use)openaliaspyget-pprivex.ioltc# List all addresses associated with privex.io in a colourful rich tableopenaliaspylistprivex.io# List the addresses and other data in plain comma-separated textopenaliaspylist-pprivex.io# Use standard DNS instead of DNS-over-HTTPs to list/get privex.io's addressesopenaliaspy-Pdnslistprivex.io
openaliaspy-Pdnsgetprivex.ioxmr# Use a custom resolver for DNS-over-HTTPs or standard DNSopenaliaspy-Pdns-r9.9.9.9getprivex.iobtc
openaliaspy-rhttps://dns.privex.iolistprivex.ioLicenseOpenAlias.py is released under the X11 / MIT License, seeLICENSEfor more info.Thanks for reading!If this project has helped you, considergrabbing a VPS or Dedicated Server from Privex-prices start at as little as US$0.99/mo (we take cryptocurrency!)You can also donate to us using our OpenAlias addressprivex.io:)
Package: openallure
Open Allure is a voice-and-vision enabled dialog systemFor the latest version, please checkhttp://openallureds.orgDependenciesThese may vary depending on the platformdragonflyhttp://code.google.com/p/dragonfly/Pygamehttp://www.pygame.org/download.shtmlVersion 1.9.1 was used during development of Open AllureBeautifulSouphttp://www.crummy.com/software/BeautifulSoup/download/3.x/BeautifulSoup-3.0.8.tar.gzVersion 3.0.8 was used during development of Open Allure
(easy_install BeautifulSoup)NLTKhttp://www.nltk.org/downloadSteven Bird, <sb@csse.unimelb.edu.au>LicenseCopyright (c) 2010 John GravesMIT License.  See LICENSE.txtContributorsJohn Graves, <john.graves@aut.ac.nz>
Brian Thorne, <brian.thorne@canterbury.ac.nz>
Package: openalpr
InstallationMake sure your computer has the commercial engine installed. This can be achieved by installing either theOpenALPR Agentor theCommercial SDK. This ensures that the C code bound to this Python package is available on your system.IMPORTANT: you cannot use this package without a product license. If you need an evaluation license, please request onehere.Install this Python binding:pip install openalprExampleDownload and image of a car with the license plate visible, save to your computer, and run the following code:importjsonfromopenalprimportAlpralpr=Alpr("us","/path/to/openalpr.conf","/path/to/runtime_data")ifnotalpr.is_loaded():print("Error loading OpenALPR")sys.exit(1)results=alpr.recognize_file("/path/to/image.jpg")print(json.dumps(results,indent=4))alpr.unload()On Linux systems, the default paths for files required to instantiate the Alpr class are/etc/openalpr/openalpr.conf/usr/share/openalpr/runtime_dataAnd on Windows systemsC:\OpenALPR\Agent\etc\openalpr\openalpr.confC:\OpenALPR\Agent\usr\share\openalpr\runtime_data
Package: open-answerx
OAT - OPEN AnswerX ToolThis script implements a way to easily interact with the AnswerX OPEN API. You can dump tables,
view its schema and target either production or staging environments.
The tool works on top ofAkamai {OPEN} Edgegrid Authentication_ scheme. For more information
visit theAkamai {OPEN} Developer Community_.To learn more about how Edgegrid works, visit:Requests:http://docs.python-requests.orgAkamai {OPEN} Edgegrid authentication:https://developer.akamai.com/introduction/Client_Auth.htmlAkamai {OPEN} Developer Community:https://developer.akamai.comTo learn more about AnswerX, visit:DNS For Network Operators:https://www.akamai.com/us/en/products/network-operator/dnsi-cacheserve.jspAnswerX {OPEN} API:https://developer.akamai.com/api/network_operator/answerx/v1.htmlInstallation$ pip install open-answerxAnd make sure you have a .edgerc file in your home folder containing your API credentials (create the file if it doesn't exist).Contribute#. Forkthe repositoryto start making your changes to themasterbranch
#. Write a test which shows that the bug was fixed or that the feature works as expected.
#. Send a pull request and bug the maintainer until it gets merged and published.  :)the repository:https://github.com/dxiri/OATAuthorDiego Xirinachs
Package: open-aoi
Welcome to Open AOI!This is a support package forOpen AOI project.Open AOI is ROS2 powered Automated Optical Inspection framework, developed as part of my master thesis atBUT Brnouniversity. Project aims to provide development environment for PCB optical inspection tasks in production. Project targetsRaspberry Piplatform yet it is possible to use any other general purpose computer. Project usedockerandNice GUIfor frontend.Please refer main project repository for details.Run web serviceStart web server with the following command.python -m open_aoi_web_interface.mainRun GPIO servicepython -m -m open_aoi_gpio_interface.main
Package: openap
Open Aircraft Performance Model (OpenAP) and ToolkitThis repository contains the OpenAP model data and Python packages for aircraft performance and emission calculations.More information on user guide and related articles at:OpenAP.devThe most recent development fork of OpenAP is:https://github.com/junzis/openap. For discussions and issues, you can use the following links:https://github.com/junzis/openap/discussions(discussions, feedback and suggestions)https://github.com/junzis/openap/issues(bug reporting)InstallInstall the development branch from GitHub:pipinstall--upgradegit+https://github.com/junzis/openapInstall the latest stable release from pypi:pipinstall--upgradeopenapInstall the latest stable release on conda-froge:condainstallopenapContentOpenAP library has two parts, which areOpenAP model dataandOpenAP Python packages.Model dataData in this repository includes:Aircraft data: Collected from open literature.Engines data: Primarily from ICAO emission data-bank, including fuel flow and emissions.Drag polar data: Exclusively derived from open data (reference).Kinematic data: Kinematic model (formallyWRAP) describe speed, altitude, and vertical rate.Navigation data: Airport and waypoints obtained fromX-plane.Python packagesThe OpenAP Python library includes the following packages:prop: a package for accessing aircraft and engine propertiesthrust: a package for computing aircraft thrustdrag: a package for computing aircraft dragfuel: a package for computing fuel consumptionemission: a package for computing aircraft emissionskinematic: a package for accessing WRAP dataaero: a package for common aeronautical conversionsnav: a package for accessing navigation informationsegment: a package for determining climb, cruise, descent, level flightphase: a wrapper aroundsegment, providing identification of all flight phasestraj: package contains a set of tools for trajectory generationCiting OpenAP@article{sun2020openap,
  title={OpenAP: An open-source aircraft performance model for air transportation studies and simulations},
  author={Sun, Junzi and Hoekstra, Jacco M and Ellerbroek, Joost},
  journal={Aerospace},
  volume={7},
  number={8},
  pages={104},
  year={2020},
  publisher={Multidisciplinary Digital Publishing Institute}
}
Package: openapi2awsapigateway
Adapt OpenAPI and Swagger files to include AWS API Gateway IntegrationsInstallation$ pip install -r requirements.txt

$ python setup.py installDevelopmentThis project includes a number of helpers in theMakefileto streamline common development tasks.Environment SetupThe following demonstrates setting up and working with a development environment:### create a virtualenv for development

$ make virtualenv

$ source env/bin/activate


### run openapi2awsapigateway cli application

$ openapi2awsapigateway --help


### run pytest / coverage

$ make testReleasing to PyPiBefore releasing to PyPi, you must configure your login credentials:~/.pypirc:[pypi]
username = YOUR_USERNAME
password = YOUR_PASSWORDThen use the included helper function via theMakefile:$ make dist

$ make dist-uploadDeploymentsDockerIncluded is a basicDockerfilefor building and distributingOpenAPI to AWS API Gateway,
and can be built with the includedmakehelper:$ make docker

$ docker run -it openapi2awsapigateway --help
Package: openapi2jsonschema
openapi2jsonschemaA utility to extractJSON Schemafrom a
validOpenAPIspecification.WhyOpenAPI contains a list of typedefinitionsusing a superset of JSON
Schema. These are used internally by various OpenAPI compatible tools. I
found myself however wanting to use those schemas separately, outside
existing OpenAPI tooling. Generating separate schemas for types defined
in OpenAPI allows for all sorts of indepent tooling to be build which
can be easily maintained, because the canonical definition is shared.Installationopenapi2jsonschemais implemented in Python. Assuming you have a
Python intepreter and pip installed you should be able to install with:pip install openapi2jsonschemaThis has not yet been widely tested and is currently in aworks on my
machinestate.UsageThe simplest usage is to point theopenapi2jsonschematool at a URL
containing a JSON (or YAML) OpenAPI definition like so:openapi2jsonschema https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.jsonThis will generate a set of schemas in aschemasdirectory. The tool
provides a number of options to modify the output:$ openapi2jsonschema --help
Usage: openapi2jsonschema [OPTIONS] SCHEMA

  Converts a valid OpenAPI specification into a set of JSON Schema files

Options:
  -o, --output PATH  Directory to store schema files
  -p, --prefix TEXT  Prefix for JSON references (only for OpenAPI versions
                     before 3.0)
  --stand-alone      Whether or not to de-reference JSON schemas
  --kubernetes       Enable Kubernetes specific processors
  --strict           Prohibits properties not in the schema
                     (additionalProperties: false)
  --help             Show this message and exit.ExampleMy specific usecase was being able to validate a Kubernetes
configuration file without a Kubernetes client likekubectland
without the server. For that I have a bash script shown below:#!/bin/bash -xe# This script uses openapi2jsonschema to generate a set of JSON schemasfor# the specified Kubernetes versions in three different flavours:##   X.Y.Z - URL referenced based on the specified GitHub repository#   X.Y.Z-standalone - de-referenced schemas, more useful as standalonedocuments#   X.Y.Z-local - relative references, useful to avoid the networkdependencyREPO="garethr/kubernetes=json-schema"declare-aarr=(1.6.61.6.51.6.41.6.31.6.21.6.11.6.01.5.61.5.41.5.31.5.21.5.11.5.0)forversionin"${arr[@]}"doschema=https://raw.githubusercontent.com/kubernetes/kubernetes/v${version}/api/openapi-spec/swagger.jsonprefix=https://raw.githubusercontent.com/${REPO}/master/v${version}/_definitions.jsonopenapi2jsonschema-o"${version}-standalone"--stand-alone"${schema}"openapi2jsonschema-o"${version}-local""${schema}"openapi2jsonschema-o"${version}"" --prefix "${prefix}" "${schema}"doneThe output from running this script can be seen in the accompanyinggarethr/kubernetes-json-schema.
Package: openapi2jsonschema_ng
This is a fork of openapi2jsonschema that can be installed for modern Python.
It still exposes the same interface, and the executable is still calledopenapi2jsonschema.openapi2jsonschemaA utility to extractJSON Schemafrom a
validOpenAPIspecification.WhyOpenAPI contains a list of typedefinitionsusing a superset of JSON
Schema. These are used internally by various OpenAPI compatible tools. I
found myself however wanting to use those schemas separately, outside
existing OpenAPI tooling. Generating separate schemas for types defined
in OpenAPI allows for all sorts of indepent tooling to be build which
can be easily maintained, because the canonical definition is shared.Installationopenapi2jsonschemais implemented in Python. Assuming you have a
Python intepreter and pip installed you should be able to install with:pip install openapi2jsonschema-ngThis has not yet been widely tested and is currently in aworks on my
machinestate.UsageThe simplest usage is to point theopenapi2jsonschematool at a URL
containing a JSON (or YAML) OpenAPI definition like so:openapi2jsonschema https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.jsonThis will generate a set of schemas in aschemasdirectory. The tool
provides a number of options to modify the output:$ openapi2jsonschema --help
Usage: openapi2jsonschema [OPTIONS] SCHEMA

  Converts a valid OpenAPI specification into a set of JSON Schema files

Options:
  -o, --output PATH  Directory to store schema files
  -p, --prefix TEXT  Prefix for JSON references (only for OpenAPI versions
                     before 3.0)
  --stand-alone      Whether or not to de-reference JSON schemas
  --kubernetes       Enable Kubernetes specific processors
  --strict           Prohibits properties not in the schema
                     (additionalProperties: false)
  --help             Show this message and exit.ExampleMy specific usecase was being able to validate a Kubernetes
configuration file without a Kubernetes client likekubectland
without the server. For that I have a bash script,available here.The output from running this script can be seen in the accompanyinginstrumenta/kubernetes-json-schema.
Package: openapi2omg
AssumptionsIf there are multiple content types available for a given path, the content typeapplication/jsonshall be preferred if available. Ifapplication/jsonis not
available, then an appropriate content type will be chosen arbitrarilyOMG doesn't support multiple responses. As such, the following order of response
codes are considered as successful operations:200, 201, 202, 2XX, 204, default.
Furthermore, since multiple content types are not supported,application/jsonwill be used if available. Ifapplication/jsonis not available, then an
appropriate content type will be chosen arbitrarilytodosrelated:https://github.com/microservices/microservice.guide/issues/50https://github.com/microservices/microservice.guide/pull/96
Package: openapi2oms
openapi2omsThis tool aims to convert an OpenAPI 3 spec to its corresponding OMS
equivalent. Not all features are supported, and some assumptions have
been made. Please read the caveats section to understand these
assumptions.Storyscriptresult=openapi2omsconvertspec:openApiSpecproperties:{"serverIndex":0}CaveatsAssumptionsIf there are multiple content types available for a given path, the content typeapplication/jsonshall be preferred if available. Ifapplication/jsonis not
available, then an appropriate content type will be chosen arbitrarilyOMS doesn't support multiple responses. As such, the following order of response
codes are considered as successful operations:200, 201, 202, 2XX, 204, default.
Furthermore, since multiple content types are not supported,application/jsonwill be used if available. Ifapplication/jsonis not available, then an
appropriate content type will be chosen arbitrarilytodosrelated:https://github.com/microservices/openmicroservices.org/issues/50https://github.com/microservices/openmicroservices.org/pull/96LicenseMIT License
Package: openapi3
A PythonOpenAPI 3 Specificationclient and validator for Python 3.Validation ModeThis module can be run against a spec file to validate it like so:python3 -m openapi3 /path/to/specUsage as a ClientThis library also functions as an interactive client for arbitrary OpenAPI 3
specs. For example, usingLinode’s OpenAPI 3 Specificationfor reference:from openapi3 import OpenAPI
import yaml

# load the spec file and read the yaml
with open('openapi.yaml') as f:
    spec = yaml.safe_load(f.read())

# parse the spec into python - this will raise if the spec is invalid
api = OpenAPI(spec)

# call operations and receive result models
regions = api.call_getRegions()

# authenticate using a securityScheme defined in the spec's components.securitySchemes
api.authenticate('personalAccessToken', my_token)

# call an operation that requires authentication
linodes  = api.call_getLinodeInstances()

# call an operation with parameters
linode = api.call_getLinodeInstance(parameters={"linodeId": 123})

# the models returns are all of the same (generated) type
print(type(linode))                      # openapi.schemas.Linode
type(linode) == type(linodes.data[0])    # True

# call an operation with a request body
new_linode = api.call_createLinodeInstance(data={"region":"us-east","type":"g6-standard-2"})

# the returned models is still of the correct type
type(new_linode) == type(linode)     # TrueHTTP basic authentication and HTTP digest authentication works like this:# authenticate using a securityScheme defined in the spec's components.securitySchemes
# Tuple with (username, password) as second argument
api.authenticate('basicAuth', ('username', 'password'))Running TestsThis project includes a test suite, run viapytest.  To run the test suite,
ensure that you’ve installed the dependencies and then runpytestin the root
of this project.RoadmapThe following features are planned for the future:Request body models, creation, and validation.Parameters interface with validation and explicit typing.Support for more authentication types.Support for non-json request/response content.Full support for all objects defined in the specification.