Saravanan666/pypi-org huggingface dataset:
Package: abstract-http-client
Abstract Http ClientThis project is a starting template for quickly implementing a python REST api client. A concrete base class encapsulating the popularrequestslibrary is provided. Abstract base class building blocks for integrating other http libraries (such as aiohttp, etc.) are also available. The main advantage to using this base class as a starting point is to save on common boilerplate actions, which are highlighted below.Basic FeaturesSetup of session object and common general attributeshelper methods to send requests with sessionValidation and debug logging of all requests sentinternal counter of requests sentContext manager to manage session tokens (login / logout methods must be implemented)Composable client and service classesInstallationpip install abstract-http-clientBasic UsageSample implementation of api client that has no authfromabstract_http_client.http_clients.requests_clientimportRequestsClientimportjsonclassJsonPlaceholderApiClient(RequestsClient):def__init__(self,host):super().__init__(host=host,use_https=True)defget_users(self):returnself.rest_service.request_get(uri="/users").json()defget_posts(self):returnself.rest_service.request_get("/posts").json()defadd_post(self):returnself.rest_service.request_post("/posts",data={"post":"my_post"})if__name__=="__main__":api=JsonPlaceholderApiClient(host="jsonplaceholder.typicode.com")users=api.get_users()print(json.dumps(users[:2],indent=4))print(f"total requests sent{api.rest_service.request_counter}")Auth Client SampleExample that requires login and authorization header on every requestImplement a login method - here it stores header on session objectBase Class context managers call Logout onexitby defaultLogin not inenterby default, can be added if prefer to have context manager trigger login. Or just put intoinitfromabstract_http_client.http_clients.requests_clientimportRequestsClientclassSampleAuthClient(RequestsClient):def__init__(self,host,user,password):super().__init__(host=host,user=user,password=password)self.login()deflogin(self):"""  sample login - getting token and storing on requests session object """data={"user":self.user,"password":self.password}self.token=self.rest_service.request_put(uri="/login",json=data)self.rest_service.session.headers.update({"Authorization":self.token})deflogout(self):"""  sample logout - invalidating token and clearing session auth header """self.rest_service.request_delete(uri=f"/logout/{self.token}")self.rest_service.session.headers.pop({"Authorization":self.token})defget_stuff(self)->dict:""" NOTE: this is pseudocode, not real endpoint """returnself.rest_service.request_get("/stuff").json()if__name__=="__main__":# Context manager will handle api logoutwithSampleAuthClient(host="192.168.1.3",user="admin",password="admin")asapi:# call your api herestuff=api.get_stuff()# Do more stuff
Package: abstract-instrument-interface
abstract_instrument_interfaceThis package contains general classes for interfaces and GUIs, which are inherited by different other packages to control lab instruments.InstallationUse the package manager pip to install,pipinstallabstract-instrument-interfaceUsed byThis is a list of all instrument interfaces that use this package (and that are compatible with Ergastirio)pyThorlabsPM100xpyThorlabsAPT
Package: abstract-ip-geolocation-api
IP Geolocation for Python (geolocation-api-python)Python library for Abstract free IP Geolocation API.Full documentation can be found on AbstractIP Geolocation APIpage.Getting startedGetting started with Abstract IP Geolocation API is very simple, you just need to install the library into your project as follow:pipinstallabstract-ip-geolocation-apiFrom there you can then call the geolocationapi as follow:# Import abstract ip geolocation api moduleimportimportlibabstract_ip_geolocation_api=importlib.import_module("abstract-ip-geolocation-api")# Initiate the geolocation api with a free API key retrieved on https://www.abstractapi.com/ip-geolocation-apigeolocation_api=abstract_ip_geolocation_api.v1('YOUR_API_KEY')# Fetch location data for a given IP# Note: If you don't provide an ip_address value, then the requester IP will be usedlocation_data=geolocation_api.geolocate(ip_address="ANY_IP_ADDRESS")# Process location data and potential errorsif'ip_address'inlocation_data:# Location data has been successfully retrievedcountry=location_data['country']city=location_data['city']print(country)elif'error'inlocation_data:# Handle Abstract related errorserror=location_data['error']print(error)else:# No location data available for this IPprint('No location data available for this IP')
Package: abstract.jwrotator
abstract.jwrotator Package Readme=========================Overview--------abstract.jwrotator is a simple wrapper to JW Image Rotator(http://www.jeroenwijering.com/?item=jw_image_rotator).It simply provides the a jwrotator_view for Folder and Topics.#TODO:- make portlet configurableChangelog for abstract.jwrotatorabstract.jwrotator - 0.3- added JWRotator Portlet [Steven Shade]- added some other configurable featuresabstract.jwrotator - 0.2- Changed namespace to abstract.*- Fix an issue on automatic "Plone Default" skin switch after install [DaviLima]plone.jwrotator - 0.1 Unreleased- Initial package structure.[zopeskel]
Package: abstract-metrics
✨Abstract✨ metricsA lightweight framework for defining arbitrary business metrics as Python code.Installationpipinstallabstract-metricsBasic UsageInstallSubclass one of the metric types (e.g. ApplicationMetricBoolean)Add an optimisticcomputemethod that returns your metric.Register a runner with your metric and run it!ExampleLet's say you want to write a metric that checks if one of your applications follows your organizations application naming standards. We will use the ApplicationMetricBoolean type to do this. All metrics are formated as{subject}Metric{type}. In this case, our subject is anApplicationand our type isBoolean.Because Applications are our subject, we need to subclassApplicationMetricBoolean. This class has a few methods that we can use to help us compute our metric. The most important one iscompute. This method is called by the runner and should return a the boolean value. Additionally, we should use theapplicationproperty (via theApplicationwrapper) to store any context we need to compute this metric.frommetricimportApplication,ApplicationMetricfrommetric.utilsimportMatrixRunnerfrommetric.typesimportOutputFormatdefmain():# Construct list of basic Application objectsapps=[Application(app)forappin["myorg-sales-app","sandbox-dinasour"]]# Construct a list of our metricsmetrics=[AppNameCompliance]# This will not only construct our Application Metrics but it will also execute# them and print them to stdout as a table.MatrixRunner(format=OutputFormat.OUTPUT_FORMAT_TABLE).run(apps,metrics)classAppNameCompliance(ApplicationMetricBoolean):r"""All Application names should start with 'myorg-'."""defcompute(self):ifself.application.name.startswith("myorg-"):returnTruereturnFalseIf we run this code, we'll get the following output:ApplicationAppNameCompliance
myorg-finance-appTrue
myorg-marketing-serviceTrue
myorg-sales-appTrue
sandbox-dinasourFalse
Package: abstract-modules
#abstract_modulesPython Module Upload to PyPIThis utility script allows you to easily upload your Python module to the Python Package Index (PyPI) using Twine. It automates several steps of the packaging and distribution process, making it easier to share your module with the Python community.PrerequisitesBefore using this script, ensure you have the following prerequisites:Python 3.x installed on your systemtwine,build,abstract_utilities,abstract_guiandpexpectpackages installed. You can install them usingpip:pipinstalltwinebuildpexpectGetting StartedClone the repository or download the script file (upload_to_pypi.py) to your local machine.Navigate to the directory where your Python module is located using the command line.Optional: If you use a virtual environment, activate it before proceeding.UsageRun the scriptupload_to_pypi.pywith Python 3:python3upload_to_pypi.pyThe script will guide you through the following steps:Selecting Module Directory: You will be prompted to pick the module directory using a GUI window. This directory should contain the necessary files, including thesetup.pyfile.Updating Version Number: If the version number in thesetup.pyfile matches an existing version in thedistdirectory, you will be asked to enter a new version number.Building the Module: The script will build your module using thesetup.pyscript. The distribution files (wheels) will be placed in thedistdirectory.Uploading to PyPI: The script will prompt you to enter your PyPI username and password securely. It will then upload the module to PyPI using Twine.Installing the Module: After successful upload, you will have the option to install the module using pip for testing purposes.Examplefromabstract_modules.upload_utilsimportupload_mainupload_main("path_to_parent_directory")ContributingContributions are welcome! If you find any issues or have suggestions for improvements, please feel free to create an issue or submit a pull request.LicenseThis utility script is open-source and distributed under theMIT License.AcknowledgmentsThis script utilizes the following packages and resources:pexpect- For automating interactive command-line applications.Twine- For securely uploading Python packages to PyPI.Python- The Python programming language.DisclaimerThis script is provided "as is" without warranty of any kind. Use it at your own risk.SupportIf you encounter any issues or need assistance, pleasecreate an issueor seek support in the Python community forums.Thank you for using our utility script! If you have any feedback or questions, don't hesitate to contact us. Happy packaging and distributing!
Package: abstract-scorm-xblock
Abstract Scorm XBlockYet another SCORM XBlock for Open edX®.Supports course export/import. Editable within Open edx Studio. Saves student state and reports scores to the progress tab of the course.
Currently supports SCORM 1.2 and SCORM 2004 standards.Developed byAbstract Technology, based onedx_xblock_scormbyRaccoon Gang.InstallationInstall package withpip install abstract-scorm-xblockUsageAddabstract_scorm_xblockto the list of advanced modules in the advanced settings of a course.Add ascormcomponent to your Unit.Upload a zip file containing your content package.Theimsmanifest.xmlfile must be at the root of the zipped package. Make sure you don't have an additional directory at the root of the zip archive.Publish your content as usual.DevelopmentSetupTo setup the development environment:create a Python3 virtualenv. If direnv is installed adirenv allowshould be enough.install derex withpip install -r requirements.txtsetup the derex project. Readhttps://derex.page/quickstart.html#quickstartfor further informations.Development and DebuggingIn order to be able to develop and debug effectively some steps may be taken:get a shell inside the container:cd derex_project
ddc-project exec cms shsetup the package in editable mode. This will allow for testing changes without the need to reinstall the package:pip install -e /openedx/derex.requirements/abstract_scorm_xblocklaunch the Django debug server manually and bind it on port81:python manage.py cms runserver 0:81on your browserhttps://studio.scorm.localhost:81should now be available. You should now be able to insert debug code in both Python and JS files and benefit from Django runserver auto reload feature.Running testsTests can be run with:ddc-project run --rm lms python manage.py lms test abstract_scorm_xblock --keepdbThe first time this command is run it will initialize the test database. Remove the--keepdbflag if you want the test database to be created/destroyed each time.To run a coverage report:ddc-project run -e COVERAGE_RCFILE=../derex.requirements/abstract_scorm_xblock/.coveragerc --rm lms sh -c "coverage run manage.py lms test abstract_scorm_xblock --keepdb && coverage html"This will produce an HTML coverage report in theabstract_scorm_xblock/htmlcovdirectory.You can also use the Makefile shortcuts:make test
make coverageCaveatsIf a SCORM package is deleted from the course "Files & Uploads" section, the Import/Export functionality will export a course with a broken XBlock.TODODelete extracted old SCORM packages from default storage
Package: abstract-server
abstract ServerTable of ContentsIntroductionInstallationGetting StartedDocumentationContactLicenseIntroductionInstallation ofabstract-serverTo installabstract_server, you can either use pip or manually set it up by cloning the repository:Using pip:pipinstallabstract-serverNote:abstract_serverrequires Python 3.6 or later. Ensure you meet this requirement before proceeding with the installation.Getting StartedHere is a basic example of usingabstract_server:Documentationabstract_serverconsists of the following Python files and their corresponding functionalities:1.response_handling.py:2.api_call.py:Sure, here's an exhaustivereadme.mdfor theapi_calls.pycomponent of theabstract_aimodule:api_calls.py- Abstract AI Moduleapi_calls.pyis a component of the Abstract AI module, designed to facilitate API calls to OpenAI's GPT-3 model. This module is intended to simplify the interaction with the GPT-3 API and handle responses in a structured manner.Table of ContentsOverviewInstallationUsageClasses and FunctionsPromptManagerhard_requestquick_requestExamplesContributingLicenseOverviewapi_calls.pyserves as a bridge between your application and the OpenAI GPT-3 API. It provides a convenient interface to send requests, manage responses, and control the behavior of the API calls. This module is highly customizable, allowing you to define prompts, instructions, and response handling logic.InstallationInstall the required Python packages:pipinstallopenaiSet your OpenAI API key as an environment variable. By default, the module looks for an environment variable namedOPENAI_API_KEYto authenticate API calls.UsageClasses and FunctionsPromptManager Classhard_request FunctionThehard_requestfunction sends a hard request to the OpenAI API with the provided parameters. It is a simplified way to make API calls.quick_request FunctionThequick_requestfunction sends a quick request to the OpenAI API with simple configurations and prints the result. It is a convenient shortcut for quick API interactions.ExamplesFor detailed examples and usage scenarios, refer to theexamplesdirectory in this repository. You'll find practical code samples demonstrating how to use theabstract_server.pymodule for various tasks.ContributingIf you'd like to contribute to the development of theabstract_servermodule or report issues, please refer to theContributing Guidelines.LicenseThis module is licensed under theMIT License, which means you are free to use and modify it as per the terms of the license. Make sure to review the license file for complete details.Feel free to useapi_calls.pyto enhance your interactions with OpenAI's GPT-3 model in your projects.3.endpoints.py:4.tokenization.pyContactShould you have any issues, suggestions or contributions, please feel free to create a new issue on ourGithub repository.Licenseabstract_serveris released under theMIT License.
Package: abstract-test-package
abstract_test_packageThis is a Python package that facilitates testing with abstract scenarios. Utilizing PyTest, it offers extra utilities to streamline the creation and execution of abstract tests.You can locate this package in theabstract_essentialsproject atgithub.io/abstract_endeavors/abstract_essentials/abstract_test_package/.InstallationYou can install theabstract_test_packagemodule via pip:pipinstallabstract_test_packageOr directly from the source:gitclonehttps://github.io/abstract_endeavors/abstract_essentials/abstract_test_package/cdabstract_test_package
pythonsetup.pyinstallUsageBelow is a usage example of theabstract_test_package:fromabstract_test_packageimportcreate_test,execute_testtest=create_test(name="Test 1",scenario=[...])execute_test(test)This example creates an abstract test and then executes it.DocumentationTheabstract_test_packagemodule provides the following classes and functions:create_test(name: str = 'Test', scenario: list = [...])Generates an abstract test scenario with the provided name and details.execute_test(test: any)Executes the given abstract test scenario.validate_test(test: any) -> boolVerifies if the given object is a valid test scenario.calculate_test_results(test: any) -> dictCalculates the results of a given abstract test scenario.compare_test_results(test1: any, test2: any) -> boolCompares two test scenarios and returns True if their results are equivalent, False otherwise.... and many more!Please refer to the source code for the complete list of classes and functions provided by the module, as well as their detailed documentation.ContributingContributions are welcome! Please fork this repository and open a pull request to add snippets, make grammar tweaks, etc.ContactIf you have any questions, feel free to reach out to us atpartners@abstractendeavors.com.LicenseThis project is licensed under the MIT License. See theLICENSEfile for details.Authorsputkoff - main developerThis README file was last updated on May 29, 2023.
Package: abstract-tracker
Welcome toabstract_trackerDocumentation📔 SeeFull Documentation HERE.This library help you track the business critical task status moving frompending(todo), toin_progress, then possibly tofailed(also with error traceback information) orsucceeded. If it failed too many times, it will be marked asexhausted. If you never want to see it anymore, it will be marked asignored.This library provides the abstraction layer that can work with arbitrary backend. For instance, local file, AWS S3, SQL Database, AWS DynamoDB, Redis, MongoDB, …, as you wish.Installabstract_trackeris released on PyPI, so all you need is to:$pipinstallabstract-trackerTo upgrade to latest version:$pipinstall--upgradeabstract-tracker
Package: abstrys-core
This repository contains core modules used by a number of different applications:It consists of the following modules:abstrys/app_settings.py– stores application settings in a directory named after the application
(~/.dhop/settings.json). It’s basically just a dict that knows how to store and restore itself.Installing itIf you’ve installed any of my other applications, this library is likely to be already installed.However, if you want to install it from source, just run the setup script:./setup.py install –userLicenseThis is provided as open-source software per the BSD 3-clause license. See the LICENSE file provided
with this repository for details.About the authorThis library was written by Eron Hennessey <eron@abstrys.com>.About PythonIf you want to learn more about Python (an incredibly practical and elegant programming language),
head over to <https://python.org/>!How to contributeIf you find my apps (or this library) useful, you may want to contribute. The easiest way, by far,
is bycreating a pull request!
Package: absu
absu: Azure Blob Storage UpdaterWhat is it?absuis a tool that helps you syncing a local folder to the $web container of an Azure Blob Storage. This is useful if you want to host a website that was generated with a static website generator likehugo,mkdocs,Jekyll,next.jsand so on on Azure Blob Storage...absudoes the following things:create a resource group in Azure (if not existing)create a Storage Account within that resource group (if not existing)create a $web container within that storage (if not existing)delete all files in that containerupload all data from a local folder into that containerYou can skip the first two steps by providing a connection string for an existing Azure Blob Storage.How to installYou will need these tools installed:Azure CLI2.20.0 or higherPython3.9 or higherUse the following commands to make sure your installations works.Python:python--versionPip:pip--versionAz:az--versionThen install theabsupackage with pip:pipinstallabsuHow to useShow help:python-mabsu-husage: __main__.py [-h] [-c CONNECTIONSTRING] [-s STORAGE] [-r RESOURCEGROUP] [-f FOLDER] [-v]       

Please provide at least one of the following: 1) a Azure Blob Storage name OR 2) a connection string.

optional arguments:
  -h, --help            show this help message and exit
  -c CONNECTIONSTRING, --connectionstring CONNECTIONSTRING
                        Azure Blob Storage connection string.
  -s STORAGE, --storage STORAGE
                        Azure Blob Storage resource name. Creates new one if not existing.
  -r RESOURCEGROUP, --resourcegroup RESOURCEGROUP
                        The Azure Blob Storage is in this resource group. Default: blogs-rg
  -f FOLDER, --folder FOLDER
                        Folder with static website data. Will be pushed to the storage.
  -v, --verbose         Verbose, use this flag for debugging.Execute the tool with default parameters:python-mabsuabsuwill ask you for the Azure Blob Storage name and for the local folder in the command line. If you have access to multiple subscriptions, then it will also ask you which subscription you want to use.The resource group will be called "blob-rg" per default. It can be changed with the --resourcegroup parameter.Provide a connection string:python-mabsu--connectionstring"DefaultEndpointsProtocol=https;AccountName=STORAGENAME;AccountKey=PASSWORD;EndpointSuffix=core.windows.net"Provide a local folder (mywebsite) a storage account name (mystorage01) and a resource group (mybloggroup):python-mabsu--foldermywebsite--resourcegroupmybloggroup--storagemystorage01Debugging:python-mabsu--verboseBuild this projectBuild locally:pipinstall.Build dist files:pythonsetup.pysdistUpload tohttps://test.pypi.org:twineupload--repository-urlhttps://test.pypi.org/legacy/dist/*Upload tohttps://pypi.org:twineuploaddist/*
Package: absurdia
Official Absurdia Bindings for PythonA Python library for Absurdia's API.InstallYou can install this package by using the pip tool and installing:$ pip install absurdiaSigning up to Absurdia backtestingSign up for Absurdia athttps://app.absurdia.markets/signup.Using the the packageCreate a new agent in (your dashboard)[https://app.absurdia.markets/agents] and
download the credential file. Use the agent token with the client as in the example blow.fromabsurdiaimportClient# Create clientclient=Client('<Your Agent Token>')# Get your accountaccount=client.accounts.current()Alternatively, use the environment variableABSURDIA_TOKEN, or put the credential file in the same directory as your Python script.Import a Freqtrade backtestFreqtrade backtests are run using its CLI. This Python library also comes with a CLI that can work together with Freqtrade's commands. First, add a token to authenticate your agent:$absurdialogin--token'<Your Agent Token>'Once authenicated, simply appendabsurdia backtest --to your Freqtrade backtesting command. For example:$absurdiabacktest--freqtradebacktesting--strategyAwesomeStrategy--timeframe1mLicenseLicensed under the BSD 3 license, seeLICENSE.