package
stringlengths
1
122
pacakge-description
stringlengths
0
1.3M
algoliasearch
The perfect starting point to integrateAlgoliawithin your Python projectDocumentation•Django•Community Forum•Stack Overflow•Report a bug•FAQ•Support✨ FeaturesThin & minimal low-level HTTP client to interact with Algolia's APISupports Python from3.4to3.11Contains blazing-fast asynchronous methods built on top of theAsyncio💡 Getting StartedFirst, install Algolia Python API Client via thepippackage manager:pipinstall--upgrade'algoliasearch>=3.0,<4.0'Then, create objects on your index:fromalgoliasearch.search_clientimportSearchClientclient=SearchClient.create('YourApplicationID','YourAPIKey')index=client.init_index('your_index_name')index.save_objects([{'objectID':1,'name':'Foo'}])Finally, you may begin searching a object using thesearchmethod:objects=index.search('Fo')For full documentation, visit theAlgolia Python API Client.❓ TroubleshootingEncountering an issue? Before reaching out to support, we recommend heading to ourFAQwhere you will find answers for the most common issues and gotchas with the client.Use the DockerfileIf you want to contribute to this project without installing all its dependencies, you can use our Docker image. Please check ourdedicated guideto learn more.📄 LicenseAlgolia Python API Client is an open-sourced software licensed under theMIT license.
algoliasearchasync
[![Build Status](https://travis-ci.com/algolia/algoliasearch-client-python-async.svg?token=NAo1YMSYUe1rsBFvhGmF&branch=master)](https://travis-ci.com/algolia/algoliasearch-client-python-async)[![PyPI version](https://badge.fury.io/py/algoliasearchasync.svg)](https://badge.fury.io/py/algoliasearchasync)[![Coverage Status](https://coveralls.io/repos/github/algolia/algoliasearch-client-python-async/badge.svg?branch=master)](https://coveralls.io/github/algolia/algoliasearch-client-python-async?branch=master)# Algolia Asynchronous Python ClientThis package is designed to replace the[`algoliasearch`](https://github.com/algolia/algoliasearch-client-python)package in asynchronous environments.This package is only compatible with python 3.4 and onward.## What it does- Is compatible with python `asyncio`.- Provide asynchronous alternatives to most of the client methods.All those methods are just suffixed by `_async` (`search_async`,`add_object_async`, etc.)- Still provide synchronous versions of the methods.- Uses `aiohttp` as the HTTP underlying library.- Uses `__aexit__` to avoid manually closing `aiohttp` sessions withpython >= 3.5.1.## What it does **not**- Implement the `search_disjunctive_faceting` method.- Support task canceling (yet).## Installation and DependenciesMost of the logic of the synchronous client is being used here, so thisclient depends on the synchronous one. It also depends on `aiohttp`.To install this package: `pip install algoliasearchasync`.## DocumentationAll the asynchronous functions have the same names as the synchronous oneswith `_async` appended. Synchronous methods keep the same name.Arguments taken by the asynchronous functions are the same as the synchronousone, for documentation on the behavior of each function please see:- [Synchronous python client](https://github.com/algolia/algoliasearch-client-python)- [Algolia documentation](https://www.algolia.com/doc)## ExamplesWith python >= 3.4```pythonimport asynciofrom algoliasearchasync import [email protected] main(terms):client = ClientAsync('<APP_ID>', '<API_KEY>')index = client.init_index('<INDEX_NAME>')# Create as many searches as there is terms.searches = [index.search_async(term) for term in terms]# Store the aggregated results.s = yield from asyncio.gather(*searches)# Client must be closed manually before exiting the program.yield from client.close()# Return the aggregated results.return sterms = ['<TERM2>', '<TERM2>']loop = asyncio.get_event_loop()# Start and wait for the tasks to complete.complete = loop.run_until_complete(asyncio.gather(*searches))for term, search in zip(terms, complete):print('Results for: {}'.format(term))# Display the field '<FIELD>' of each result.print('\n'.join([h['<FIELD>'] for h in search['hits']]))```With python >= 3.5.1```pythonimport asynciofrom algoliasearchasync import ClientAsync# Define a coroutine to be able to use `async with`.async def main(terms):# Scope the client for it to be closed automatically.async with ClientAsync('<APP_ID>', '<API_KEY>') as client:index = client.init_index('<INDEX_NAME>')# Create as many searches as there is terms.searches = [index.search_async(term) for term in terms]# Return the aggregated results.return await asyncio.gather(*searches)terms = ['<TERM1>', '<TERM2>']loop = asyncio.get_event_loop()# Start and wait for the tasks to complete.complete = loop.run_until_complete(main(terms))for term, search in zip(terms, complete):print('Results for {}'.format(term))# Display the field '<FIELD>' of each result.print('\n'.join([h['<FIELD>'] for h in search['hits']]))```
algoliasearch-django
The perfect starting point to integrateAlgoliawithin your Django projectDocumentation•Community Forum•Stack Overflow•Report a bug•FAQ•SupportAPI DocumentationYou can find the full reference onAlgolia's website.SetupIntroductionInstallSetupQuick StartCommandsCommandsSearchSearchGeo-SearchGeo-SearchTagsTagsOptionsCustomobjectIDCustom index nameField Preprocessing and Related objectsIndex settingsRestrict indexing to a subset of your dataMultiple indices per modelTemporarily disable the auto-indexingTestsRun TestsTroubleshootingFrequently asked questionsSetupIntroductionThis package lets you easily integrate the Algolia Search API to yourDjangoproject. It's based on thealgoliasearch-client-pythonpackage.You might be interested in this sample Django application providing a typeahead.js based auto-completion and Google-like instant search:algoliasearch-django-example.Compatible withPython 2.7andPython 3.4+.SupportsDjango 1.7+,2.xand3.x.Installpipinstallalgoliasearch-djangoSetupIn your Django settings, addalgoliasearch_djangotoINSTALLED_APPSand add these two settings:ALGOLIA={'APPLICATION_ID':'MyAppID','API_KEY':'MyApiKey'}There are several optional settings:INDEX_PREFIX: prefix all indices. Use it to separate different applications, likesite1_Productsandsite2_Products.INDEX_SUFFIX: suffix all indices. Use it to differentiate development and production environments, likeLocation_devandLocation_prod.AUTO_INDEXING: automatically synchronize the models with Algolia (default toTrue).RAISE_EXCEPTIONS: raise exceptions on network errors instead of logging them (default tosettings.DEBUG).Quick StartCreate anindex.pyinside each application that contains the models you want to index. Inside this file, callalgoliasearch.register()for each of the models you want to index:# index.pyimportalgoliasearch_djangoasalgoliasearchfrom.modelsimportYourModelalgoliasearch.register(YourModel)By default, all the fields of your model will be used. You can configure the index by creating a subclass ofAlgoliaIndexand using theregisterdecorator:# index.pyfromalgoliasearch_djangoimportAlgoliaIndexfromalgoliasearch_django.decoratorsimportregisterfrom.modelsimportYourModel@register(YourModel)classYourModelIndex(AlgoliaIndex):fields=('name','date')geo_field='location'settings={'searchableAttributes':['name']}index_name='my_index'CommandsCommandspython manage.py algolia_reindex: reindex all the registered models. This command will first send all the record to a temporary index and then moves it.you can pass--modelparameter to reindex a given modelpython manage.py algolia_applysettings: (re)apply the index settings.python manage.py algolia_clearindex: clear the indexSearchSearchWe recommend using ourInstantSearch.js libraryto build your search interface and perform search queries directly from the end-user browser without going through your server.However, if you want to search from your backend you can use theraw_search(YourModel, 'yourQuery', params)method. It retrieves the raw JSON answer from the API, and accepts inparamanysearch parameters.fromalgoliasearch_djangoimportraw_searchparams={"hitsPerPage":5}response=raw_search(Contact,"jim",params)Geo-SearchGeo-SearchUse thegeo_fieldattribute to localize your record.geo_fieldshould be a callable that returns a tuple (latitude, longitude).classContact(models.model):name=models.CharField(max_length=20)lat=models.FloatField()lng=models.FloatField()deflocation(self):return(self.lat,self.lng)classContactIndex(AlgoliaIndex):fields='name'geo_field='location'algoliasearch.register(Contact,ContactIndex)TagsTagsUse thetagsattributes to add tags to your record. It can be a field or a callable.classArticleIndex(AlgoliaIndex):tags='category'At query time, specify{ tagFilters: 'tagvalue' }or{ tagFilters: ['tagvalue1', 'tagvalue2'] }as search parameters to restrict the result set to specific tags.OptionsCustomobjectIDYou can choose which field will be used as theobjectID. The field should be unique and can be a string or integer. By default, we use thepkfield of the model.classArticleIndex(AlgoliaIndex):custom_objectID='post_id'Custom index nameYou can customize the index name. By default, the index name will be the name of the model class.classContactIndex(algoliaindex):index_name='Enterprise'Field Preprocessing and Related objectsIf you want to process a field before indexing it (e.g. capitalizing aContact'sname), or if you want to index arelated object's attribute, you need to defineproxy methodsfor these fields.ModelsclassAccount(models.Model):username=models.CharField(max_length=40)service=models.CharField(max_length=40)classContact(models.Model):name=models.CharField(max_length=40)email=models.EmailField(max_length=60)//...accounts=models.ManyToManyField(Account)defaccount_names(self):return[str(account)foraccountinself.accounts.all()]defaccount_ids(self):return[account.idforaccountinself.accounts.all()]Indexfromalgoliasearch_djangoimportAlgoliaIndexclassContactIndex(AlgoliaIndex):fields=('name','email','company','address','city','county','state','zip_code','phone','fax','web','followers','account_names','account_ids')settings={'searchableAttributes':['name','email','company','city','county','account_names',}With this configuration, you can search for aContactusing itsAccountnamesYou can use the associatedaccount_idsat search-time to fetch more data from your model (you shouldonly proxy the fields relevant for searchto keep your records' size as small as possible)Index settingsWe provide many ways to configure your index allowing you to tune your overall index relevancy. All the configuration is explained onour doc.classArticleIndex(AlgoliaIndex):settings={'searchableAttributes':['name','description','url'],'customRanking':['desc(vote_count)','asc(name)']}Restrict indexing to a subset of your dataYou can add constraints controlling if a record must be indexed or not.should_indexshould be a callable that returns a boolean.classContact(models.model):name=models.CharField(max_length=20)age=models.IntegerField()defis_adult(self):return(self.age>=18)classContactIndex(AlgoliaIndex):should_index='is_adult'Multiple indices per modelIt is possible to have several indices for a single model.First, define all your indices that you want for a model:fromalgoliasearch_djangoimportAlgoliaIndexclassMyModelIndex1(AlgoliaIndex):name='MyModelIndex1'...classMyModelIndex2(AlgoliaIndex):name='MyModelIndex2'...Then, define a meta model which will aggregate those indices:classMyModelMetaIndex(AlgoliaIndex):def__init__(self,model,client,settings):self.indices=[MyModelIndex1(model,client,settings),MyModelIndex2(model,client,settings),]defraw_search(self,query='',params=None):res={}forindexinself.indices:res[index.name]=index.raw_search(query,params)returnresdefupdate_records(self,qs,batch_size=1000,**kwargs):forindexinself.indices:index.update_records(qs,batch_size,**kwargs)defreindex_all(self,batch_size=1000):forindexinself.indices:index.reindex_all(batch_size)defset_settings(self):forindexinself.indices:index.set_settings()defclear_index(self):forindexinself.indices:index.clear_index()defsave_record(self,instance,update_fields=None,**kwargs):forindexinself.indices:index.save_record(instance,update_fields,**kwargs)defdelete_record(self,instance):forindexinself.indices:index.delete_record(instance)Finally, register thisAlgoliaIndexwith yourModel:importalgoliasearch_djangoasalgoliasearchalgoliasearch.register(MyModel,MyModelMetaIndex)Temporarily disable the auto-indexingIt is possible to temporarily disable the auto-indexing feature using thedisable_auto_indexingcontext decorator:fromalgoliasearch_django.decoratorsimportdisable_auto_indexing# Used as a context managerwithdisable_auto_indexing():MyModel.save()# Used as a decorator@disable_auto_indexing():my_method()# You can also specifiy for which model you want to disable the auto-indexingwithdisable_auto_indexing(MyModel):MyModel.save()MyOtherModel.save()TestsRun TestsTo run the tests, first find your Algolia application id and Admin API key (found on the Credentials page).ALGOLIA_APPLICATION_ID={APPLICATION_ID}ALGOLIA_API_KEY={ADMIN_API_KEY}toxTo override settings for some tests, use thesettings method:classOverrideSettingsTestCase(TestCase):defsetUp(self):withself.settings(ALGOLIA={'APPLICATION_ID':'foo','API_KEY':'bar','AUTO_INDEXING':False}):algolia_engine.reset(settings.ALGOLIA)deftearDown(self):algolia_engine.reset(settings.ALGOLIA)deftest_foo():# ...TroubleshootingUse the DockerfileIf you want to contribute to this project without installing all its dependencies, you can use our Docker image. Please check ourdedicated guideto learn more.Frequently asked questionsEncountering an issue? Before reaching out to support, we recommend heading to ourFAQwhere you will find answers for the most common issues and gotchas with the package.
algo-lib
Algo-lib (the Algorithm Library)This is a simple example package. It contains two searching algorithms. The purpose of this repo is to practice packaging a library for distribution.For package distribution information and release history, see:https://pypi.org/project/algo-lib/Quick StartInstall algo-lib from the command line using pip.python3 -m pip install --upgrade algo-libExample UsageBinary Searchfromalgo_libimportsearchlst=[1,50,99,150,40000]targetValue=99#binary search returns the index of a target value if present in a sorted listtargetIndex=search.binary(lst,0,len(lst)-1,targetValue)#targetIndex is 2Linear Searchfromalgo_libimportsearchlst=[5,1,2,100,41,-1]targetValue=-1#linear search returns the index of a target value if present in listtargetIndex=search.binary(lst,targetValue)#targetIndex is 5Merge Sortfromalgo_libimportsortlst=[5,1,2,100,41,-1]#merge sort takes a list argument, and sorts it in either increasing or decreasing ordertargetIndex=sort.merge(lst)#lst is [-1, 1, 2, 5, 41, 100]
algolibs
algolibspython algo libsTODOLinked ListRemove nth from endLinked list has cycleDetect linked list cycle entry pointStackMinStackQueueBinary Tree
algolink
Ebonite is a machine learning lifecycle framework. It allows you to persist your models and reproduce them (as services or in general).Installationpip install eboniteQuickstartBefore you start with Ebonite you need to have your model. This could be a model from your favorite library (list of supported libraries is below) or just a custom Python function working with typical machine learning data.importnumpyasnpdefclf(data):return(np.sum(a,axis=-1)>1).astype(np.int32)Moreover, your custom function can wrap a model from some library. This gives you flexibility to use not only pure ML models but rule-based ones (e.g., as a service stub at project start) and hybrid (ML with pre/postprocessing) ones which are often applied to solve real world problems.When a model is prepared you should create an Ebonite client.fromeboniteimportEboniteebnt=Ebonite.local()Then create a task and push your model object with some sample data. Sample data is required for Ebonite to determine structure of inputs and outputs for your model.task=ebnt.get_or_create_task('my_project','my_task')model=task.create_and_push_model(clf,test_x,'my_clf')You are awesome! Now your model is safely persisted in a repository.Later on in other Python process you can load your model from this repository and do some wonderful stuff with it, e.g., create a Docker image namedmy_servicewith an HTTP service wrapping your model.fromeboniteimportEboniteebnt=Ebonite.local()task=ebnt.get_or_create_task('my_project','my_task')model=client.get_model('my_clf',task)client.build_image('my_service',model)Check out examples (inexamplesdirectory) and documentation to learn more.Documentation… is availablehereExamples… are available in thisfolder. Here are some of them:Jupyter Notebook guideScikit-learn guideTensorFlow 2.0etc.Supported libraries and repositoriesModelsyour arbitrary Python functionscikit-learnTensorFlow (1.x and 2.x)XGBoostLightGBMPyTorchCatBoostModel input / output dataNumPypandasimagesModel repositoriesin-memorylocal filesystemSQLAlchemyAmazon S3ServingFlaskaiohttpCreate an issue if you need support for something other than that!ContributingReadthisChangelogCurrent release candidate0.6.2 (2020-06-18)Minor bugfixes0.6.1 (2020-06-15)Deleted accidental debug ‘print’ call :/0.6.0 (2020-06-12)Prebuilt flask server images for faster image buildMore and better methods in Ebonite clientPipelines - chain Models methods into one Model-like objectsRefactioring of image and instance APIRework of pandas DatasetType: now with column types, even non-primitive (e.g. datetimes)Helper functions for stanalone docker build/runMinor bugfixes and features0.5.2 (2020-05-16)Fixed dependency inspection to include wrapper dependenciesFixed s3 repo to fail with subdirectoriesMore flexible way to add parameters for instance running (e.g. docker run arguments)Added new type of Requirement to represent unix packages - for example, libgomp for xgboostMinor tweaks0.5.1 (2020-04-16)Minor fixes and examples update0.5.0 (2020-04-10)Built Docker images and running Docker containers along with their metadata are now persisted in metadata repositoryAdded possibility to track running status of Docker container via Ebonite clientImplemented support for pushing built images to remote Docker registryImproved testing of metadata repositories and Ebonite client and fixed discovered bugs in themFixed bug with failed transactions not being rolled backFixed bug with serialization of complex models some component of which could not be pickledDecomposed model IO from model wrappersbytes are now used for binary datasets instead of file-like objectsEliminated build_model_flask_docker in favor of Server-driven abstractionSped up PickleModelIO by avoiding ModelAnalyzer calls for non-model objectsSped up Model.create by calling model methods with given input data just onceDataset types and model wrappers expose their runtime requirements0.4.0 (2020-02-17)Implemented asyncio-based server via aiohttp libraryImplemented support for Tensorflow 2.x modelsChanged default type of base python docker image to “slim”Added ‘description’ and ‘params’ fields to Model. ‘description’ is a text field and ‘params’ is a dict with arbitrary keysFixed bug with building docker image with different python version that the Model was created with0.3.5 (2020-01-31)Fixed critical bug with wrapper_meta0.3.4 (2020-01-31)Fixed bug with deleting models from tasksSupport working with model meta without requiring installation of all model dependenciesAdded region argument for s3 repositorySupport for delete_model in Ebonite clientSupport for force flag in delete_model which deletes model even if artifacts could not be deleted0.3.3 (2020-01-10)Eliminated tensorflow warnings. Added more tests for providers/loaders. Fixed bugs in multi-model provider/builder.Improved documentationEliminate useless “which docker” check which fails on Windows hostsPerform redirect from / to Swagger API docs in Flask serverSupport for predict_proba method in ML modelDo not fix first dimension size for numpy arrays and torch tensorsSupport for Pytorch JIT (TorchScript) modelsBump tensorflow from 1.14.0 to 1.15.0Added more tests0.3.2 (2019-12-04)Multi-model interface bug fixes0.3.1 (2019-12-04)Minor bug fixes0.3.0 (2019-11-27)Added support for LightGBM modelsAdded support for XGBoost modelsAdded support for PyTorch modelsAdded support for CatBoost modelsAdded uwsgi server for flask containers0.2.1 (2019-11-19)Minor bug fixes0.2.0 (2019-11-14)First release on PyPI.
algol-reduction
No description available on PyPI.
algo-magic
This set of IPython magic extensions is provided to the first year students enrolled in the algorithmics course at ISFATES (University of Lorraine).InstallationThe recommended way to install the algo_magic extension is to use pip:pip install algo_magicIf this fails, ensure first you have a working Python 3 installation.UsageLoad the magic extensions:%load_ext algo_magicMore infoSource code on GitHub
algomart
AlgoMartCollection of algorithms in pythonSorting AlgorithmBubble Sort -bubble_sortInsertion Sort -insertion_sortSelection Sort -selection_sortQuick Sort -quick_sortMerge Sort -merge_sortHeap Sort -heap_sortCounting Sort -counting_sortRadix Sort -radix_sortSample Codefromalgomart.algorithm.sortimportbubble_sortprint(bubble_sort([3,2,1]))
algomatefix
This package is fork of QuickFIX for AlgoMate Inc, providing additionalfeatures, such as dynamic session creation.The following License is provided as a requirement from QuickFIX:The QuickFIX Software License, Version 1.0Copyright (c) 2001-2018 Oren MillerRedistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditionsare met:1. Redistributions of source code must retain the above copyrightnotice, this list of conditions and the following disclaimer.2. Redistributions in binary form must reproduce the above copyrightnotice, this list of conditions and the following disclaimer inthe documentation and/or other materials provided with thedistribution.3. The end-user documentation included with the redistribution,if any, must include the following acknowledgment:"This product includes software developed byquickfixengine.org (http://www.quickfixengine.org/)."Alternately, this acknowledgment may appear in the software itself,if and wherever such third-party acknowledgments normally appear.4. The names "QuickFIX" and "quickfixengine.org" mustnot be used to endorse or promote products derived from thissoftware without prior written permission. For writtenpermission, please contact [email protected]. Products derived from this software may not be called "QuickFIX",nor may "QuickFIX" appear in their name, without prior writtenpermission of quickfixengine.orgTHIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIEDWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIESOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL QUICKFIXENGINE.ORG ORITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOTLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OFUSE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED ANDON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUTOF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OFSUCH DAMAGE.Download-URL: http://www.algomate.coDescription: UNKNOWNPlatform: UNKNOWN
algomath-def
# This library is for test and portfolio ## Notes Since it is a combination of learning and portfolio, please install at your own risk. ## How to use will be available in “import filename” ## Available modules Example “filename.functionname” can be used ##### mcd(Methods that return the greatest common divisor)argument(int a, int b) x = filename.mcd(a,b) Returns the greatest common divisor of type int## Other matters We will add things that have been learned as functions at any time. If you have any problems or anomalies, please let me know.
algomatics
## Breif - Simple and easy way to automate your task with these readymade code
algomax
Algomax-CLIA command line tools for working with EMAX API.install the package with bellow command:-> pip install algomaxuse bellow command for working with the package:-> algomax algorithm.py config.json -p params.json -m schedule.jsonExampleHere is a simple example of usingalgomaxalgorithm.pyimport os import sys import json import math from order import Order import utils def run_algorithm(): config = utils.get_settings() trader_order = Order(config['broker_url']) params = utils.get_params() # algorithm data = fibonacci_algorithm(params['data']) # trade trader_order.create(data) def isPerfectSquare(number: int): squrare_number = int(math.sqrt(number)) return squrare_number * squrare_number == number def isFibonacci(number): return isPerfectSquare(5 * number * number + 4) or isPerfectSquare(5 * number * number - 4) def fibonacci_algorithm(data: dict): qunatity = data['quantity'] if isFibonacci(qunatity): qunatity += 3 else: qunatity -= 3 data['quantity'] = qunatity return data if __name__ == '__main__': run_algorithm()config.json{ "broker_url": "http://your-broker.server", "access_token": "YoUr-ToKeN", "account_id": "your-account-id" }params.json (your algorithm data){ "data": { "agent_id": "2", "side_id": "1", "instrument_id": "instrument-id", "price": 1234.0, "quantity": 1934, "validity_type_id": "1", "validity_date": "" } }mode.json (scheduling){ "mode": "interval", "schedule": { "start_date": "2019-09-22", "end_date": "2019-10-23", "minutes_interval": 1, "start_time": "8:30", "end_time": "13:00" } }Caution: utils.py, order.py -> usealgomax-enginepackage, but it's not ready yet ;)
algomax-common
Algomax-CommonA common tools for working withalgomax-cliandalgomax-engine.install the package with bellow command:-> pip install algomax-commonLoggingAdding logging to your Python program is as easy as this:from algomax_common.logger import AMLoggerInitiate the loggeradd below code on top of your programs fileAMLogger.init()and, use it:AMLogger.info('order created successfully', extra=with_this_data)AMLogger.error('order creation failed', extra=order_data_and_error)Note: extra is a dictExplore log filesabove code creates a directory namedlogsin your project directory.log directory structure:logs |____ error.json # contains AMLogger.error() records |____ info.json # contains AMLogger.info() records
algometer
No description available on PyPI.
algomethod
Algomethodalgo-method API for Python
algo-method-tools
algo-method-toolsalgo-method用の環境構築用コマンドラインツール入力例, 出力例を含むディレクトリを自動生成する.このプロジェクトの仕様は予告なしに変更される可能性があります (testコマンドに対応すると 変更されることが予想されます).インストール方法$pipinstallalgo-method-tools使い方$algo-tools--help Usage:algo-tools[OPTIONS]TASK_NO Arguments:TASK_NO[required]Options:--base-dirPATH[default:/home/yassu/algo-methods]--template-fileTEXT--helpShowthismessageandexit.使用例$algo-tools316writeinto/home/yassu/algo-methods/316 $cat~/algo-methods/316/ in_1.txtmain.pyout_1.txt $cat~/algo-methods/316/main.py $cat~/algo-methods/316/in_1.txt23123432$cat~/algo-methods/316/out_1.txt5# algo-tools/template.pyは自分用のテンプレートファイル$algo-tools316--base-dir~/repos/algo-tools--template-file~/algo-tools/template.py writeinto/home/yassu/repos/algo-tools/316 $ls~/repos/algo-tools/316/ in_1.txtmain.pyout_1.txt $cat~/repos/algo-tools/316/main.py frompprintimportpprint fromsysimportsetrecursionlimit,stdin fromtypingimportDict,Iterable,Set INF:int=2**62 ... $cat~/repos/algo-tools/316/in_1.txt23123432$cat~/repos/algo-tools/316/out_1.txt5オプション--template-file, -t: 使用するテンプレートファイルを指定する(指定しなければ使用されない)--base-dir, -b: ファイルを格納するディレクトリを指定する
algomize
No description available on PyPI.
algo-ml
# This is Algo-ML This is a machine learning module/library. Feel free to use any of the code.## How to use: ### Regression Call the train function on the model, giving the data as the first input and there is no other input. The input data looks like this: [[x, y], [x, y], ……..].### KMeansClustering Call the train function giving the data as input which should look like this [[x, y, ….], [x, y, ….], [x, y, ….], …….].### KNearestNeighbor Give it data to train on (just stores the data), which takes the form [[x, y, ……, LABEL], [x, y, ……, LABEL], ………..]. Use the predict function then to predict a label for a particular point.### That’s it! :)Change log0.0.1 (9/20/2020) - - - - - - - - - - First Release
algomodule
Python Hashing Library for Coin AlgorithmsSupported Algorithms:Bcrypt (algomdule._bcrypt_hash)BitBlock (algomodule._bitblock_hash)Blake (algomodule._blake_hash)Dcrypt (algomodule._dcrypt_hash)Fresh (algomodule._fresh_hash)Groestl (algomodule._groestl_hash)Hefty1 (algomodule._hefty1_hash)Jackpot (algomodule._jackpot_hash)Keccak (algomodule._keccak_hash)Scrypt (algomodule._ltc_scrypt)Myriad Groestl (algomodule._mgroestl_hash)NeoScrypt (algomodule._neoscrypt_hash)Nist5 (algomodule._nist5_hash)Quark (algomodule._quark_hash)Qubit (algomodule._qubit_hash)Sha1 (algomodule._sha1_hash)Shavite3 (algomodule._shavite3_hash)Skein (algomodule._skein_hash)3S (algomodule._threes_hash)TWE (algomodule._twe_hash)x11 (algomodule._x11_hash)x13 (algomodule._x13_hash)x14 (algomodule._x14_hash)x15 (algomodule._x15_hash)x17 (algomodule._x17_hash)AuthorAhmed BodiwalaContributingAll hashing algorithms welcome either by requests or PR'sHelp fund developmentBTC (Segwit): 33NrS6heATC5cpbKf2xVBXhGjb5byjc84GBTC (Legacy): 17zjy73pGw7GvKoPVAno7HRNeXQ4B63z2EBCH: qp9jqyydj3p73ph8ehnwwygla3fztlf6yqa7pc6vuzBTC: AY5e47xJXfw9yYNM6smf9e3vG6182vzxr3DASH: XwekGtZq9sJrJJW3C3ZRA59uEHjFVnPpL1DGB: SUQSLkn4X12xMJomfVqvU4VBWUCop1GZTSDOGE: DJ1ZmrSQ8e92yZRg1XQNu2DRcQeUYaKkEjLTC: MSAkyZB96J4dRdVGoSYJ2nYXL4AvBYXEypNMC: N4gRvEF6HSx719tcJz2VLQhzSyKYeJxzZxVTC: 3PJrdRTgjoTx6SmMwQQWpVqbwJSvmPsXhFZEC: t1L6k83EcFqPuAUTHSKp4HeC94ZUAGzERPHETH: 0x03203fcb30774703d684FD3Ec5A4f9De39C8f907ETC: 0x62A12D574167d37713294fB82D9157aC511F264a
algomojo
Algomojo - Arrow API Python Client V1ABOUTAlgomojo is a Python library that facilitates the development of trading algorithms using theAlgomojo Free APIand Free Algo Trading Platform. The library supports both REST-API interfaces and provides features such as real-time order execution, smartorder execution, placing options orders, placing multi orders, order modification/cancellation, and access to order book, trade book, open positions, orderstatus, position square-off functionalities, getquotes, profile and fund details. For a comprehensive understanding of each API's behavior, please refer to the Algomojo API documentation.LicenseAlgomojo (c) 2023. Licensed under the MIT License.DocumentationAlgomojo Rest API documentationInstallationInstall from PyPIpip install AlgomojoAlternatively, install from source. Execute setup.py from the root directory. python setup.py installAlways use the newest version while the project is still in alpha!Usage ExamplesIn order to call Algomojo trade API, you need to sign up for an trading account with one of the partner broker and obtain API key pairs and enjoy unlimited access to the API based trading. Replace api_key and api_secret_key with what you get from the web console.Getting StartedAfter downloading package import the package and create the object with api credentialsfrom algomojo.pyapi import *Creating ObjectFor creating an object there are 3 arguments which would be passedapi_key : str User Api key (logon to algomojo account to find api credentials) api_secret : str User Api secret (logon to algomojo account to find api credentials) version : str The current version of the API.Sample:algomojo=api(api_key="14ca89ea8fxd944609eea66e59cde3495fb", api_secret="76360446900d005cac830d40e03efd9c")Using Object Methodsobj.method(mandatory_parameters) or obj.method(madatory_parameters+required_parameters)Avaliable Methods1. PlaceOrder:Function with mandatory parmeters: PlaceOrder(broker,symbol,exchange,action,product,pricetype,quantity) Function with all parametrs: PlaceOrder(broker,exchange,symbol,action,product,pricetype,quantity,price, strategy,disclosed_quantity,trigger_price,amo,splitorder,split_quantity,api_key,api_secret) Sample : from algomojo.pyapi import * # Set the API Key and API Secret key obtained from Algomojo MyAPI Section algomojo=api(api_key="14ca89ea8fxd944609eea66e59cde3495fb", api_secret="76360446900d005cac830d40e03efd9c") # Place Market Order in the trading symbol RELIANCE-EQ algomojo.PlaceOrder(broker="ab", strategy="Python Example", exchange="NSE", symbol="RELIANCE-EQ", action="BUY", product="MIS", quantity=10) #Place Limit Order in the trading symbol ZOMATO-EQ algomojo.PlaceOrder(broker="ab", strategy="Python Example", exchange="NSE", symbol="ZOMATO-EQ", action="BUY", product="MIS", quantity=10, pricetype="LIMIT", price=54) #Place Larger Order in options with Split Order mode enabled algomojo.PlaceOrder(broker="ab", strategy="Python Example", exchange="NFO", symbol="NIFTY23FEB18000CE", action="BUY", product="NRML", quantity=5200, pricetype="MARKET", splitorder="YES", split_quantity=1800)2. PlaceBOOrder:Function with mandatory parmeters: PlaceBOOrder(broker,symbol,exchange,action,pricetype,quantity,price,squareoff,stoploss,trailing_stoploss) Function with all parametrs: PlaceBOOrder(broker,symbol,exchange,action,pricetype,quantity,price,squareoff,stoploss,trailing_stoploss strategy,disclosed_quantity,trigger_price,api_key,api_secret) Sample : algomojo.PlaceBOOrder(broker="ab", strategy="Python Example", exchange="NSE", symbol="YESBANK-EQ", action="BUY", pricetype="LIMIT", quantity="1", price="16.5", squareoff="2", stoploss="2", trailing_stoploss="1", trigger_price="0", disclosed_quantity="0")3. PlaceCOOrder:Function with mandatory parmeters: PlaceCOOrder(broker,symbol,exchange,action,pricetype,quantity,price,stop_price) Function with all parametrs: PlaceCOOrder(broker,symbol,exchange,action,pricetype,quantity,price,stop_price strategyapi_key,api_secret) Sample : algomojo.PlaceCOOrder(broker="ab", strategy="Python Example", exchange="NSE", symbol="YESBANK-EQ", action="BUY", pricetype="LIMIT", quantity="1", price="16.5", stop_price="15")4. PlaceFOOptionsOrder:Function with mandatory parmeters: PlaceFOOptionsOrder(broker,spot_symbol,expiry_date,action,product,pricetype,quantity,price,option_type,strike_int) Function with all parametrs: PlaceFOOptionsOrder(broker,spot_symbol,expiry_date,action,product,pricetype,quantity,price,option_type,strike_int strategy,offset,trigger_price,splitorder,split_quantity,api_key,api_secret) Sample : algomojo.PlaceFOOptionsOrder(broker="ab", strategy="Python Example", spot_symbol="NIFTY", expiry_date="23FEB", action="BUY", product="NRML", pricetype="MARKET", quantity="50", price="0", option_type="CE", strike_int="50", offset="-2", splitorder="NO", split_quantity="50")5. PlaceSmartOrder:Function with mandatory parmeters: PlaceSmartOrder(broker,symbol,exchange,action,product,pricetype,quantity,price,position_size) Function with all parametrs: PlaceSmartOrder(broker,symbol,exchange,action,product,pricetype,quantity,price,position_size strategy,disclosed_quantity,trigger_price,amo,splitorder,split_quantity,api_key,api_secret) Sample : algomojo.PlaceSmartOrder(broker="ab", strategy="Python Example", exchange="NSE", symbol="YESBANK-EQ", action="BUY", product="CNC", pricetype="MARKET", quantity="7", price="0", position_size="7", trigger_price="0", disclosed_quantity="0", amo="NO", splitorder="NO", split_quantity="2")6. PlaceStrategyOrder:Function with mandatory parmeters: PlaceStrategyOrder(strategy_id,action) Function with all parametrs: PlaceStrategyOrder(strategy_id,action,api_key,api_secret) Sample : algomojo.PlaceStrategyOrder(strategy_id="ALGO", action="BUY")7. PlaceMultiOrder:Function with mandatory parmeters: PlaceMultiOrder(broker,symbol,exchange,action,product,pricetype,quantity,price) Function with all parametrs: PlaceMultiOrder(broker,symbol,exchange,action,product,pricetype,quantity,price, strategy,disclosed_quantity,trigger_price,amo,splitorder,split_quantity,api_key,api_secret) Sample : orders=[{"api_key":"gusat281627asa827382gasg177n79","api_secret":"d872s766suwys78s7aji78673sads","broker":"ab","symbol":"IDEA-EQ","exchange":"NSE","product":"CNC","pricetype":"MARKET","quantity":2,"action":"BUY","splitorder":"YES","split_quantity":2},{"api_key":"aji7827382gasgd87273sads177n79","api_secret":"628162gusats766suwys78s77asa8","broker":"tc","symbol":"KRETTOSYS","exchange":"BSE","product":"MIS","pricetype":"LIMIT","quantity":1,"price":"0.68","action":"BUY"}] algomojo.PlaceMultiOrder(orders)8. PlaceMultiBOOrder:Function with mandatory parmeters: PlaceMultiBOOrder(broker,symbol,exchange,action,pricetype,quantity,price,squareoff,stoploss,trailing_stoploss) Function with all parametrs: PlaceMultiBOOrder(broker,symbol,exchange,action,pricetype,quantity,price,squareoff,stoploss,trailing_stoploss strategy,disclosed_quantity,trigger_price,api_key,api_secret) Sample : orders=[{"api_key":"gusat281627asa827382gasg177n79","api_secret":"d872s766suwys78s7aji78673sads","broker":"ab","symbol":"YESBANK-EQ","exchange":"NSE","pricetype":"MARKET","quantity":1,"action":"BUY","squareoff":"2","stoploss":"2","trailing_stoploss":"1"},{"api_key":"aji7827382gasgd87273sads177n79","api_secret":"628162gusats766suwys78s77asa8","broker":"tc","symbol":"BHEL-EQ","exchange":"NSE","pricetype":"LIMIT","quantity":1,"price":"75.5","action":"BUY","squareoff":"2","stoploss":"2","trailing_stoploss":"1"}] algomojo.PlaceMultiBOOrder(orders)9. PlaceMultiFOOptionsOrder:Function with mandatory parmeters: PlaceMultiFOOptionsOrder(broker,spot_symbol,expiry_date,action,product,pricetype,quantity,price,option_type,strike_int) Function with all parametrs: PlaceMultiFOOptionsOrder(broker,spot_symbol,expiry_date,action,product,pricetype,quantity,price,option_type,strike_int strategy,offset,trigger_price,splitorder,split_quantity,api_key,api_secret) Sample : orders=[{"api_key":"gusat281627asa827382gasg177n79","api_secret":"d872s766suwys78s7aji78673sads","broker":"ab","strategy":"Python Example","spot_symbol":"NIFTY","expiry_date":"23FEB","action":"BUY","product":"NRML","pricetype":"MARKET","quantity":"150","price":"0","option_type":"CE","strike_int":"50","offset":"-2","splitorder":"NO","split_quantity":"50"},{"api_key":"aji7827382gasgd87273sads177n79","api_secret":"628162gusats766suwys78s77asa8","broker":"tc","spot_symbol":"NIFTY","expiry_date":"02MAR23","action":"BUY", "product":"NRML","pricetype":"MARKET", "quantity":"150","option_type":"CE","strike_int":"50","offset":"-2","splitorder":"YES","split_quantity":"50"}] algomojo.PlaceMultiFOOptionsOrder(orders)10. ModifyOrder:Function with mandatory parmeters: ModifyOrder(broker,symbol,exchange,order_id,action,product,pricetype,quantity,price) Function with all parametrs: ModifyOrder(broker,symbol,exchange,order_id,action,product,pricetype,quantity,price, strategy,disclosed_quantity,trigger_price,strategy,api_key,api_secret) Sample : algomojo.ModifyOrder(broker="ab", exchange="NSE", symbol="YESBANK-EQ", order_id="200010639230213", action="BUY", product="CNC", pricetype="LIMIT", price="16.65", quantity="1", disclosed_quantity="0", trigger_price="0", strategy="Python Example")11. CancelOrder:Function with mandatory parmeters: CancelOrder(broker,order_id) Function with all parametrs: CancelOrder(broker,order_id,strategy,api_key,api_secret) Sample : algomojo.CancelOrder(broker="ab",strategy="Python Example", order_id="230001063923021")12. CancelAllOrder:Function with mandatory parmeters: CancelAllOrder(broker) Function with all parametrs: CancelAllOrder(broker,strategy,api_key,api_secret) Sample : algomojo.CancelAllOrder(broker="ab",strategy="Python Example")13. OrderHistory:Function with mandatory parmeters: OrderHistory(broker,order_id) Function with all parametrs: OrderHistory(broker,order_id,api_key,api_secret) Sample : algomojo.OrderHistory(broker="ab", order_id="230001063923021")14. OrderBook:Function with mandatory parmeters: OrderBook(broker) Function with all parametrs: OrderBook(broker,api_key,api_secret) Sample : algomojo.OrderBook(broker="ab")15. OrderStatus:Function with mandatory parmeters: OrderStatus(broker,order_id) Function with all parametrs: OrderStatus(broker,order_id,api_key,api_secret) Sample : algomojo.OrderStatus(broker="ab", order_id="230001063923021")16. TradeBook:Function with mandatory parmeters: TradeBook(broker) Function with all parametrs: TradeBook(broker,api_key,api_secret) Sample : algomojo.TradeBook(broker="ab")17. PositionBook:Function with mandatory parmeters: PositionBook(broker) Function with all parametrs: PositionBook(broker,api_key,api_secret) Sample : algomojo.PositionBook(broker="ab")18. OpenPositions:Function with mandatory parmeters: OpenPositions(broker) Function with all parametrs: OpenPositions(broker,symbol,product,api_key,api_secret) Sample : algomojo.OpenPositions(broker="ab", symbol= "YESBANK-EQ", exchange="NSE", product="CNC") product="CNC")19. AllPositions:Function with mandatory parmeters: OpenPositions(broker) Function with all parametrs: OpenPositions(broker,symbol,product,api_key,api_secret) Sample : algomojo.AllPositions(broker="ab", symbol= "YESBANK-EQ", exchange="NSE", product="CNC") product="CNC")20. SquareOffPosition:Function with mandatory parmeters: SquareOffPosition(broker,exchange,symbol,product) Function with all parametrs: SquareOffPosition(broker,exchange,symbol,product,strategy,api_key,api_secret) Sample : algomojo.SquareOffPosition(broker="ab", exchange="NSE", product="CNC", symbol= "IDEA-EQ", strategy="Python Example")21. SquareOffAllPosition:Function with mandatory parmeters: SquareOffAllPosition(broker) Function with all parametrs: SquareOffAllPosition(broker,strategy,api_key,api_secret) Sample : algomojo.SquareOffAllPosition(broker="ab",strategy="Python Example"))22. Holdings:Function with mandatory parmeters: Holdings(broker) Function with all parametrs: Holdings(broker,api_key,api_secret) Sample : algomojo.Holdings(broker="ab")23. Funds:Function with mandatory parmeters: Funds(broker) Function with all parametrs: Funds(broker,api_key,api_secret) Sample : algomojo.Funds(broker="ab")24. ExitBOOrder:Function with mandatory parmeters: ExitBOOrder(broker,order_id) Function with all parametrs: ExitBOOrder(broker,order_id,strategy,api_key,api_secret) Sample : algomojo.ExitBOOrder(broker="ab", order_id="230001063923021", strategy="Python Example"))25. ExitCOOrder:Function with mandatory parmeters: ExitCOOrder(broker,order_id) Function with all parametrs: ExitCOOrder(broker,order_id,strategy,api_key,api_secret) Sample : algomojo.ExitCOOrder(broker="ab", order_id="230001063923021", strategy="Python Example"))26. GetQuote:Function with mandatory parmeters: GetQuote(broker,exchange,symbol) Function with all parametrs: GetQuote(broker,exchange,symbol,api_key,api_secret) Sample : algomojo.GetQuote(broker="ab", exchange="NSE", symbol= "IDEA-EQ")27. Profile:Function with mandatory parmeters: Profile(broker) Function with all parametrs: Profile(broker,api_key,api_secret) Sample : algomojo.Profile(broker="ab")
algonaut
The API toolkit for Algoneer.
algonautsutils
No description available on PyPI.
algondy
No description available on PyPI.
algoneer
A Python toolkit for testing algorithmic systems and machine learning models.
algoneer-datasets
Example datasets for Algoneer.
algonet
No description available on PyPI.
algo-ops
Algo-OpsPipeline Infrastructure for Prototyping and Deploying AlgorithmsYou like algorithms. But prototyping complicated algorithms can be challenging, especially when they have complicated architectures with many components. How do you prototype algorithms so that the data flow is sensible, the results are interpretable, and the algorithm is easily debuggable on incorrect predictions?Algo-Ops has the following features:An algorithm is a recipe for executing a computation, generally consisting of several steps. In Algo-Ops, each step is an Op.Ops are automic units of an algorithm. Various types of Ops are supported such as TextOps (for NLP) and CVOps (for computer vision). The user can easily add their own Ops.Ops are linked together to form an algorithm. They execute sequentially where the first Op's outputs are passed as the second Op's inputs. The feed-forward pipeline is run to execution.pipeline=Pipeline.init_from_funcs(funcs=[self.append_a,self.append_something,self.reverse,self.reverse],op_class=TextOp,)Algo-Ops pipelines automatically dashboard in a Jupyter notebook. Simply do pipeline.vis() to visualize the data flow in a Jupyter notebook, making it easy to visualize data flow and debug an algorithmic edge case on some input.pipeline.vis()Algo-Ops pipelines automatically keep a profile of their own performance over time. Simply do pipeline.vis_profile() to see a profile of your Op executions in terms of runtime and memory usage.pipeline.vis_profile()Algo-Ops pipeline supports easy debugging. A pipeline can be run on a set of supervised inputs with known outputs. In this case, if the algorithm got the wrong prediction, the entire pipeline dataflow is auto-pickled to allow the user to investigate where the algorithm went wrong.An Algo-Ops pipeline is itself an Op, so pipelines themselves can be stacked to create very intricate workflows that are still easy to track and debug. The entire framework is highly extensible.
algop
What is Algop?Algop is a collection of common used algorithms implemented in python as functionsTo Usepip3 install algopParametersDefaultKeyarraynoneAllsayfalseAlltargetNone2CurrentAlgorithmDoneKeyBubble sort✅0Insertion sort✅1Two Number Sum✅2
algopack
Implementation of various common CS algorithms in CythonUsageInstallation$pipinstallalgopackExamplesSorting:fromalgopackimportsortmy_array=[10,0,5,15,-5]sorted_array=sort.bubble(my_array)print(sorted_array)# [-5, 0, 5, 10, 15]TestingClone the repository:$ git clone https://github.com/divykj/algopack.git $ cd algopackInstall requirements:$ pip install -r requirements.txt $ pip install -r requirements_dev.txtRun tests:$ doit testsModulessortbubblebucketcocktail_shakercombcountinggnomeheapinsertionmergepancakequickradixselectionshell
algopedia
No description available on PyPI.
algo-play
Python Play (beta)The easiest way to start coding games and graphics projects in PythonPython Play is an open-source code library for the Python programming language that makes it as easy as possible to start making games. Here's the code to make a simple game using Play:importplaycat=play.new_text('=^.^=',font_size=70)@play.repeat_foreverasyncdefmove_cat():cat.x=play.random_number(-200,200)cat.y=play.random_number(-200,200)cat.color=play.random_color()cat.show()awaitplay.timer(seconds=0.4)cat.hide()awaitplay.timer(seconds=0.4)@cat.when_clickeddefwin_function():cat.show()cat.words='You won!'play.start_program()The code above makes a game where you have to click the cat to win:You can try playing and changing this game on repl.it!Python Play is an excellent choice for beginner programmers to get started with graphics programming. It was designed to have similar commands and simplicity toMIT's Scratchand is distinguished from such projects as Pygame, Arcade, or Pygame Zero because of its lack of boiler plate code, its easy-to-understand plain-english commands, and intuitive API.Read more about its design at the bottom of this document.How to install Python PlayRun the following command in your terminal:pip install replit-playOr you can just go torepl.itand you won't have to install anything :)How to use Python PlayAll Python Play programs start withimport playand end withplay.start_program(), like this:importplay# this is the first line in the programplay.start_program()# this is the last line in the programAll other commands go between those two commands.To try any of the following examples, go torepl.it and try pasting code in.CommandsThe rest of this document is divided into the following sections:Basic Commands- Getting graphics, shapes, and text on the screen. Also changing the backdrop.Animation and Control Commands- Animating and controlling graphics, shapes, and text.Sprite Commands- Controlling sprites.Mouse Commands- Detecting mouse actions (clicks, movement).Keyboard Commands- Detecting keyboard actions.Physics Commands- Making physics objects.Other Useful Commands- General commands.Why use Python Play?- How this library is different from other graphics libraries.Basic CommandsTo get images or text on the screen, use the following commands. (Copy and paste the code below to try it out.)play.new_box()box=play.new_box(color='black',x=0,y=0,width=100,height=200,border_color="light blue",border_width=10)This will put a tall, black box in the middle of the screen.If you want to change where the image is on the screen, try changingx=0(horizontal position) andy=0(vertical position). Just like Scratch, the middle of the screen is x=0, y=0. Increasing x moves the image right and decreasing x moves the image left. Likeswise, increasing y moves the image up and decreasing y moves the image down. You can also change the color by changing'black'to another color name, like'orange'.play.new_image()character=play.new_image(image='character.png',x=0,y=0,angle=0,size=100,transparency=100)This will place an image in the middle of the screen. Make sure you have a file namedcharacter.pngin your project files for the code above to work. You can find images online at sites likehttp://icons.iconarchive.com/icons/icojam/animals/64/01-bull-icon.pngplay.new_text()greeting=play.new_text(words='hi there',x=0,y=0,angle=0,font=None,font_size=50,color='black',transparency=100)This will put some text on the screen.If you want to change the font, you'll need a font file (usually named something likeArial.ttf) in your project files. Then you can changefont=Nonetofont='Arial.ttf'. You can find font files at sites likeDaFont.play.new_circle()ball=play.new_circle(color='black',x=0,y=0,radius=100,border_color="light blue",border_width=10,transparency=100)This will put a black circle in the middle of the screen.play.new_line()line=play.new_line(color='black',x=0,y=0,length=100,angle=0,thickness=1,x1=None,y1=None)This will create a thin line on the screen.play.set_backdrop()You can change the background color with theplay.set_backdrop()command:play.set_backdrop('light blue')There arelots of named colors to choose from. Additionally, if you want to set colors by RGB (Red Green Blue) values, you can do that like this:# Sets the background to white. Each number can go from 0 to 255play.set_backdrop((255,255,255))Anywhere you can set a color in Python Play, you can do it using a named color like'red'or an RGB value above like(255, 255, 255)or even an RGBA value like(0, 0, 0, 127)(the fourth number is transparency from 0 to 255). You can get the current background color withplay.backdrop.Animation and Control [email protected]_foreverTo make things move around, you can start by [email protected]_forever, like this:cat=play.new_text('=^.^=')@play.repeat_foreverdefdo():cat.turn(10)The above code will make the cat turn around forever. Sprites have other commands that you can see in the next section called Sprite [email protected]_program_startsTo make some code run just at the beginning of your project, [email protected]_program_starts, like this:cat=play.new_text('=^.^=')@play.when_program_startsdefdo():cat.turn(180)This will make the cat turn upside down instantly when the program starts.await play.timer(seconds=1)To run code after a waiting period, you can use theawait play.timer()command like this:cat=play.new_text('=^.^=')@play.when_program_startsasyncdefdo():cat.turn(180)awaitplay.timer(seconds=2)cat.turn(180)This will make the cat turn upside down instantly when the program starts, wait 2 seconds, then turn back up again.play.repeat()andawait play.animate()To smoothly animate a character a certain number of times, you can useplay.repeat()withawait play.animate(), like this:cat=play.new_text('=^.^=')@play.when_program_startsasyncdefdo():forcountinplay.repeat(180):cat.turn(1)awaitplay.animate()This code will animate the cat turning upside down smoothly when the program starts.To break down the code:for count in play.repeat(180):runs the code 180 times.cat.turn(1)turns that cat 1 degree each time.await play.animate()makes the cat animate smoothly. Without this command, the cat would just turn upside down instantly.Note: to useawait play.animate()andawait play.timer(), the wordasyncmust be included beforedefin your function definition.Sprite CommandsSimple commandsSprites (images and text) have a few simple commands:sprite.move(10)— moves the sprite 10 pixels in the direction it's facing (starts facing right). Use negative numbers (-10) to go backward.sprite.turn(20)— Turns the sprite 20 degrees counter-clockwise. Use negative numbers (-20) to turn the other way.sprite.go_to(other_sprite)— Makesspritejump to another sprite namedother_sprite's position on the screen. Can also be used to make the sprite follow the mouse:sprite.go_to(play.mouse).sprite.go_to(x=100, y=50)— Makesspritejump to x=100, y=50 (right and up a little).sprite.point_towards(other_sprite)— Turnsspriteso it points at another sprite calledother_sprite.sprite.point_towards(x=100, y=50)— Turnsspriteso it points toward x=100, y=50 (right and up a little).sprite.hide()— Hidessprite. It can't be clicked when it's hidden.sprite.show()— Showsspriteif it's hidden.sprite.clone()— Makes a copy or clone of the sprite and returns it.sprite.remove()— Removes a sprite from the screen permanently. Calling sprite commands on a removed sprite won't do anything.sprite.start_physics()— Turn on physics for a sprite. See thePhysics Commands sectionfor details.sprite.stop_physics()— Turn off physics for a sprite. See thePhysics Commands sectionfor details.PropertiesSprites also have properties that can be changed to change how the sprite looks. Here they are:sprite.x— The sprite's horizontal position on the screen. Positive numbers are right, negative numbers are left. The default is 0.sprite.y— The sprite's vertical position on the screen. Positive numbers are up, negative numbers are down. The default is 0.sprite.size— How big the sprite is. The default is 100, but it can be made bigger or smaller.sprite.angle— How much the sprite is turned. Positive numbers are counter-clockwise. The default is 0 degrees (pointed to the right).sprite.transparency— How see-through the sprite is from 0 to 100. 0 is completely see-through, 100 is not see-through at all. The default is 100.sprite.is_hidden—Trueif the sprite has been hidden with thesprite.hide()command. OtherwiseFalse.sprite.is_shown—Trueif the sprite has not been hidden with thesprite.hide()command. OtherwiseFalse.sprite.left— The x position of the left-most part of the sprite.sprite.right— The x position of the right-most part of the sprite.sprite.top— The y position of the top-most part of the sprite.sprite.bottom— The y position of the bottom-most part of the sprite.sprite.physics— Contains the physics properties of an object if physics has been turned on. The default isNone. See thePhysics Commands sectionfor details.Image-sprite-only properties:sprite.image— The filename of the image shown. IfNoneis provided initially, a blank image will show up.Text-sprite-only properties:text.words— The displayed text content. The default is'hi :)'.text.font— The filename of the font e.g. 'Arial.ttf'. The default isNone, which will use a built-in font.text.font_size— The text's size. The default is50(pt).text.color— The text's color. The default is black.Box-sprite-only properties:box.color— The color filling the box. The default isblack.box.width— The width of the box. The default is100pixels.box.height— The height of the box. The default is200pixels.box.border_width— The width of the box's border, the line around it. The default is0.box.border_color— The color of the box's border. The default is'light blue'.If the box has a border, the box's total width, including the border, will be the width defined by thewidthproperty.Circle-sprite-only properties:circle.color— The color filling the circle. The default isblack.circle.radius— How big the circle is, measured from the middle to the outside. The default is100pixels, making a 200-pixel-wide circle.circle.border_width— The width of the circle's border, the line around it. The default is0.circle.border_color— The color of the circle's border. The default is'light blue'.If the circle has a border, the circle's total width, including the border, will be the width defined by theradiusproperty.Line-sprite-only properties:line.color— The line's color. The default isblack.line.length— How long the line is. Defaults to100(pixels).line.angle— The angle the line points in. Defaults to0(degrees).line.x1— Thexcoordinate of the end of the line.line.y1— Theycoordinate of the end of the line.For lines, thexandycoordinates are where the start of the line is. You can set either thelengthandangleor thex1andy1properties to change where the line points. If you update one, the others will be updated automatically.These properties can changed to do the same things as the sprite commands above. For example,sprite.go_to(other_sprite)# the line above is the same as the two lines belowsprite.x=other_sprite.xsprite.y=other_sprite.yYou can change the properties to animate the sprites. The code below makes the cat turn around.cat=play.new_text('=^.^=')@play.repeat_foreverdefdo():cat.angle+=1# the line above is the same as cat.turn(1)Other infoSprites also have some other useful info:sprite.width— Gets how wide the sprite is in pixels.sprite.height— Gets how tall the sprite is in pixels.sprite.distance_to(other_sprite)— Gets the distance in pixels toother_sprite.sprite.distance_to(x=100, y=100)— Gets the distance to the point x=100, y=100.sprite.is_clicked—Trueif the sprite has just been clicked, otherwiseFalse.sprite.is_touching(other_sprite)— Returns True ifspriteis touching theother_sprite. OtherwiseFalse.sprite.is_touching(point)— Returns True if the sprite is touching the point (anything with anxandycoordinate). For example:sprite.is_touching(play.mouse)Mouse CommandsWorking with the mouse in Python Play is easy. Here's a simple program that points a sprite at the mouse:arrow=play.new_text('-->',font_size=100)@play.repeat_foreverdefdo():arrow.point_towards(play.mouse)play.mousehas the following properties:play.mouse.x— The horizontal x position of the mouse.play.mouse.y— The vertical y position of the mouse.play.mouse.is_clicked—Trueif the mouse is clicked down, orFalseif it's not.play.mouse.is_touching(sprite)— ReturnsTrueif the mouse is touching a sprite, orFalseif it's [email protected]_clickedProbably the easiest way to detect clicks is to [email protected]_clicked.In the program below, when the face is clicked it changes for 1 second then turns back to normal:face=play.new_text('^.^',font_size=100)@face.when_clickedasyncdefdo():face.words='*o*'awaitplay.timer(seconds=1)face.words='^.^'@play.when_sprite_clicked()If you wanted to run the same code when multiple sprites are clicked, you can [email protected]_sprite_clicked():face1=play.new_text('^.^',x=-100,font_size=100)face2=play.new_text('^_^',x=100,font_size=100)@play.when_sprite_clicked(face1,face2)# takes as many sprites as you wantasyncdefdo(sprite):starting_words=sprite.wordssprite.words='*o*'awaitplay.timer(seconds=1)sprite.words=starting_wordsIn the above program, clickingface1orface2will run the code for each sprite separately. Note that the function is defined with a parameter e.g.def do(sprite):instead of justdef do():[email protected][email protected]_mouse_clickedTo run code when the mouse is clicked anywhere, [email protected][email protected]_mouse_clicked(they do the same exact thing).In the code below, when a click is detected, the text will move to the click location and the coordinates will be shown:text=play.new_text('0, 0')@play.mouse.when_clickeddefdo():text.words=f'{play.mouse.x},{play.mouse.y}'text.go_to(play.mouse)@[email protected]_click_releasedTo run code when the mouse button is released, [email protected][email protected]_click_released(they do the same exact thing).In the code below, the cat can be dragged around when it's clicked by the mouse:cat=play.new_text('=^.^= drag me!')[email protected]_clickeddefdo():[email protected]_click_releaseddefdo():[email protected]_foreverdefdo():ifcat.is_being_dragged:cat.go_to(play.mouse)Keyboard Commandsplay.key_is_pressed()You can useplay.key_is_pressed()to detect keypresses.In the code below, pressing thearrowkeys orw/a/s/dwill make the cat go in the desired direction.cat=play.new_text('=^.^=')@play.repeat_foreverdefdo():ifplay.key_is_pressed('up','w'):cat.y+=15ifplay.key_is_pressed('down','s'):cat.y-=15ifplay.key_is_pressed('right','d'):cat.x+=15ifplay.key_is_pressed('left','a'):[email protected]_key_pressed()You can [email protected]_key_pressed()to run code when specific keys are pressed.In the code below, pressing thespacekey will change the cat's face, and pressing theenterkey will change it to a different face.cat=play.new_text('=^.^=')@play.when_key_pressed('space','enter')# if either the space key or enter key are pressed...defdo(key):ifkey=='enter':cat.words='=-.-='ifkey=='space':cat.words='=*_*='@play.when_any_key_pressedIf you just want to detect when any key is pressed, you can [email protected]_any_key_pressed.In the code below, any key you press will be displayed on the screen:text=play.new_text('')@play.when_any_key_presseddefdo(key):text.words=f'{key}pressed!'@play.when_key_released()Exactly [email protected]_key_pressed()but runs the code when specific keys are released.In the code below, text will appear on screen only if theuparrow is pressed.text=play.new_text('')@play.when_key_released('up')asyncdefdo(key):text.words='up arrow released!'awaitplay.timer(seconds=1)text.words=''@play.when_any_key_releasedExactly [email protected]_any_key_pressedbut runs the code when any key is released.In the code below, the name of the most recently released key will show up on screen.text=play.new_text('')@play.when_any_key_presseddefdo(key):text.words=f'{key}key released!''Physics CommandsPython Play uses thePymunkphysics library to turn sprites into physics objects that can collide with each other, fall with gravity, and more.sprite.start_physics()To turn a sprite into a physics object, use thestart_physics()command:sprite.start_physics(can_move=True,stable=False,x_speed=0,y_speed=0,obeys_gravity=True,bounciness=1,mass=10,friction=0.1)This will cause the sprite to start being affected by gravity, collide with other sprites that have physics, and more.sprite.physicspropertiesOncesprite.start_physics()has been called, the sprite will have asprite.physicsproperty.sprite.physicshas the following properties:sprite.physics.can_move— Whether the sprite can move around the screen (True) or is stuck in place (False). Defaults toTrue.sprite.physics.stable— Whether the sprite is a stable object (one that can't be knocked about). A pong paddle is a stable object (True) but a box or ball that can be knocked around is not (False). Defaults toFalse.sprite.physics.x_speed— How fast the sprite is moving horizontally (negative numbers mean the sprite moves to the left and positive numbers mean the sprite moves to the right). Defaults to0.sprite.physics.y_speed— How fast the sprite is moving vertically (negative numbers mean the sprite moves down and positive numbers mean the sprite moves up). Defaults to0.sprite.physics.obeys_gravity— If the sprite is affected by gravity. Defaults toTrue.sprite.physics.bounciness— How bouncy the sprite is from 0 (doesn't bounce at all) to 1 (bounces a lot). Defaults to1.sprite.physics.mass— How heavy the sprite is. Defaults to10. Heavier objects will knock lighter objects around more.sprite.physics.friction— How much the sprite slides around on other objects. Starts at 0 (slides like on ice) to big numbers (very rough sprite that doesn't slide at all). Defaults to0.1.Changing any of these properties will immediately change how the sprite acts as a physics object. Try experimenting with all these properties if you don't fully understand them.sprite.physicsalso has two commands that could be helpful:sprite.physics.pause()— Temporarily stop the sprite from being a physics object. The sprite's speed and other physics properties will be saved until theunpause()command is used.sprite.physics.unpause()— Resume physics on a sprite that has been paused. It will continue with the exact speed and physics settings it had beforephysics.pause()was called.Callingsprite.stop_physics()will immediately stop the sprite from moving and colliding andsprite.physicswill be set toNone.sprite.stop_physics()To get a sprite to stop moving around and colliding, you can callsprite.stop_physics:sprite.stop_physics()This will immediately stop the sprite.play.set_gravity()To set how much gravity there is for sprites that have hadstart_physics()called on them, use theplay.set_gravity()command:play.set_gravity(vertical=-100,horizontal=None)You can access the current gravity withplay.gravity.vertical(default is-100) andplay.gravity.horizontal(default is0).Other Useful Commandsplay.screenThe way to get information about the screen.play.screenhas these properties:play.screen.width- Defaults to 800 (pixels total). Changing this will change the screen's size.play.screen.height- Defaults to 600 (pixels total). Changing this will change the screen's size.play.screen.left- Thexcoordinate for the left edge of the screen.play.screen.right- Thexcoordinate for the right edge of the screen.play.screen.top- Theycoordinate for the top of the screen.play.screen.bottom- Theycoordinate for the bottom of the screen.play.all_spritesA list of all the sprites (images, shapes, text) in the program.play.random_number()A function that makes random numbers.If two whole numbers are given,play.random_number()will give a whole number back:play.random_number(lowest=0,highest=100)# example return value: 42(You can also doplay.random_number(0, 100)withoutlowestandhighest.)If non-whole numbers are given, non-whole numbers are given back:play.random_number(0,1.0)# example return value: 0.84play.random_number()is also inclusive, which meansplay.random_number(0,1)will return0and1.play.random_color()Returns a random RGB color, including white and black.play.random_color()# example return value: (201, 17, 142)Each value varies from 0 to 255.play.random_position()Returns a random position on the screen. A position object has anxandycomponent.text=play.text('WOO')@play.repeat_foreverdefdo():text.go_to(play.random_position())# the above is equivalent to:position=play.random_position()text.x=position.xtext.y=position.yplay.repeat()play.repeat()is the same as Python's built-inrangefunction, except it starts at 1. 'Repeat' is just a friendlier and more descriptive name than 'range'.list(play.repeat(10))# return value: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]await play.animate()When used in a loop, this command will animate any sprite changes that happen.cat=play.new_text('=^.^=')@play.when_program_startsasyncdefdo():forcountinplay.repeat(360):cat.turn(1)awaitplay.animate()await play.animate()is the same asawait asyncio.sleep(0)except it has a friendlier name for beginners.What's with all thisasync/awaitstuff? Is this Python?Yes, this is Python! Python addedasyncandawaitas special keywords in Python 3.7. It's part of theasyncio module.Using async functions means we can use theawait play.timer()andawait play.animate()functions, which makes some code a lot simpler and appear to run in-parallel, which new programmers find intuitive.importplaycat=play.new_text('=^.^=')# this code block uses async so it can use the 'await play.timer()' [email protected]_foreverasyncdefchange_bg():play.set_backdrop('pink')awaitplay.timer(seconds=1)play.set_backdrop('purple')awaitplay.timer(seconds=1)play.set_backdrop('light blue')awaitplay.timer(seconds=1)# this code block doesn't need async because it doesn't have `await play.timer()` or `await play.animate()`@play.repeat_foreverdefdo():cat.turn(1)play.start_program()In the above program, the backdrop will change and the cat will appear to turn at the same time even though the code is running single-threaded.Theasynckeyword isn't necessary to write unless you want to useawaitfunctions. If you try to use anawaitcommand inside a non-async function, Python will show you an error like this:File "example.py", line 31 await play.timer(seconds=1) ^ SyntaxError: 'await' outside async functionTo fix that error, just putasyncbeforedef.If you don't understand any of this, it's generally safe to just includeasyncbeforedef.Why use Python Play?Python Play was designed to be an excellent starting point for brand new programmers. The goal of the project is to give someone that has never programmed before a compelling and successful experience in their first few minutes of programming. We aimed to make graphics programming as accessible as possible to as young an audience as possible.We found that many existing programming languages and graphics libraries presented unnecessary difficulties for new programmers — difficulties making simple things happen, confusing language, confusing program flow, unexplained concepts, etc. We know that even one initial disagreeable experience can turn people away from programming forever, and we wanted to prevent that outcome as much as possible.Python Play was inspired byMIT's Scratch, which has introduced millions of children and adults to programming and helped them to create and share personally meaningful computational projects. In fact, Python Play's main designer worked on Scratch professionally for a brief period. But we found that for some learners, Scratch — with its graphical blocks and colorful interface — didn't feel like "real programming". For those learners wishing to use a mainstream textual programming language while removing the difficulties of graphics programming in these languages, we made Python Play.Python Play was designed with the following principles in mind:No boilerplate - every line of code should do something meaningful and understandable. We want to limit the number of times a learner needs to ask "why do we have to include this line of code?"As much as possible, commands should have immediate visual effects. For example, if a programmer types anew_imagecommand the sprite should show up immediately on the screen. They shouldn't need to understand the invisible distinction between initializing a sprite and drawing the sprite.Lines of code should be easily copy and pasted.Command values should have descriptive labels that make it as clear as possible what the value means. Instead ofplay.new_image('character.png', 50, 100),play.new_image(image='character.png', x=50, y=100).Use plain English as much as possible. For mathematical concepts, try to use language programmers might see in math classes. Try to use short names that are easier for younger people to type and spell. Make errors as clear and constructive as possible. Many of the commands and names were borrowed from Scratch, whose designers have spent decades working with children and observing what language makes sense to them.Python Play was also designed with a custom Repl.it IDE in mind (coming soon), one that significantly lowers the usability problems of programming (installing the language, using a text editor, using the terminal, running programs, showing which commands are available, etc).While the learning curve for Python and Python Play are still far from ideal for new programmers, we still think Python Play provides a great way for new programmers to start programming with graphics.<3
algo-profiler
algo-profilerPackage of profiling tools which allows to run function:unit testsstress testscoverage testsruntime checkcall time checkcall time check by lineruntime analysismemory usage checkmemory usage check by linetime based memory usagememory leaks checkmemory usage analysiscomprehensive performance analysis
algops
No description available on PyPI.
algopy
ALGOPY is a tool for Algorithmic Differentiation (AD) and Taylor polynomial approximations. ALGOPY makes it possible to perform computations on scalar and polynomial matrices. It is designed to be as compatible to numpy as possible. I.e. views, broadcasting and most functions of numpy can be performed on polynomial matrices. Exampels are dot,trace,qr,solve, inv,eigh. The reverse mode of AD is also supported by a simple code evaluation tracer.Documentation with examples is available athttp://packages.python.org/algopy/.
algopyc
No description available on PyPI.
algopytest-framework
AlgoPytest — Framework for Testing Algorand Smart Contracts using PyTestAlgoPytestis a Pytest plugin framework which hides away all of the complexity and repetitiveness that comes with testing Algorand Smart Contracts.A lot of boilerplate code is necessary in order to setup a suitable test environment.AlgoPytesttakes care of all that. It handles deploying the smart contract, creating and funding any necessary user accounts and then using those accounts to interact with the smart contract itself. Additionally, each test is a run in a freshly deployed smart contract, facilitating a clean slate which prevents any stateful interference from any previously run tests.Getting StartedThe most relevant information needed for getting off the ground are:Read-The-Docs documentationInstallationSimplified UsageDemosThis project's Read-The-Docs page is especially useful, since it lists and describes all of the available methods and fixtures provided to you byAlgoPytest.InstallationPrerequisitesPython 3 andpipInstall the Algorandsandbox.Installing AlgoPytestpipinstallalgopytest-frameworkSimplified UsageMake sure the sandbox is up and running. Preferably use a local network for your testing such asdev.# Spin up the `dev` network./sandboxupdevSet any necessary environment variables.# The path to your sandbox so that AlgoPytest may interact with the sandboxexportSANDBOX_DIR=/path/to/installation/of/sandbox/# The address in your `sandbox` which was allocated the initial fundsexportINITIAL_FUNDS_ACCOUNT=4BJAN3J32NDMZJWU3DPIPGCPBQIUTXL3UB2LEG5Z3CFPRJZOOZC2GH5DMQList of environment variables recognized byAlgoPytest:documentation.Create aconftest.pyfile in your Pytesttestsdirectory and define a fixture deploying a smart contract as so:# File: conftest.pyimportpytestfromalgopytestimportcreate_app# Load the smart contracts from this project. The path to find these# imports can be set by the environment variable `$PYTHONPATH`.# e.g. `export PYTHONPATH=.../smart-contract-project/assets`fromapproval_programimportapproval_programfromclear_programimportclear_program# NOTE: It is critical to `yield` the `app_id` so that the clean up is properly performed.# The `owner` is an automatically available AlgoPytest defined [email protected]_contract_id(owner):withcreate_app(owner,approval_program=diploma_program(),clear_program=clear_program(),local_bytes=1,local_ints=1,global_bytes=1,)asapp_id:yieldapp_idNow, any Pytest tests you write automatically have access to the standardAlgoPytestfixtures as well as your definedsmart_contract_id. Additionally, you can import and utilize the various helper functions that ship with the framework.List of available fixtures:documentationProvided helper functions:documentationA simple test to make sure that the creator of the smart contract can update the application is provided below. It uses theAlgoPytestfixtureowner, your definedsmart_contract_idfixture and the helper functionupdate_app.# File: test_behavior.pydeftest_update_from_owner(owner,smart_contract_id):update_app(owner,smart_contract_id)DemosThisAlgoPytestproject includesdemosof Algorand Smart Contract projects that utilize this package to implement their test suite. These demo projects give examples of how a real-world project may useAlgoPytestfor its testing. They provide greater context for how to integrateAlgoPytestinto your project. The tests and theinitializationcode of the demos may be found within their respectivetestsdirectory. Therein, you will see how the fixtures are used to extensively stress test the Smart Contract code and life-cycle.For example, a semi-involved test in one of the demos,algo-diploma, showcasesAlgoPytestutilizing the power of Pytest fixtures:@pytest.fixturedefowner_in(owner,smart_contract_id):"""Create an ``owner`` fixture that has already opted in to ``smart_contract_id``."""opt_in_app(owner,smart_contract_id)# The test runs hereyieldowner# Clean up by closing out of the applicationclose_out_app(owner,smart_contract_id)@pytest.fixturedefuser1_in(user1,smart_contract_id):"""Create a ``user1`` fixture that has already opted in to ``smart_contract_id``."""opt_in_app(user1,smart_contract_id)# The test runs hereyielduser1# Clean up by closing out of the applicationclose_out_app(user1,smart_contract_id)deftest_issue_diploma(owner_in,user1_in,smart_contract_id):diploma_metadata="Damian Barabonkov :: MIT :: BSc Computer Science and Engineering :: 2020"# The application arguments and account to be passed in to# the smart contract as it expectsapp_args=['issue_diploma',diploma_metadata]accounts=[user1_in.address]# Issue the `diploma_metadata` to the recipient `user1`call_app(owner_in,smart_contract_id,app_args=app_args,accounts=accounts)Original source may be foundhere.Detailed UsageRefer to thePytest Documentation Referencesbelow for more specific explanations of key Pytest topics. These topics are essential to understand in order to useAlgoPytesteffectively.AlgoPytest SetupFirstly, you must follow the Pytest directory structure. Essentially, all tests will be found within atestsdirectory in the root of your project.Before being able to write Pytest tests for your Algorand Smart Contract, you will need to initialize some essential fixtures such as the smart contracts, signatures, and assets to be tested. Utility functions are provided byAlgoPytestwhich deploy these objects and return a reference to be used in a fixture. For a smart contract, this is most easily achieved by creating aconftest.pyfile and yielding the result ofalgopytest.create_appfrom within a fixture. It is critical toyieldrather thanreturnto not interfere with theAlgoPytestfixture clean up sequence.For example:# Sample project file structuresmart-contract-project/ ├──assets │├──approval_program.py │├──clear_program.py └──tests├──conftest.py└──test_behavior.py# File: conftest.pyimportpytestfromalgopytestimportcreate_app# Load the smart contracts from this project. The path to find these# imports can be set by the environment variable `$PYTHONPATH`.# e.g. `export PYTHONPATH=.../smart-contract-project/assets`fromapproval_programimportapproval_programfromclear_programimportclear_program# NOTE: It is critical to `yield` the `app_id` so that the clean up is properly performed.# The `owner` is an automatically available AlgoPytest defined [email protected]_contract_id(owner):withcreate_app(owner,approval_program=diploma_program(),clear_program=clear_program(),local_bytes=1,local_ints=1,global_bytes=1,)asapp_id:yieldapp_idTheapproval_programandclear_programmust be Python functions which return apyteal.Expr.For example, the simplest clear program in this format is:# File: clear_program.pydefclear_program():"""A clear program that always approves."""returnReturn(Int(1))Writing Pytest TestsTheAlgoPytestpackage is written as a Pytest plugin. This allowsAlgoPytestto automatically register fixtures without you needing to import anything. You may simply use the fixtures directly in the function signature.These fixtures make testing Algorand Smart Contracts significantly easier for you as the developer. Fixtures such as the user ones:owner,user1,user2, etc. automatically create users with funded balances and cleans them up at the end of the test. Any smart contracts, signatures and assets yielded as fixtures are automatically deployed over the life of the test and then cleaned up. WithoutAlgoPytest, writing a test even as simple as checking whether the owner of an application can update their application requires non-negligible boilerplate code. Now, in order to write this test, all of the necessary boilerplate code is taken care of; you only have to focus only on the testing code at hand and nothing else.# File: test_behavior.pydeftest_update_from_owner(owner,smart_contract_id):"""The `owner` and `smart_contract_id` are AlgoPytest fixtures.This call will raise if there is any error."""update_app(owner,smart_contract_id)Pytest Documentation ReferencesPytest directory structure:documentationPytest fixtures:documentationPytestconftest.py:documentationDev Installationgitclonehttps://github.com/DamianB-BitFlipper/algopytest.gitcdalgopytest condaenvcreate-fenvironment.yml pre-commitinstall pipinstall-e.Please submit a Pull Request for any suggested changes you would like to make.DisclaimerThis package and smart contract(s) in this codebase have NOT been professionally audited. Therefore, they should not be used as a production application.
algopy-ucas
No description available on PyPI.
algoql
algoqlAlgorand streaming Query LanguageUsagepython main.py <query>Get current block roundSELECTb.rndFROMblockASb;Output:{'rnd': 25242464} {'rnd': 25242465}Get decoded transaction notes:SELECTBASE64DECODE(txns.txn.note,"utf-8")ASnoteFROMblock.txnsAStxnsWHEREBASE64DECODE(txns.txn.note,"utf-8")ISNOTNULL;Output:{'note': 'Reach 0.1.11'}
algorand-governance-oracle
Algorand Governance OracleIt is an "oracle" for Algorand Governance.Mainnet Application ID:will go hereTestnet Application ID:109903471Application StateWe'll have how to use application state in other application.Development and UpdateHow to create new applicationfromalgorand_governance_oracle.deploymentimportcreate_oracle_applicationfromalgorand_governance_oracle.clientsimporttestnet_algod_clientprivate_key="put your private key in here."application_id=create_oracle_application(algod_client=testnet_algod_client,private_key=private_key)print(application_id)How to update application state with statisticsfromalgorand_governance_oracle.apiimportupdatefromalgorand_governance_oracle.clientsimporttestnet_algod_clientprivate_key="put your private key in here."application_id="put your application id in here."values={"period_identifier":"governance-period-4".encode(),"eligible_committed_stake":3788144125919121,"ineligible_committed_stake":295846447001842,"eligible_governor_count":32677,"ineligible_governor_count":1923,"algo_amount_in_reward_pool":70500000000000,"updated_at":1662985556,}transaction_id=update(algod_client=testnet_algod_client,private_key=private_key,application_id=application_id,values=values,)print(transaction_id)
algorand-vanity
Algorand VanityPython utility for generating vanity algorand wallet addresses.Installing from sourcepoetryinstallInstalling with pippipinstallalgorand-vanityUsagealgorand_vanityADDRESS1ADDRESS2OptionsOptionDescriptionDefault--threads, -t {start, end}Number of threads to use for address generation# of CPU cores--filename, -f {start, end}Filename to output addresses tovanity_addresses--location, -l {start, end}location in address where the vanity string should be foundif not specified then string can be anywhere in the addressvanitylist of vanity addresses to search for(Must only contain the following characters: A-Z, 2-7)required
algorand-verifier-lib
Algorand Verifier LibraryPython library for verifying on-chain Algorand applications with source code. Available on PyPi athttps://pypi.org/project/algorand-verifier-lib/UsageInstall using pip:pip install algorand_verifier_libUsing helper functions with PureStake APIIn the most general case, the simplest way to use the library is to use functions fromhelpers.pywith the PureStake API.First set the PURESTAKE_API_KEY envvar either on your environment or in a.envfile in the working directory for your app:export PURESTAKE_API_KEY=<YOUR_API_KEY> echo PURESTAKE_API_KEY=<YOUR_API_KEY> >> .envThen in Python code:from algorand_verifier_lib import teal_urls_match_app_id app_id = "552635992" matches = teal_urls_match_app_id(https://github.com/tinymanorg/tinyman-contracts-v1/blob/13acadd1a619d0fcafadd6f6c489a906bf347484/contracts/validator_approval.teal", "https://github.com/tinymanorg/tinyman-contracts-v1/blob/13acadd1a619d0fcafadd6f6c489a906bf347484/contracts/validator_clear_state.teal", app_id) if matches: print(f"The on-chain algorand application ID {app_id} matches the provided source code") else: print(f"The on-chain algorand application ID {app_id} does NOT match the provided source code")Using AlgoApiClient With Custom API EndpointsIf your use-case requires more control, such as using a custom API endpoint for an Algorand node running on your local machine etc.Against an API that requires an API key to be set:from algorand_verifier_lib import AlgoApiClient, OpenSourceParser parser = OpenSourceParser() approval_source = parser.source_from_any("https://github.com/approval_teal") clear_state_source = parser.source_from_any("https://github.com/clear_state_teal") app_id = "552635992" client = AlgoApiClient("https://mainnet.api", "<YOUR_API_KEY>") matches = client.compare_teal_to_app(approval_source, clear_state_source, app_id) if matches: print("Successful match")If you're using an API that doesn't require an API key, initialise the AlgoApiClient with an empty key:client = AlgoApiClient("https://mainnet.api", "")TestingThe tests for the library use the PureStake API and make real API calls so they can take some time, usually though no more than 10 seconds.The tests will run with Github Actions CI on every push, but it sometimes may be required to run the tests locally.Assuming you are in thealgorand_verifier_liblib directory that contains thisREADME.md:export PURESTAKE_API_KEY=<YOUR_API_KEY> python -m venv venv . venv/bin/activate pip install -r requirements.txt python -m pytest src/algorand_verifier_libIf any errors are encountered related to 403 HTTP authentication etc., ensure that thePURESTAKE_API_KEYenvvar is correct.Releasing New Versions on PyPiUpdate the new package version and any other info insetup.pyThen runpython setup.py sdistto produce a source code distributable underdist/Install Twinepip install twineand then the contents of thedist/directory can be uploaded, you must authenticate as the package owner:twine upload dist/*DocumentationCreate a virtualenv and install the normal requirements, and alsopdoc:python -m venv venv . venv/bin/activate pip install -r requirements.txt pip install pdocIn thealgorand_verifier_libdirectory the src code files can be referenced to generate the documentation:pdoc src/algorand_verifier_lib/*Technical DesignThe library is based on 3 parts with different responsibilities:algo_api_client.pycontains the logic for interacting with the Algorand API endpoints and some of the lower-level verification logic e.g.compare_teal_to_app. Should be used directly when extra control is required such as setting the API base URL(e.g.https://mainnet-api.com,https://testnet-api.com) or making custom API calls.open_source_parser.pyis responsible for parsing out source code from given URLs, for example converting a normal Github link to a raw link containing only the source code text that can then be downloaded by the library.helpers.pyprovides endpoint, most-general case usage functions that combine bothalgo_api_client.pyandopen_source_parser.py. It is for when the caller does not require much control such asteal_urls_match_app_id, which will use the PureStake API on the Algorand mainnet to verify a TEAL contract. The Djangowebappin this repo only uses functions fromhelpers.pycurrently as it doesn't require any special API settings etc.This will open your browser atlocalhost:8080with the libraries documentation visible.Why PyTeal and Reach is not Currently SupportedThis verifier library works with TEAL only. Support for PyTeal and Reach contracts would be a definite nice-to-have though, for example theOpenSourceParsercould convert a PyTeal contract to TEAL. Once it's converted to TEAL the normal source code verification logic could be used.List of reasons why this is not supported:There is no clear way to convert PyTeal/Reach contracts to TEAL in a generic form, that would work for ALL contracts source code. As discussed below there are some 'hacks' like finding theapproval_program()function in PyTeal, but naming the function that is just a convention and will not be the same in all contracts.I believe to convert you would need to execute the PyTeal/Reach code, for example the verifier library could add some code to a PyTeal source code file that converts as demonstrated below(example code sourced fromhttps://github.com/ChoiceCoin/Smart_Contracts):if __name__ == "__main__": with open("compiled/"+ "vote_approval.teal", "w") as f: compiled = compileTeal(approval_program(), mode=Mode.Application, version=2) f.write(compiled) with open("compiled/"+"vote_clear_state.teal", "w") as f: compiled = compileTeal(clear_state_program(), mode=Mode.Application, version=2) f.write(compiled)A problem I have with this is that this introduces a RCE(Remote-Code-Execution) vulnerability to the library, a maliciously written Python source code file could be specified and get executed on the library side, which may be running in a webserver.The majority of open source Algorand contracts have acompiled/directory or equivalent with the TEAL even if the contract itself is written in PyTeal/Reach. This means that even without this functionality this library should still be able to verify the large majority of open source Algorand contracts.Possibly a good solution could be found for converting these PyTeal/Reach contracts to TEAL reliably and safely, if this exists I will 100% implement it. I cannot find a solution currently so this functionality will not be included in this library at this time.
algorand-wallet-client
No description available on PyPI.
algora-sdk
Algora LabsAlgora Labsis a strategy development platform for trading. Build, test and launch complex trading strategies in minutes instead of days or weeks. We manage your environment, so you can focus more time on building profitable strategies.FeaturesCreate complex, multi-asset class strategies with instruments of any typeTrack position- and portfolio- level risksManage cash payments and slippageDesign and develop custom instrumentsIntegrate external data and pricers without exposing any proprietary logicSDKThealgora-sdkallows users to programmatically access our APIs and data.NoteOur quantitative finance framework (strategy development and backtesting) is only available through our platformInstallationSet the following environment variables for your username and password forAlgora Labs.ALGORA_USER=<username> ALGORA_PWD=<password>HelpIf you need any help or have feedback, please email us [email protected].
algorc_800
This is a security placeholder package. If you want to claim this name for legitimate purposes, please contact us [email protected]@yandex-team.ru
algorecell-types
No description available on PyPI.
algorename
AlgoRenameTable of ContentsIntroductionPrerequisitesInstallationUsageCommand Line ArgumentsAlgorithm LoadingAlgorithm ListingMultiprocessingLoggingLicenseIntroductionThis utility is a Python script designed to rename files in a folder or an individual file based on a dynamically loaded algorithm. It utilizes multiprocessing for efficiency and can operate recursively on directories. The example algorithm shifts each alphabetic character in the filenames to the left by 1.PrerequisitesPython 3.6+InstallationClone the GitHub repository.git clone https://github.com/darkarp/algorename.gitNavigate to the project directory.cd algorenameInstall the required Python packages.pip install -r requirements.txtUsageCommand Line ArgumentsTo rename a single file:python algorename.py -f [path/to/your/file]To rename all files in a directory:python algorename.py -d [path/to/your/directory]To rename files recursively in a directory:python algorename.py -d [path/to/your/directory] -rFor silent mode (suppress errors):python algorename.py -s (...)To not create a log file:python algorename.py -nl (...)To use a specific algorithm:python algorename.py -a [algorithm_name]To list available algorithms:python algorename.py -lFor help:python algorename.py -hAlgorithm LoadingThe script supports loading custom algorithms. Place your algorithm module under thealgorithms/folder, and the script will be able to import it dynamically. Make sure to define a function calledapply_algorithmwithin the module.The environment variableFCLOG_PATHspecifies the directories where the script will look for custom algorithm modules. You can modify this by changing your environment variables or by creating a.envfile.Example:Windows:FCLOG_PATH=C:\path\to\algorithms;D:\another\path\to\algorithmsLinux/Mac:FCLOG_PATH=/path/to/algorithms:/another/path/to/algorithmsAlgorithm ListingYou can list all available algorithms along with their metadata using the-lflag. This is useful for understanding what each algorithm does before using it.MultiprocessingThis utility uses multithreading to efficiently rename multiple files in a directory. It usesconcurrent.futures.ThreadPoolExecutorto speed up the renaming tasks.LoggingLogging is implemented with a rotating log file mechanism to ensure that it doesn't consume too much disk space over time. The log file will be generated in the same directory as the script, namedalgorename.log.You can set the logging verbosity level via an environment variableFCLOG_LEVEL, which accepts values likeDEBUG,INFO,WARNING,ERROR, andCRITICAL.You can set the log file name via an environment variableFCLOG_NAME. This name will be converted to lower-case.You can disable logging by specifying-nlargument.LicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for details.
algorhythms
No description available on PyPI.
algori
ai algocontriubuting open sourceInstallationYou can install your package using pip:
algorig
_______ ___ _______ _______ ______ ___ _______ | _ || | | || || _ | | | | | | |_| || | | ___|| _ || | || | | | ___| | || | | | __ | | | || |_||_ | | | | __ | || |___ | || || |_| || __ || | | || | | _ || || |_| || || | | || | | |_| | |__| |__||_______||_______||_______||___| |_||___| |_______|Welcome to Algorig - The Ultimate Algorand Smart Contract Development Rig!Algorig is a very compact and intuitive cli tool which tries to ease your Algorand smart contract development and tooling while still preserving all the flexibility. It simply utilizes PyTeal and Algorand Python SDK to make sure that your smart contract development feels quite native and fluent.Setup / InstallationSetting up Algorand SandboxBefore we get started, we'll need an Algorand Node containing the Algod and KMD services up and running preferably in local environment to be able to interact with Algorand blockchain and manage our accounts.The shortest way to run an Algorand node for development purposes is installing Algorand sandbox locally. To accomplish this, simply checkout the Algorand sandbox repository and run it by typing the commands below.$gitclonehttps://github.com/algorand/sandbox.git $cdsandbox $./sanboxupOnce the sandbox up and ready, you will have the both Algod and KMD services running locally underReleaseconfiguration which is a private network suitable for local development.Here, before getting started to our smart contract development, we'll need a Algorand account that will own the smart contract we develop on the Algorand blockchain. Thankfully, the Algorand sandbox default configuration comes with a default wallet namedunencrypted-default-walletalso containing a couple of accounts those already has a significant $algo balance which is quite sufficient enough to start with.$./sandboxgoalwalletlist##################################################Wallet:unencrypted-default-wallet(default)ID:de87213c0d084688bb4e40fe2045e16a##################################################You can also list all the accounts under the default wallet comes with your sandbox installation.$./sandboxgoalaccountlist-wunencrypted-default-wallet[online]DNSNRCJ6WO4LCVNE6O6JHYSZQ7C725RVJMMTT4GCBOUH4VPMPMZYUVBFLUDNSNRCJ6WO4LCVNE6O6JHYSZQ7C725RVJMMTT4GCBOUH4VPMPMZYUVBFLU4000008000000000microAlgos[offline]DRE4XUEJBPVHHFIUWT5SGH3JIGS5RDUBWYXASA72PINNUVFJIY6SFKSLEEDRE4XUEJBPVHHFIUWT5SGH3JIGS5RDUBWYXASA72PINNUVFJIY6SFKSLEE1000002000000000microAlgos[offline]HPAMDTCS3B2BZUGP5JUNDNBKVWXYPKPC56VEYT3WYBEONPVD6HJLUHMTVQHPAMDTCS3B2BZUGP5JUNDNBKVWXYPKPC56VEYT3WYBEONPVD6HJLUHMTVQ4000008000000000microAlgosPlease refer the Algorand sandbox project page itself for more configuration options and any other details.Now feel free to pick one of the accounts listed above as a contract owner so that we can assign it while setting up our Algorig project.Get started with AlgorigSince we're done with our local Algorand node setup, now we're ready to develop an Algorand smart sontract using Algorig. Before we start, let's first configure a virtual environment located under a project directory which will be the home folder of our smart contract project.$mkdirmydefi $cdmydefi $python-mvenvvenv $sourcevenv/bin/activateOnce your virtual environment is up and ready, you may now install the Algorig itself. The best way to install Algorig is simply using pip command as shown below:$pipinstallalgorigAt this point, since you put your tool belt on, you're ready initialize a fresh new Algorig project by typing the command below.$riginit--signing-addressDNSNRCJ6WO4LCVNE6O6JHYSZQ7C725RVJMMTT4GCBOUH4VPMPMZYUVBFLUThis command will create two things. The first one is the main configuration file which you will be able to configure your smart contract development environment.$catprotocol.json{"algod_address":"http://localhost:4001","algod_token":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","kmd_address":"http://localhost:4002","kmd_token":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","wallet_name":"unencrypted-default-wallet","wallet_password":"","signing_address":"DNSNRCJ6WO4LCVNE6O6JHYSZQ7C725RVJMMTT4GCBOUH4VPMPMZYUVBFLU","teal_version":4,"num_global_byte_slices":0,"num_global_ints":0,"num_local_byte_slices":0,"num_local_ints":0,"app_id":0}Here, you might have also noticed how we used the contract owner account address by utilizing the--signing-addressparameter. Likewise, the use of such cli parameters will help us overriding the default configuration values above those mostly supposed to conform the default settings of our Algorand sandbox setup done before.Furthermore,initcommand also proposes a stub python module calledprotocol.pywhich contains the main entry point to your smart contract development. It's simply a class declaration with a special nameApplicationwhich also inherits and implements a base classBaseApplicationcomes with Algorig module itself.# protocol.pyfrompytealimport*fromalgorig.appimportBaseApplicationclassApplication(BaseApplication):defget_approval_program(self):# Implement your contract here using pytealreturnInt(1)defop_example_command(self,my_str:str,my_int:int=42):# This is an example method which can be used as cli commandprint(f'my_str:{my_str}, my_int:{my_int}')You may notice thatApplicationclass simply proposes a method calledget_approval_program()the one you're expected to implement your main smart contract logic under it.Also you might have noticed theop_example_commandmethod starting with a special prefixop. Algorig simply translates these special named class methods into cli commands which can be directly used to manage your smart contract operations those are supposed to interact with your smart contracts.To see all the available commands, simple typerigorrig --help$rig--help sage:rig[-h][-v]{init,create,update,example_command}... positionalarguments:{init,create,update,example_command}optionalarguments:-h,--helpshowthishelpmessageandexit-v,--versionshowprogram'sversionnumberandexitYou'll notice theexample_commandready to be typed at your finger tips. Just type the command to see the expected output.$rigexample_commandmyparam123 Hellomyparam123While this command does nothing rather than simply printing into console, such commands are generally supposed to perform some operations with your deployed smart contract by presumably utilizingApplicationCallor any other available transactions calls which we'll see later on.Write and deploy your first contractAs mentioned previously,get_approval_program()method is the main entry point to your Algorand smart contract. You're here simply expected to return a PyTeal node object and Algorig will handle the rest for you.Ok, let's write a very simple contract which only accepts application create and update transactions respectively.# protocol.pydefget_approval_program(self):# Implement your contract here using pytealreturnCond([Txn.application_id()==Int(0),Int(1)],[Txn.on_completion()==OnComplete.UpdateApplication,Int(1)],)Congrats, you just implemented your first Algorand smart contract. At this point, since you'll need to deploy your contract to Algorand blockchain, Algorig here will help us to deploy it with a built-in commandcreateby performing some magic behind in order to save us writing so many boilerplate code to achive the same.First of all, let's find out how the command works before acutally running it.$rigcreate--help usage:rigcreate[-h][--app_argsAPP_ARGS]optionalarguments:-h,--helpshowthishelpmessageandexit--app_argsAPP_ARGIt seems to be legit using the command directly without any given parameteres in our case.Let's run the command.$rigcreate Processingtransaction:A35EASTS6ANOO5HTAFIWZAAPSWJJ653ZFM74APMHE46ZIKXDNQDQ ........ Confirmedatround:2342525Applicationcreatedwithid:1Success! This built-in command essentially compiled your teal code, created an application create transaction automatically and sent it to Algorand blockchain throughout the Algod service by referring thealgod_addressandalgod_tokensettings located under our config file. In our case, those settings have already the default values referring the sandbox Algod service we just started locally.#protocol.json{"algod_address":"http://localhost:4001","algod_token":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",}Another side effect of this commmand is that whenever our application initially created on the blockchain, this command will save and keep theidof our application under our config file using the configuration key ofapp_id. At this point, if you dump the contents of our config file, you'll notice theapp_idsetting which was absent previously.{"app_id":1}This setting will basically help Algorig to locate your application whenever you want to interact with it. For example, there is also another built-in command calledupdatewhich uses this setting while locating your application created previously.So now, it's a good time to also see how to deploy any changes in the contract.Ok, let's change a bit of our contract. This time let our contract to accept anApplicationCalltransaction to perform some tasks on the contract. In our case, it will simply expect a sigle arg"Hello World"to approve the transaction.# protocol.pydefget_approval_program(self):# Implement your contract here using pytealdefon_call():returnTxn.application_args[0]==Bytes('Hello World')returnCond([Txn.application_id()==Int(0),Int(1)],[Txn.on_completion()==OnComplete.UpdateApplication,Int(1)],[Txn.on_completion()==OnComplete.NoOp,on_call()],)Now you should be able to send your updates and override your existing contract using the command below:$rigupdate Processingtransaction:H3ZBGVX4SVPAPHPZT23Q3LHIMTOQBEY2H6SDHGARCABLWRB7JNLA ...... Confirmedatround:5493Applicationupdatedsuccessfully.Congratulations, you just developed, deployed and also updated your first smart contract to Alogrand blockchain.Interact with our Smart ContractSo far, we've already seen how Algorig smoothens our Algorand smart contract development with some smart tooling methods. We already created our first smart contract and updated it by using the built-in commands. This time, let's now assume that we need to interact with our contract with a purpose. By our last update, our contract now expects us to send an application call transaction with a single parameter with the value of"Hello World.So let's try to implement such a command together to see how to develop and perform the contract operations.# protocol.pyfromalgorig.appimportBaseApplicationfromalgosdk.futureimporttransactionclassApplication(BaseApplication):...defop_send_greeting(self,greeting):self.submit(transaction.ApplicationCallTxn(sp=self.algod.suggested_params(),on_complete=transaction.OnComplete.NoOpOC,index=self.config.getint('app_id'),sender=self.config['signing_address'],app_args=[greeting)],))That's simple as it. We just implemented asend_greetingcommand to interact with our contract. Let's first locate it.$rig--help usage:rig[-h][-v]{init,create,update,send_greeting}... positionalarguments:{init,create,update,send_greeting}optionalarguments:-h,--helpshowthishelpmessageandexit-v,--versionshowprogram'sversionnumberandexitAlso you may check the further details about our new command by seeing the helper instructions of the command itself.$rigsend_greeting--help usage:rigsend_greeting[-h]greeting positionalarguments:greeting optionalarguments:-h,--helpshowthishelpmessageandexitSince thesend_greetingcommand ready at your fingertips, just run it to see if it works as expected.$rigsend_greeting"Hello World"Processingtransaction:LBF5NQOM2WWIZ4ZUPAVTPKXTK7MD5TODPW2JO65UGNSASQ4IZT2Q ........ Confirmedatround:6054Perfect! You just interacted with your contract deployed on the blockchain. Now let's see what happens when we send a different parameter to our contract.$rigsend_greeting"Boooo"algosdk.error.AlgodHTTPError:TransactionPool.Remember:transaction4GFYWBASWI7T5GERJKO5R4GUUXUDH4LQGCO55BVUKJNXNCQQAKJA:transactionrejectedbyApprovalProgramVery cool, our last transaction simply rejected because you did not supply the desired parameter.Dealing with group transaction to implement atomic operationsMost transactions need to be grouped in some way and ensured all they are executed successfully which we call atomic operations. In Algorig grouping more than one transactions is done byBaseApplication.submit_transactions()method. Let's see how it works:We'll take the popular Algorand Auction Demo'ssetupAuctionAppoperation with some brevity:# protocol.pyfromalgorig.appimportBaseApplicationfromalgosdk.futureimporttransactionclassApplication(BaseApplication):...defop_auction_setup(self,nft_holder_address,nft_id:int,nft_amount:int=1):sp=self.algod.suggested_params()fund_app_txn=transaction.PaymentTxn(sp=sp,sender=nft_holder_address,receiver=self.config['app_address'],amt=1_000)setup_app_txn=transaction.ApplicationCallTxn(sp=sp,on_complete=transaction.OnComplete.NoOpOC,sender=self.config['signing_address'],index=self.config['app_id'],app_args=['setup'],)transfer_nft_txn=transaction.AssetTransferTxn(sp=sp,sender=nft_holder_address,receiver=self.config['app_address'],index=nft_id,amt=nft_amount,)self.submit_group([fund_app_txn,setup_app_txn,transfer_nft_txn])Custom configuration settingsYou may end up adding your own settings toprotocol.jsonconfiguration file and refer them accordingly while implementing your contract.For example, you may want to keep an address belonging to an actor of an operation. In such case, simply add it toprotocol.jsonfile and refer it by using the instance fieldconfigcomes with theBaseApplicationclass instance.Let;s add one as an example.{"funder_address":"DNSNRCJ6WO4LCVNE6O6JHYSZQ7C725RVJMMTT4GCBOUH4VPMPMZYUVBFLU"}Now use it in yourApplicationclass where needed.# protocol.pyfromalgorig.appimportBaseApplicationfromalgosdk.futureimporttransactionclassApplication(BaseApplication):...defop_fund(self,amt:int):sp=self.algod.suggested_params()fund_app_txn=transaction.PaymentTxn(sp=sp,sender=self.config['funder_address'],receiver=self.config['app_address'],amt=amt)self.submit(fund_app_txn)Add settings as many as you want to keep them in the config file.Overriding the default behaviours ofBaseApplicationYou're always free to change the underlying functionality comes withBaseApplication. For instance, if you would like to modify the default behaviour of the clear state program, simply override the corresponding method as shown below.classApplication(BaseApplication):...defget_clear_state_program(self):# default behaviour was simply returning Int(1)returnTxn.sender()==\'HPAMDTCS3B2BZUGP5JUNDNBKVWXYPKPC56VEYT3WYBEONPVD6HJLUHMTVQ'...Please checkoutapp.pyto reviewBaseApplicationclass for the base implementationsContributeAny contributions are always very welcome, just before sending any pull requests, please make sure:You have setup your development environment correctlyYou have added/modifed the corresponding unit tests regarding your contributionYou have checked your code againsflake8style rulesPlease don't hesitate to contirubute if you like and use Algorig.Development EnvironmentTo start contributing, simply checkout the repository, create a virtual env and install the project locally.$gitcheckouthttps://github.com/kadirpekel/algorig $cdalgorig $python-mvenvvenv $sourcevenv/bin/activate $pipinstall-e".[dev]"Now you're ready to rock!Unit TestsAlgorig utilizespytestas test runner, just type below the command to run all the unit tests$pytestCoding StyleAlgorig code base follows the defaultflake8style guiding rules. So before sending any pull requests, please also make sure that your code passes theflake8checks.$flake8algorigDisclaimerThis project is in very early stages so please use it at your own risk.LicenseCopyright (c) 2021 Kadir Pekel.Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
algorith
ÿþ#x00 x00ax00lx00gx00ox00rx00ix00tx00hx00mx00sx00 x00 x00
algorithm
http://algorithm-py.rtfd.org/
algorithm4t
algorithm modules for Teenagers
algorithm-analyse
# 验证算法公平性与完整性 # 开始# 传入pandas dateframe作为数据集 dataset = Analyse(pandas_dataframe)# 验证完整性 result = Analyse.completeness(col_name) # col_name 数据列名,返回有多少空值# 验证公平性 dataset.new_test # 将pandas_dataframe中的敏感属性所在列随机打乱,重新赋值,然后再进行实验# 查看数据分布 dataset.dis_analyse(‘x’, ‘y’) # 输出y相对于x的分布图像# 比较两次实验结果差异 dataset.compare(x, y) # 输入两次结果x, y(二者均为torch向量),比较KL散度,越大说明相差越大
algorithm-hagyun
No description available on PyPI.
algorithmia
Algorithmia Python Client is a client library for accessing Algorithmia from python code. This library also gets bundled with any Python algorithms in Algorithmia.
algorithmia-adk
Algorithm Development Kit code used for creating Python algorithms on Algorithmia. Used by the Algorithmia client
algorithmia-api-client
APIs for managing actions on the Algorithmia platform # noqa: E501
algorithmic
Failed to fetch description. HTTP Status Code: 404
algorithmic-trader
algo-traderTrading strategies builder, backtester, and real-time trader.pip install algorithmic-traderIntroalgo-trader is an implementation of an algorithmic trading strategy executor and backtester. Capable of backtesting strategies locally and trading them in real-time via your broker API.Please be aware that this is awork in progressand the trader is missing external market data and trade providers. If you'd like to use the trader for real-world trading, you'll have to implement your broker API. Although real-time trading is not finished, backtesting is fully functional, so implemented strategies can be backtested and used in real trading when it will be ready.algo-trader is written in Python, and its current stack composes of:MongoDB as a backend data store for backtesting strategiestulipy- Python bindings forTulip Indicators. Used to provide technical indicators calculations.ib_client (Optional) - Python library to communicate with Interactive Brokers gateway. Only needed if you plan on doing real trading via IB.ArchitecturePipelinePipelineis the basic facilitator of the stream. It’s the orchestrator responsible for reading data from theSourceand moving it to the processors in the stream. It has no actual logic except for facilitating the processors. A pipeline and all of its child components are JSON serializable, that is for the system to be able to define, load and save entire pipelines with their configurations on file. This feature is an important one as it can be used as a facade for UI/CLI based runners. Example serialized (and runnable) pipelines can be found in theexamples/pipeline-templatesdirectory. Example of loading them intoPipelineand running them using thePipelineRunnercan be found inmain.pyPipelineRunnerAPipelineRunnerwill accept an initial list or singularPipeline, and an optional startingSharedContext. If aSharedContextis not provided during construction, a new one will be initialized. EachPipelinewill be called throughrun()in the order that it was listed with the previous context. The context will move through eachPipelineallowing for some operations such as loading, caching and validation to occur before data collection and sink.SourcesASourceis an implementation of a Candle Iterator. This is the starting point of the pipeline and the "source" for the incoming candles processed.ProcessorsProcessoris the primary processing unit in the pipeline. Processors can be constructed in any order while Candles are flowing from the source, forward through all processors. Each processor is responsible for sending the candles it processes to the next processor (unless it has a reason not to) .Theprocess()function gets with each candle also an object calledSharedContext. The context is an instance of an in-memory KV store to share context and information between processors.Another way to share data between processors is to make use of theattachmentsfield on the Candle itself. This field is intended for metadata on the candle, like calculations and state relevant to that candle point in time. Candle attachments are persistent throughout the pipeline.ReprocessingReprocessing is a feature that enables a processor to re-send an already processed candle to the next processor. Reprocessing is useful for processors that do some logic outside the main flow of the pipeline. for example, upon events, external triggers, market/trade provider's events/issues, etc... An example of reprocessing can be found in theAssetCorrelationProcessorEventsAnEventas its name suggests, defines an event that occurred in the system. It follows the same flow as the Candles, passing between processors. Each processor is responsible for propagating the event to the next processor (if needed).Because pipelines are data-driven and not time-driven, events can be used as checkpoints to indicate something that happened in the data stream. For example, running the same pipeline from a DB source and a real-time market data source can have different effects if the processor were to rely on time.It is crucial to have the same behavior when fast-running from DB and real-time for backtesting to be useful.StrategiesStrategies are executed per candle by theStrategyProcessor. A strategy is responsible for executing the trading logic and dispatching Signals (StrategySignal). In the event a strategy is raising a trading signal, the StrategyProcessor will catch and pass it to theSignalsExecutorfor execution.TerminatorsATerminatoris an optional final piece of the pipeline. It's executed at the very end of a pipeline when the Source iterator has been fully consumed. Terminators are useful for unit testing, backtesting, and environment cleanups.Running locallyalgo-trader is using MongoDB for data storage. To run Mongo locally usedocker-compose.docker-compose-fdocker-compose.ymlup-dCLIThe CLI is a simple interface to run the system. It can be used to run a pipeline, backtest a strategy, or run a strategy in real-time. Currently, the CLI is not fully implemented and most of the functionality is todescribeandlistthe available processors and strategies. Running the CLI without any arguments will show the help menu.When the package installed via PIP, the commandalgo-traderwill be available. If you choose to clone this repo, usepython main.pyas your entry point.algo-traderTo list all available processors:algo-traderprocessorlistTo describe a specific processor:algo-traderprocessordescribe<processor_name>Same pattern applies to strategies and sources. In order to run a pipeline, you'll need to create a pipeline template file. and run it using the CLI.algo-traderpipelinerun<pipeline_template_file>Easy to run examples:Data loader from Yahoo finance can be found insrc/algotrader/examples/pipeline-templates/build_daily_yahoo_loader.py. Running this example pipeline will load historical data from Yahoo finance to MongoDB:algo-traderpipelinerunexamples/pipeline-templates/build_daily_yahoo_loader.jsonData loader from Binance can be found insrc/algotrader/examples/pipeline-templates/build_daily_binance_loader.json. Running this example pipeline will load historical data from Binance to MongoDB:algo-traderpipelinerunexamples/pipeline-templates/build_daily_binance_loader.jsonRealtime Crypto pipeline from Binance can be found insrc/algotrader/examples/pipeline-templates/build_realtime_binance.json. Running this example pipeline will process realtime, second candles from Binance:algo-traderpipelinerunexamples/pipeline-templates/build_realtime_binance.jsonCode exampleShort code example with comments. This is how one would typically usealgo-traderas a library to load and calculate technical indicators on stocks data from Yahoo finance to MongoDBfromdatetimeimportdatetime,timedeltafromalgotrader.calc.calculationsimportTechnicalCalculationfromalgotrader.entities.timespanimportTimeSpanfromalgotrader.pipeline.configs.indicator_configimportIndicatorConfigfromalgotrader.pipeline.configs.technical_processor_configimportTechnicalsProcessorConfigfromalgotrader.pipeline.pipelineimportPipelinefromalgotrader.pipeline.processors.candle_cacheimportCandleCachefromalgotrader.pipeline.processors.storage_provider_sinkimportStorageSinkProcessorfromalgotrader.pipeline.processors.technicalsimportTechnicalsProcessorfromalgotrader.pipeline.runnerimportPipelineRunnerfromalgotrader.pipeline.sources.yahoo_finance_historyimportYahooFinanceHistorySourcefromalgotrader.storage.mongodb_storageimportMongoDBStoragedefmain():# create a MongoDB Storage connectormongodb_storage=MongoDBStorage()# Create a Yahoo finance Source connectorsource=YahooFinanceHistorySource(['AAPL','MSFT','GOOG'],# Pass in the list of symbols to fetchTimeSpan.Day,# Choose the candles intervaldatetime.now()-timedelta(days=100),# Date to start fetching fromdatetime.now()# The last date to fetch to)# Create a MongoDB Sink processor that will save all processed candles to mongo# using the storage connector.sink=StorageSinkProcessor(mongodb_storage)# Cache processor acts like an in-memory cache and enable processors to share data between on anothercache_processor=CandleCache(sink)# Create a technical indicators process that will add each candle with indicators data.# We then pass the candles to the cache processor, so we can later use this data and share it# with other processors if needed.technicals_config=TechnicalsProcessorConfig([IndicatorConfig('sma5',TechnicalCalculation.SMA,[5]),IndicatorConfig('sma20',TechnicalCalculation.SMA,[20]),IndicatorConfig('cci7',TechnicalCalculation.CCI,[7]),IndicatorConfig('cci14',TechnicalCalculation.CCI,[14]),IndicatorConfig('rsi7',TechnicalCalculation.CCI,[7]),IndicatorConfig('rsi14',TechnicalCalculation.CCI,[14]),IndicatorConfig('stddev5',TechnicalCalculation.STDDEV,[5]),])processor=TechnicalsProcessor(technicals_config,cache_processor)# Construct the pipline object. This object can be serialized as JSON, saved, and reloaded whenever we need it.pipeline=Pipeline(source,processor)# Provide the Pipline object to the runner which will execute it.# The Runner can execute multiple pipelines one after the other.# This enabled the ability to construct a pipelines flow where each pipeline depends on another.PipelineRunner(pipeline).run()Using this repo locallyVirtual environmentIt is best to use a virtual environment to run algo-trader.python3-mvenvrunsourcerun/bin/activate pip3install-rrequirements.txtRunning testsUnit:./scripts/test-unit.shIntegration (needs IB gateway running):./scripts/test-integration.shAll:./scripts/test-all.shContributingContributions are welcome and much needed. Please refer to theguidelines.
algorithm-logger
Python library for logging and debugging algorithms
algorithm-prep
#Algorithm Training for PythonThis project is for programmers and students to practice the programming of algorithms. The test cases and example implementation are included and ready to use.Installation$ pip install algorithm-trainingUsageTest your own algorithmLet's take sorting algorithm as an example. You can create your own algorithm in a function, then add a main block to test your function.from algorithm_training import test from algorithm_training.classic.sort import test_cases def my_sort_function(arr): # my implementation return arr if __name__ == '__main__': test(my_sort_function, test_cases)Benchmark your algorithm against reference implementationsfrom algorithm_training import benchmark from algorithm_training.classic.sort import algorithms, test_cases def my_sort_function(arr): # my implementation return arr if __name__ == '__main__': benchmark(my_sort_function, algorithms, test_cases)Implemented AlgorithmsSortFollowing import statement should be included in your code.from algorithm_prep import test, benchmark from algorithm_prep.classic.sort import test_cases, algorithmsDefine your sorting functiondef your_sort_algorithm(arr): """ :type arr: List[int] :rtype: List[int] """ # your codes go hereTo test the functiontest(your_sort_algorithm, test_cases)To benchmark your algorithmbenchmark(your_sort_algorithm, algorithms, test_cases)Following reference algorithms are implemented for benchmarkBubble SortInsertion SortMerge SortQuick SortHeap SortRadix SortString Search
algorithm-question-fetcher
No description available on PyPI.
algorithms
Pythonic Data Structures and AlgorithmsMinimal and clean example implementations of data structures and algorithms in Python 3.ContributingThanks for your interest in contributing! There are many ways to contribute to this project.Get started hereTestsUse unittestFor running all tests write down:$ python3 -m unittest discover testsFor running some specific tests you can do this as following (Ex: sort):$ python3 -m unittest tests.test_sortUse pytestFor running all tests write down:$ python3 -m pytest testsInstallIf you want to use the API algorithms in your code, it is as simple as:$ pip3 install algorithmsYou can test by creating a python file: (Ex: usemerge_sortinsort)fromalgorithms.sortimportmerge_sortif__name__=="__main__":my_list=[1,8,3,5,6]my_list=merge_sort(my_list)print(my_list)UninstallIf you want to uninstall algorithms, it is as simple as:$ pip3 uninstall -y algorithmsList of Implementationsarraysdelete_nthflattengaragejosephus_problemlimitlongest_non_repeatmax_ones_indexmerge_intervalsmissing_rangesplus_onerotatesummarize_rangesthree_sumtrimmeantop_1two_summove_zerosn_sumautomataDFAbacktrackgeneral_solution.mdadd_operatorsanagramarray_sum_combinationscombination_sumfactor_combinationsgenerate_abbreviationsgenerate_parenthesisletter_combinationpalindrome_partitioningpattern_matchpermutepermute_uniquesubsetssubsets_uniquebfsmaze_searchshortest_distance_from_all_buildingsword_ladderbitadd_bitwise_operatorbit_operationbytes_int_conversioncount_flips_to_convertcount_onesfind_differencefind_missing_numberflip_bit_longest_sequencepower_of_tworeverse_bitssingle_numbersingle_number2single_number3subsetsswap_pairhas_alternative_bitinsert_bitremove_bitbinary_gapcompressionhuffman_codingrle_compressioneliasdfsall_factorscount_islandspacific_atlanticsudoku_solverwalls_and_gatesdistributionhistogramdpbuy_sell_stockclimbing_stairscoin_changecombination_sumegg_drophouse_robberint_dividejob_schedulingknapsacklongest_increasingmatrix_chain_ordermax_product_subarraymax_subarraymin_cost_pathnum_decodingsregex_matchingrod_cutword_breakfibonaccihosoya trianglegraphcheck_bipartitestrongly_connectedclone_graphcycle_detectionfind_all_cliquesfind_pathgraphdijkstramarkov_chainminimum_spanning_treesatisfiabilityminimum_spanning_tree_primstarjantraversalmaximum_flowmaximum_flow_bfsmaximum_flow_dfsall_pairs_shortest_pathbellman_fordCount Connected Componentsheapmerge_sorted_k_listsskylinesliding_window_maxbinary_heapk_closest_pointslinkedlistadd_two_numberscopy_random_pointerdelete_nodefirst_cyclic_nodeis_cyclicis_palindromekth_to_lastlinkedlistremove_duplicatesreverserotate_listswap_in_pairsis_sortedremove_rangemaphashtableseparate_chaining_hashtablelongest_common_subsequencerandomized_setvalid_sudokuword_patternis_isomorphicis_anagrammathspowerbase_conversioncombinationcosine_similaritydecimal_to_binary_ipeuler_totientextended_gcdfactorialgcd/lcmgenerate_strobogrammticis_strobogrammaticmodular_exponentialnext_biggernext_perfect_squarenth_digitprime_checkprimes_sieve_of_eratosthenespythagorasrabin_millerrsasqrt_precision_factorsumming_digitshailstonerecursive_binomial_coefficientfind_orderfind_primitive_rootdiffie_hellman_key_exchangematrixsudoku_validatorbomb_enemycopy_transformcount_pathsmatrix_exponentiationmatrix_inversionmatrix_multiplicationrotate_imagesearch_in_sorted_matrixsparse_dot_vectorsparse_mulspiral_traversalcrout_matrix_decompositioncholesky_matrix_decompositionsum_sub_squaresqueuesmax_sliding_windowmoving_averagequeuereconstruct_queuezigzagiteratorsearchbinary_searchfirst_occurrencelast_occurrencelinear_searchsearch_inserttwo_sumsearch_rangefind_min_rotatesearch_rotatejump_searchnext_greatest_letterinterpolation_searchsetrandomized_setset_coveringfind_keyboard_rowsortbitonic_sortbogo_sortbubble_sortbucket_sortcocktail_shaker_sortcomb_sortcounting_sortcycle_sortgnome_sortheap_sortinsertion_sortmeeting_roomsmerge_sortpancake_sortpigeonhole_sortquick_sortradix_sortselection_sortshell_sortsort_colorsstooge_sorttop_sortwiggle_sortstacklongest_abs_pathsimplify_pathstackvalid_parenthesisstutterswitch_pairsis_consecutiveremove_minis_sortedstringsfizzbuzzdelete_reoccurringstrip_url_paramsvalidate_coordinatesdomain_extractormerge_string_checkeradd_binarybreaking_baddecode_stringencode_decodegroup_anagramsint_to_romanis_palindromelicense_numbermake_sentencemultiply_stringsone_edit_distancerabin_karpreverse_stringreverse_vowelreverse_wordsroman_to_intword_squaresunique_morsejudge_circlestrong_passwordcaesar_ciphercheck_pangramcontain_stringcount_binary_substringrepeat_stringmin_distancelongest_common_prefixrotatefirst_unique_charrepeat_substringatbash_cipherlongest_palindromic_substringknuth_morris_pratttreebstarray_to_bstbst_closest_valueBSTIteratordelete_nodeis_bstkth_smallestlowest_common_ancestorpredecessorserialize_deserializesuccessorunique_bstdepth_sumcount_left_nodenum_emptyheightred_black_treered_black_treesegment_treesegment_treeiterative_segment_treetraversalinorderlevel_orderpostorderpreorderzigzagtrieadd_and_searchtrieb_treebinary_tree_pathsbin_tree_to_listdeepest_leftinvert_treeis_balancedis_subtreeis_symmetriclongest_consecutivelowest_common_ancestormax_heightmax_path_summin_heightpath_sumpath_sum2pretty_printsame_treetreeunixpathjoin_with_slashfull_pathsplitsimplify_pathunionfindcount_islandsContributorsThanks toall the contributorswho helped in building the repo.
algorithms3
Data Structures and AlgorithmsThis repository contains my implementations of data structures and algorithms using Python 3. Most of the algorithm questions are taken from LeetCode. This is a work in progress.InstallYou can use this as an API in your code as follows:$ pip3 install algorithms3An example of running an algorithm:#Check if a string containing brackets is valid or notfromalgorithms.stackimportvalidate_paranthesesif__name__=='__main__':test=validate_parantheses('()[]')print(test)If an algorithm is listed in this repository but is not in the pip package, it means that I have not uploaded the latest version. I will be doing that once a week.UninstallIf you want to uninstall, simply run:$pip3 uninstall algorithms3TestsI have written basic tests for most of the modules. To run all the tests at once run the following from the base directory of the project:$python3 -m unittest discover testsProgressData Structures: 13Algorithms: 482List of ImplementationsArraysDynamic Array ImplementationAdd To Array FormArray PartitionAssign CookiesBest Time To Buy Stock IiBest Time To Buy StockContains Duplicate OneContains Duplicate RangeDegree ArrayDistribute CandiesFind All Dissapeared NumbersFind All DuplicatesFind Pivot IndexFirst Missing PositiveFriends Of AgesIncreasing TripletsIntersection Two Arrays IiIs MonotonicK Diff PairsLargest Number Twice Of OthersLongest Continuous Increasing SubsequenceMax Average SubarrayMax Consecutive OnesMax Product Three NumbersMaximize Distance To Nearest PersonMaximum SubarrayMerge IntervalsMerge Sorted ArrayMinimum Moves To Equal ArrayMove ZeroesNext Greater ElementNon Decreasing ArrayNumber Plus OnePartition Array In ThreePlace FlowersPositions Large GroupsProduct Of Array Except SelfRemove Duplicates TwoRotate ArraySet MismatchShortest Unsorted SubarraySmallest Range ISum After QueriesSummary RangesThird Max NumberTwo Sum Sorted ArrayBacktrackingBinary WatchCombinations Sum ThreeCombinations Sum TwoCombinations SumCombinationsGenerate ParanthesisLetter Case PermutationsLetter CombinationsMatchsticks To SquareN Queens IiN QueensPermutation SequencePermutations OnePermutations TwoSubsets DuplicatesSubsetsValid TimeBashTenth LineValid Phone NumberBinarysearch4Sum IiArranging CoinsBinary SearchFind K ClosestFind PeakFind Right IntervalFirst BadGuess NumberH IndexHeatersMin In Rotated Sorted ArrayMinimum Size SubarrayNext Greater LetterPeak Index Mountain ArraySearch 2D Matrix IiSearch 2D MatrixSearch Insert PositionSearch RangeSearch Rotated Array IiSearch Rotated ArraySqrt NumberValid Perfect SquareBitsBinary GapComplement Base 10 IntegerCount 1 BitsCount Set Bits PrimeIs One Bit CharacterNumber With Alternating BitsPrefix Divisible 5Reverse BitsSingle NumberSum Two NumbersBinary Search TreeBst ImplementationBst IteratorBst To Greater Sum TreeDelete NodeFind Mode BstIncreasing Order Search TreeKth Smallest ElementList To BstLowest Common Ancestor BstMin Distance BstMinimum Diff BstRange Sum BstRecover BstSearch BstTwo Sum BstValidate BstDynamic ProgrammingBest Sight Seeing PairCapacity To Ship PackagesClimbing StairsContinuous Subarray SumDelete Operations For Two StringsEdit DistanceFibonacciHouse RobberInteger ReplacementJump GameKth GrammarLongest Common SubsequenceLongest Increasing SubsequenceMax Crossed LinesMax Product SubarrayMaximum Sum Two Non Overlapping SubarrayMin Cost Climbing StairsMinimum Path SumNth Ugly NumberPartition Equal SubsetPascal RowPascalPowRange Sum Query 2DRange Sum Query MutableRange Sum QuerySuper Ugly NumberTriangle Min PathUnique Paths With ObstacleUnique PathsZero One MatrixGraphsGraph ImplementationBt Right ViewClone GraphColor The BorderConcatenated WordsCourse OrderEmployee ImportanceFlood FillFlower Planting With No AdjacentFriend CircleHouse Robber ThreeIs BipartateJump Game IiKeys And RoomsLongest Increasing Path MatrixMake Larger IslandMax Area IslandMinesweeperMinimum Height TreesNetwork Delay TimeNumber IslandsNumber Of EnclavesPacific Atlantic Water FlowPerfect SquaresRedundant ConnectionRotton OrangesShortest BridgeSurround RegionTown JudgeWord Ladder TwoWord LadderWord SearchGreedyBurst BalloonsDi String MatchDota2 SenateFair Candy SwapIs SubsequenceMake Paran ValidMax Chunks To Make Sorted IiMax Chunks To Make SortedMaximize Sum ArrayMoving StonesNon Overlapping IntervalsQueue Reconstruction By HeightRelative RanksRemove Outermost ParanthesesReorganize StringTwo City SchedulingHash TablesHashmap ImplementationBanned WordsBoomerang PointsBulls And CowsDeck Of CardsDistant BarcodesEncode DecodeExpressive WordsFind And Replace PatternFind Common CharactersFour SumFraction To DecimalGroup AnagramsHashmapHashsetInsert Delete Random DuplicatesInsert Delete RandomKeyboard RowLargest Triangle AreaLemonade ChangeLongest Word DictionaryLru CacheMagic DictionaryMinimum Index Sum Of Two ListsN Repeated ElementsPairs With SumPowerful IntegersRepeated Dna SequencesShortest Completing WordShuffle ArraySort By CountSubdomain Visit CountSubstring ConcatThree SumTwo SumUncommon WordsValid SudokuVerifying Alien DictionaryWord PatternWord SubsetsHeapsHeap ImplementationPriority Queue ImplementationCheck Valid TriangleDesign TwitterK Most FrequentK Pairs With Smallest SumsKth Largest In StreamKth LargestKth Smallest In Sorted MatrixLast Stone WeightMedian Of StreamTop K Frequent WordsLinked ListSingly Linked List ImplementationAdd Two Numbers IiAdd Two NumbersDelete Duplicates AllDelete DuplicatesDelete Node Without HeadIntersectionLinked CycleLinked List Cycle IiLinkedlistList PalindromeMerge K ListsMerge Two ListsMiddle Linked ListNext Greater NodeOdd Even Linked ListPartition ListRemove ElementRemove Nth EndReorder ListReverse K GroupsReverse LinkedlistReverse MnRotate ListSort ListSplit List In PartsSwap PairsMathAdd BinaryAdd DigitsBasic Calculator IBasic Calculator IiConstruct RectangleConvert To Base 7Convert To HexConvert To NumberCount PrimesCount Zeroes FactorialDivide Two NumbersGame Of NimHamming DistanceHappy NumbersInteger To English WordsIntersection Two ArraysLargest Triangle AreaMajority ElementMin Time DifferenceMinimum Area RectangleMissing NumberNext Greater IiiNext PermutationNth DigitNum To ColPerfect NumberPower Of TwoReach A NumberRectangle OverlapSelf Dividing NumbersSmallest Integer Divisible By KTotal TimeUgly NumbersValid BoomerangValid NumberMatrixBrick WallFlip ImageGame Of LifeImage SmootherIsland PerimeterMagic Squares In GridMatrix Cells DistanceRange AdditionReshape MatrixRobot Bounded CircleRook CapturesRotate ImageSet Matrix ZerosSpiral Matrix GenerateSpiral Matrix IiiSpiral MatrixToeplitz MatrixTranspose MatrixWalking Robot SimulationMysqlBig Countries.Classes More Than 5.Combine Two Tables.Customers Who Never Order.Delete Duplicate Emails.Duplicate Emails.Employee Earning More Than Managers.Not Boring Movies.Rising Temperature.Second Highest Salary.Swap Salary.QueuesCircular Deque ImplementationCircular Queue ImplementationQueue ImplementationGas StationMax Sliding WindowQueue Using StacksRotate StringStack Using QueuesSortBubble SortDelete Columns To Make SortedHeight CheckerInsertion SortLongest Harmonious SequenceMax GapMerge SortMost Profit WorkersQuick SortReorder LogsSelection SortSort Array Parity IiSort By ParitySort Three ColorsStackBaseball GameDuplicate RemovalEvaluate Reverse Polish NotationExclusive Fuction TimeMin StackNext Greater Element IiOne Three Two PatternRemove K DigitsSimplify PathValid ParanValidate Stack SequenceStringsAdd BinaryAdd StringsBackspace CompareBuddy StringsCamelcase MatchingCompare Version NumbersComplex Number MultiplicationCount Binary StringsCount SayDecode StringDetect CapitalFind All AnagramsFind And ReplaceFind Duplicate FilesFirst Unique CharacterGoat LatinInt To RomanIsomorphicJewelsLargest NumberLength Of Last WordLicence Key ReformattingLong Pressed NameLongest Common PrefixLongest Palin SubstringLongest PalindromeLongest Substring With K CharsLongest Substring Without RepeatingLongest Uncommon SeqMinimum Window StringMultiply StringsNumber Of Segments StringOptimal DivisionPalindromePermutations In StringRansom NoteRemove CommentsRepeated String MatchRepeated Substring PatternReverse IntReverse Only LettersReverse String IiReverse String WordsReverse StringReverse Vowels StringsReverse Words IiiRobot OriginRoman To IntRotated DigitsShifting LettersShortest Distance To CharacterString CompressionString To IntegerStrstrTo LowerUnique EmailUnique Morse CodeValid AnagramValid IpValid PalinValid Palindrome IiValid String After SubsZigzag ConversionTreesTree ImplementationTrie ImplementationArray BstAverage LevelsBst To Greater TreeBuild Tree PostorderConstruct Pre InCount Complete Tree NodesCousins In Binary TreesDiameter Binary TreeFind Bottom LeftFlatten Binary Tree To Linked ListInorderInvert TreeIs BalancedLargest Value LevelLeft Similar TreesLevel Order OneLevel Order TwoLowest Common AncestorMax Depth N AryMax DepthMax SubtreeMaximum Diff Between Ancestor And NodeMaximum Path SumMerge Two TreesMin DepthMost Frequent Subtree SumN Ary PostorderN Ary PreorderNary Level OrderNodes At Distance KPath Sum AllPath Sum IiiPath SumPopulate Next Right PointerPostorderPreorderSame TreeSecond Minimum NodeSerialize TreeSubtree Of Another TreeSum Of Left LeavesSum Root To Leaf PathsSum Root To LeafsSymmetricTilt TreeTree PathsUnivalue TreeVerify Tree SerializationZigzag Level OrderTrieTrie ImplementationLongest Word DictionaryReplace WordsWord Search IiTwo PointersContainer With Most WaterFind Duplicate NumberLongest Repeating Character ReplacementLongest Word In DictionaryRemove DuplicatesRemove ElementSquares Of Sorted ArrayThree Sum Closest
algorithms-ai
algorithms-ai
algorithms-daemon
Algorithm daemon package of Corianderbuild grpc pythonpython-mgrpc_tools.protoc-I.--python_out=.--grpc_python_out=..\WorkerBroker.proto## caution: evething generate protos to check the reference path of 'WorkerBroker_pb2_grpc'.
algorithmselector-ML
Algorithm Selection Portfolio with MLThis project shows an algorithm selection library using ML based on the scikit-learn library.ContextThis project arose after the writing of the paperLearning for Spatial Branching: An Algorithm Selection ApproachThe use of machine learning techniques to improve the performance of branch-and-bound optimization algorithms is a very active area in the context of mixed integer linear problems, but little has been done for non-linear optimization. To bridge this gap, we develop a learning framework for spatial branching and show its efficacy in the context of the Reformulation-Linearization Technique for polynomial optimization problems.This library is intended to generalize the analysis performed in the above-mentioned paper. It analyzes multiple algorithms on a set of problems, defined by their features, and seeks to provide a series of metrics and graphs to compare their performance. Not only compares the performance of the algorithms on the dataset, but also provides a learning-based solution of the optimal choice of algorithm based on the problem's features.Table of ContentsIntroductionML modulePlots moduleExecution exampleIntroductionThanks to this library you will be able to run the training and prediction of several models at once, preprocess the data and generate a performance measure based on the maximization or minimization of the generated output. In addition, three functions are included to generate comparison plots of the options to be analyzed. Therefore, starting from two data sets x and y (containing x the characteristics of the problems to be used and y the generated output) this library is able to:Create the test sets.Normalize the output (the user can choose between maximization or minimization).Train the necessary models.Create the prediction for the previously generated test sets and models.Create various plots that facilitate the understanding of the results.ML moduleThe following is a list of the functions included in the ML module:data_processingPreprocesses the data according to the parameters set by the user and returns the training sets and test sets.The x parameter (dataframe) contains the problems (rows) and its features (columns) and the y parameter (dataframe) contains the outputs. Each column is an option. The segmentation will be done based on the test_size value, which indicates the percentage of instances in the test data. If normalize parameter is True the output (y_train and y_test) will take values between 0 and 1, being 1 the best option. The parameter better_smaller indicates the option to choose during normalization, minimize or maximize.train_asTrains multiple models using the method passed as parameter. It is based on sklearn library.The output will have as many models as options to be evaluated. The x parameter (dataframe) contains the problems (rows) and its features (columns) and the y parameter (dataframe) contains the outputs. The method parameter indicates the name of the sklearn method to be used for the training. The user can introduce all the parameters accepted by the method, see sklearn documentation for more information.predict_asGenerates the predictions from the models passed as parameters. This function is based on the sklearn library.The models parameter contains the path to the models saved during the training process. The data parameter contains the new data to use for the prediction (for example x_test). The option_names parameter contains the name of the options that the user is evaluating (headers of y_train).algorithm_portfolioCreates the potfolio with the best option for each instance (compared with the true optimal option). This function should be used with normalized data. If there is a tie all the optimal options will be shown.The y_pred dataframe is used to create the ML_value and ML_option_name columns and the y_test dataframe is used for the Optimal_solution column. For each row the closest value to 1 will be selected.Plots moduleThe following is a list of the functions included in the plots module:boxplotRepresents the boxplot taking into account the number of times each option is selected as the best. It should be used with the normalized data. The ML box is also created by selecting the best option for each instance (i.e. the closest value to one after normalizing). Each box will represent the number of times that the option was selected as the best.performance_comparison_plotCreates the bar plot or the stacked bar plot that represent percentage of times (percentage of problems) that each option is selected by ML compared with the optimal solution. In other words, it compares the number of times that the ML selects the best possible option.ranking_plotThis function generates a plot where, for each instance, the branching rules are ranked from best to worst, according to the normalized output. Stacked bar graphs represent percentage of problems in each rank position per option. It should be used with the normalized data.Execution exampleIf you want to try the library an example python script and two csv files are provided. You just have to execute:python3 example.pyThe output will be the images of the three generated plots and will be stored in the path where the example.py file is located. In addition, a model will be generated for each option and stored in the models folder. If you wish to see the obtained results, it is enough to add the following lines of code:Option 1 (prints the best solution for each problem obtained by ML):res=ml.algorithm_portfolio(y_test,y_pred) with pd.option_context('display.max_rows', None, 'display.max_columns', None): print(res)Option 2 (prints the predictions generated by ML):with pd.option_context('display.max_rows', None, 'display.max_columns', None): print(y_pred)DevelopersCaseiro Arias, MaríaGómez Casares, IgnacioGonzález Díaz, JulioGonzález Rodríguez, BraisPateiro López, Beatriz
algorithms-km-programs
No description available on PyPI.
algorithms-toolbox
Failed to fetch description. HTTP Status Code: 404
algorithm-tool
No description available on PyPI.
algorithm-toolkit
Welcome to the Algorithm Toolkit!We built the Algorithm Toolkit (ATK) to provide researchers and data anaysts the tools they need to process data quickly and efficiently, so they can focus on actually doing scientific or other analysis work.Please see this project's official documentation onRead The Docs. Below are instructions for how to install the ATK on your own system.InstallationSuper Quick StartPython projects should be installed in virtual environments in order to keep versions of various packages in sync with the project code. However, if you want to get up and running immediately you can do the following in a Terminal window (assumesPythonandpipare installed):pipinstallalgorithm_toolkit algcpmyprojectcdmyproject algrunPoint your browser tohttp://localhost:5000/. You should see the development environment welcome page.See the next section for a more detailed install process.Slightly More Involved But Still Pretty Quick StartA word about virtual environmentsAs noted above, it's a best practice to start new Python projects in virtual environments. As you work on code, you rely more and more on external libraries. As time passes, changes to those libraries will eventually break your code unless you are constantly updating it. So when you install a new version of a library for another project, suddenly you find that your earlier project no longer works.Virtual environments solve this problem. Each environment contains a discreet set of the libraries used by your code, at the versions you determine.Thankfully, creating virtual environments in Python is easy.Python 3Linux and Mac:python3-mvenvmyenvironmentsourcemyenvironment/bin/activateOn some Linux systems, python3-venv is not installed by default. If you get an error with the command above, try:# Debian/Ubuntusudoaptinstallpython3-venv# RedHat/CentOSsudoyuminstallpython3-venvOn Windows:py-3-mvenvmyenvironment myenvironment\Scripts\activate.batPython 2Python 2 does not come with a built in virtual environment creator. We recommend using virtualenvwrapper.Their install docs are excellent.Once you've installed and configured virtualenvwrapper, create your virtual environment:mkvirtualenvmyenvironmentSetting up your ATK projectpipinstallalgorithm_toolkit algcpmyprojectcdmyproject algrunPoint your browser tohttp://localhost:5000/. You should see the development environment welcome page.What just happened?Let's walk through this line by line.pipinstallalgorithm_toolkitThe ATK lives onPyPi, so this line downloads and installs the ATK in your virtual environment. Several dependencies will be installed as well.algcpmyprojectThis line uses the ATK's Command Line Interface (CLI) calledalg. Thecpcommand stands for "create project". "myproject" is the name of your project, which will also be the name of the folder created for the project (feel free to use a more original name).cdmyprojectPuts you in the project folder.algrunThis command also uses the CLI. Theruncommand starts a development web server. As we discuss elsewhere in the docs (see TODO: create page), setting up your algorithms and processing chains is accomplished using a web-based interface.Installing the example projectThe ATK comes with an example project to help you understand how it works.PrerequisitesThe example project requiresNumPyin order to work. If you're on a Linux machine, you can install the example project and it will handle this dependency for you.However, if you're on a Mac or Windows machine, installing NumPy is more complicated.AnacondaFor these operating systems, we highly recommend using Anaconda or it's smaller cousin Miniconda. The only difference between these two is that Anaconda installs over 150 packages (including SciPy and NumPy) out of the box whereas with Miniconda you need to install everything separately. Either way is fine.Anaconda installation PageMiniconda installation PageOnce Anaconda is installed, you can set up the example project right away. If you decide to use Miniconda, first do the following:condainstallnumpyInstall the example projectTo set up the example project, just use the--exampleflag when setting up a new project:algcpmyproject--exampleInstalling documentation locallyIf you want these docs to be installed locally, use the--with-docsflag when creating a project. You need to have Sphinx installed for this to work.pipinstallsphinxsphinx_rtd_theme algcpmyproject--with-docsTroubleshooting Install IssuesOn some systems, additional libraries may be needed to install the Algorithm Toolkit. Try these packages if your ATK install fails:Debian/Ubuntu Linux# python 3sudoaptinstallpython3-devbuild-essential# python 2sudoaptinstallpython-devbuild-essentialRedHat/CentOS Linux# python 3sudoyuminstallpython3-devel# python 2sudoyuminstallpython-develDockerThis repository contains 2 Docker filesatkatk-devOnce built and run, Docker containers are generated, which gives users access to easy to use development/deployment tools.Check out our officialDocker documentationto learn moreContributingThanks for your interest in contributing to the Algorithm Toolkit codebase! You should know a few things.Code of ConductFirst of all: this project has a code of conduct. Please read the CODE_OF_CONDUCT file in the project root folder and stick to its principles.LicenseThe MIT license (see LICENSE file) applies to all contributions.Contributing to DocsWe also welcome contributions to the documentation. You should follow the same workflow for contributing code as for contributing documentation. Also, please follow the reSructuredText format used by the existing documents (guidelines here).You will need to install Sphinx and the RTD theme to build docs locally (which you should do to make sure they look OK).$pipinstallsphinxsphinx_rtd_theme $sphinx-builddocsdocs/html-aMore InfoPlease see the Contributing page on Read The Docs for more detailed information.
algorithmx
AlgorithmX PythonAlgorithmX Pythonis a library for network visualization and algorithm simulation, built onAlgorithmX. It can be used through a HTTP/WebSocket server, or as a widget in Jupyter Notebooks and JupyterLab.ResourcesWebsiteDocumentationInstallationPython 3.7.0 or higher is required. Using pip:python -m pip install algorithmxJupyter WidgetIn classic Jupyter notebooks, the widget will typically be enabled by default. To enable it manually, runjupyter nbextension enable --sys-prefix --py algorithmxwith theappropriate flag. To enable in JupyterLab, runpython -m jupyter labextension install @jupyter-widgets/jupyterlab-manager --no-build python -m jupyter lab buildExample UsageIf you wish to use the library through a HTTP/WebSocket server, follow the template below:importalgorithmxserver=algorithmx.http_server(port=5050)canvas=server.canvas()defstart():canvas.nodes([1,2]).add()canvas.edge((1,2)).add()canvas.onmessage('start',start)server.start()The graphics can be found athttp://localhost:5050/.If you are using Jupyter, try adding the following code to a cell:fromalgorithmximportjupyter_canvascanvas=jupyter_canvas()canvas.nodes([1,2]).add()canvas.edge((1,2)).add()canvasDevelopmentManual installMake sure you have Python 3.7 of higher, then run# build js cd js npm run build cd .. # install dependencies python -m pip install -r dev-requirements.txt python -m pip install --no-deps --editable ".[jupyter,networkx]"HTTP ServerDocker:Docker-compose up http-serverManually:python examples/basic_http_server.pyThen openlocalhost:5050in a browser.Jupyter notebookDocker:docker-compose up notebookManually:python -m jupyter nbextenion list python -m jupyter notebookThen try openingexamples/basic_notebook.ipynb.Jupyter labDocker:docker-compose up jupyter-labManually:python -m jupyter labextension install @jupyter-widgets/jupyterlab-manager --no-build python -m jupyter lab build python -m jupyter labextension list python -m jupyter labThen try openingexamples/basic_notebook.ipynb.Build and test packageClean any previous builds withrm -rf build dist.Docker:docker-compose up --build buildManually:python -m mypy . python -m pytest tests -vv python setup.py build sdist bdist_wheelThe bundle can be found indist/.DistributeSet up pre-commit hooks:pre-commit installPublish to PyPI:./scripts/deploy.sh
algorithm-x
Algorithm XAn efficient Python implementation ofAlgorithm X, which finds solutions to instances of theExact Cover problem.Installation$pipinstallalgorithm-xUsagefromalgorithm_ximportAlgorithmXsolver=AlgorithmX(7)solver.appendRow([2,4,5],'row 1')solver.appendRow([0,3,6],'row 2')solver.appendRow([1,2,5],'row 3')solver.appendRow([0,3],'row 4')solver.appendRow([1,6],'row 5')solver.appendRow([3,4,6],'row 6')forsolutioninsolver.solve():print(solution)
algoritmia
BibliotecaalgoritmiaImplementada en Python 3.Utilizada en dos asignaturas de la Universitat Jaume I de Castelló:EI1022: Grado en Ingeniería Informática.MT1022: Grado en Matemática Computacional.ContenidoEstructuras de datos:Colas: Fifo, LifoListas enlazadas: LinkedListGrafos: Digraph, UndirectedGraphMontículos: MinHeap, MaxHeapDiccionarios de prioridad: MinHeapMap, MaxHeapMapConjuntos disjuntos: MFSetAlgoritmos sobre grafos:Recorridos de vértices y aristasComponentes conexosÁrbol de recubrimiento mínimoCamino más cortoAlgoritmo de DijkstraEsquemas algorítmicos:Búsqueda con retroceso (backtracking)Ramificación y acotación (brand and bound)Divide y vencerás (divide and conquer)Reduce y vencerás (reduce and conquer)Problemas:Mochila (Knapsack)Cambio de moneda (Coin change)Empaquetado (Bin packing)Viajante (Travelling salesman)N-reinas (N-queens)Coloreado de grafos (Graph coloring)Voraces exactos: MST (Kruskal y Prim), mochila fraccionaria
algoritmika-quiz-package
Math quiz packageMy unique package with unique functionality, which wasn't onhttps://pypi.org/In variableOPERATIONS_DICTstore user and math operations.random_calculatorfunction generating random numbers for user, and choice random math operation fromOPERATIONS_FOR_USERlist, where storedOPERATIONS_DICTkeys with user operations -+ - * /.After generating numbers and choosing math operation calculated result, and ask user for his answer in functionuser_poll.Usingquizfunc to poll user required number of times and for count his correct answersUse your mind
algoritmo-di-ma-ghoche
No description available on PyPI.
algoritmo-gpt
No description available on PyPI.
algormeter
AlgorMeter: Tool for developing, testing, measuring and exchange optimizers algorithmsAlgorMeter is a python implementation of an environment for develop, test, measure, report and compare optimization algorithms. Having a common platform that simplifies developing, testing and exchange of optimization algorithms allows for better collaboration and sharing of resources among researchers in the field. This can lead to more efficient development and testing of new algorithms, as well as faster progress in the field overall. AlgorMeter produces comparative measures among algorithms in csv format with effective test function call count.It embeds a specific feature devoted to optimize the number of function calls, so that multiple function calls at the same point are accounted for just once, without storing intermediate results, with benefit in terms of algorithm coding.AlgorMeter contains a standard library of 10 DC problems and 7 convex problems for testing algorithms. More problem collections can be easily added.AlgorMeter provide integrated performance profiles graphics, as developed by E. D. Dolan and J. J. More. They are a powerful standard tool, within the optimization community, to assess the performance of optimization software.problems + algorithms = experimentsA problem is a function f where f: R(n) -> R with n called dimension.f = f1() - f2() difference of convex function where f1, f2: R(n) -> R.'problems' is a list of problem'algorithm' is a code that try to find problem local minima'experiment' is an algorMeter run with a list of problems and a list of algorithms that produce a result reportHow to use...Implement an algorithm...Copy and customize algorithm examples like the following(there are many included example?.py)defgradient(p,**kwargs):'''Simple gradient'''forkinp.loop():p.Xkp1=p.Xk-1/(k+1)*p.gfXk/np.linalg.norm(p.gfXk)and refer to the available following system propertiesalgorMeter propertiesDescriptionk, p.Kcurrent iterationp.Xkcurrent pointp.Xkp1next point.to be set for next iterationp.fXkp.f(p.Xk) = p.f1(p.Xk) - p.f2(p.Xk)p.fXkPrevprevious iteration f(x)p.f1Xkp.f1(p.Xk)p.f2Xkp.f1(p.Xk)p.gfXkp.gf(p.Xk) = p.gf1(p.Xk) - p.gf2(p.Xk)p.gf1Xkp.gf1(p.Xk)p.gf2Xkp.gf2(p.Xk)p.optimumPointOptimum Xp.optimumValuep.f(p.optimumPoint)p.XStartStart Pointto determine the p.Xkp1 for the next iteration....and run it:df,pv=algorMeter(algorithms=[gradient],problems=probList_covx,iterations=500,absTol=1E-2)print('\n',pv,'\n',df)pv and df are pandas dataframe with run result.A .csv file with result is also created in csv folder.(see example*.py)AlgorMeter interfacedefalgorMeter(algorithms,problems,tuneParameters=None,iterations=500,timeout=180runs=1,trace=False,dbprint=False,csv=True,savedata=False,absTol=1.E-4,relTol=1.E-5,**kwargs):algorithms: algorithms list.(algoList_simple is available )problems: problem list. See problems list in example4.py for syntax.(probList_base, probList_covx, probList_DCJBKM are available)tuneParameters = None: see tuneParameters sectioniterations = 500: max iterations numbertimeout = 180: time out in secondsruns = 1: see random sectiontrace = False: see trace sectiondbprint= False: see dbprint sectioncsv = True: write a report in csv format in csv foldersavedata = False: save data in data folderabsTol =1.E-4, relTol = 1.E-5: tolerance used in numpy allClose and isClose**kwargs: python kwargs propagated to algorithmscall to algorMeter returns two pandas dataframe p1, p2. p2 is a success and fail summary count. p1 is a detailed report with the following columns.ProblemDimAlgorithmStatus: Success, Fail or ErrorIterationsf(XStarf(BKXStar)Delta: absolute difference between f(XStar) and f(BKXStar)SecondsStart pointXStar: minimumBKXStar: best known minum\f1 f2 gf1 gf2: effective calls count... : other columns with count to counter.up utility (see below)Stop and success conditiondefstop(self)->bool:'''return True if experiment must stop. Override it if needed'''returnbool(np.isclose(self.fXk,self.fXkPrev,rtol=self.relTol,atol=self.absTol)ornp.allclose(self.gfXk,np.zeros(self.dimension),rtol=self.relTol,atol=self.absTol))defisSuccess(self)->bool:'''return True if experiment success. Override it if needed'''returnself.isMinimum(self.XStar)can be overriden like indefstop():returnstatus...p.stop=stopp.isSuccess=stopAnother maybe more simple way is to call statement break in main loop.See example3.pyProblems function call optimizationAlgorMeter embeds a specific feature devoted to optimize the number of function calls, so that multiple function calls at the same point are accounted for just once, without storing intermediate results, with benefit in terms of algorithm coding. So in algorithm implementation is not necessary to store the previous result in variables to reduce f1, f2, gf1, gf2 function calls. AlgorMeter cache 128 previous calls to obtain such automatic optimization.Problems ready to useImporting 'algormeter.libs' probList_base, probList_covx, probList_DCJBKM problems list are available.probList_DCJBKMcontains ten frequently used unconstrained DC optimization problems, where objective functions are presented as DC (Difference of Convex) functions: 𝑓(𝑥)=𝑓1(𝑥)−𝑓2(𝑥).Joki, BagirovprobList_covxcontains DemMal,Mifflin1, Miffilin2,LQ,QL,MAXQ,MAXL,CB2,CB3,MaxQuad, Rosen, Shor, TR48, A48 and Goffin test convex functions/problemprobList_no_covxcontains special no convex functions: Rosenbrock, CrescentprobList_basecontains Parab, ParAbs, Acad simple functions for algorithms early development and test.See 'ProblemsLib.pdf'CountersInstruction likecounter.up('lb<0', cls='qp')is used to count events in code, summerized in statistics at the end of experiment as a column, available in dataframe returned by call to algorMeter and in final csv. For the code above a column with count of counter.up calls and head 'qp.lb>0' is produced.Also are automatically available columns 'f1', 'f2', 'gf1', 'gf1' with effective calls to f1, f2, gf1, gf2See example3.pydbprint = TrueInstruction dbx.print produce print out only if algorMeter call has option dbprint == Truedbx.print('t:',t, 'Xprev:',Xprev, 'f(Xprev):',p.f(Xprev) ).See example3.pyNB: If dbprint = True python exceptions are not handled and raised.Trace == TrueIf Default.TRACE = True a line with function values are shown as follows in the console for each iteration for algorithms analysis purpose.Acad-2 k:0,f:-0.420,x:[ 0.7 -1.3],gf:[ 1.4 -0.6],f1:2.670,gf1:[ 3.1 -2.9],f2:3.090,gf2:[ 1.7 -2.3]Acad-2 k:1,f:-1.816,x:[-1.0004 -0.5712],gf:[-8.3661e-04 8.5750e-01],f1:0.419,gf1:[-2.0013 -0.7137],f2:2.235,gf2:[-2.0004 -1.5712]Acad-2 k:2,f:-1.754,x:[-0.9995 -1.4962],gf:[ 9.6832e-04 -9.9250e-01],f1:2.361,gf1:[-1.9985 -3.4887],f2:4.115,gf2:[-1.9995 -2.4962]These lines represent the path followed by the algorithm for the specific problem.NB: If trace = True python exceptions are not handled and raised.See example3.pytuneParametersSome time is necessary tune some parameter combinations. Procede as follow (See example4.py):Define and use module, non locals parameters in your algo code.Define a list of lists with possible values of tuning parameters as follows:tpar=[# [name, [values list]]('alpha',[1.+iforiinnp.arange(.05,.9,.05)]),# ('beta', [1. + i for i in np.arange(.05,.9,.05)]),]call algorMeter with csv = True and tuneParameters= like tuneParameters=tpar.open csv file produced and analyze the performance of parameters combinations by looking column '# TuneParams'. Useful is a pivot table on such columns. See example4.pyRandom start pointIf algorMeter parameter run is set with a number greater than 1, each algorithm is repeated on the same problem with random start point in range -1 to 1 for all dimensions. By the method setRandom(center, size) random X can be set in [center-size, center+size] interval.See example5.pyRecord datawith option data == True store in 'npy' folder one file in numpy format, for each experiment with X and Y=f(X) for all iterations. It is a numpy array with:X = data[:,:-1]Y = data[:,-1]File name is like 'gradient,JB05-50.npy'.These files are read by viewer.py data visualizer.Performance ProfilePerformance profiles graphics, as developed by E. D. Dolan and J. J. More, are a powerful tool to assess the performance of optimization software. For this reason they are standard accepted within the optimization community. See example2.pydf,pv=algorMeter(algorithms=algorithms,...)perfProf(df,costs=['f1','Iterations'])# df: first pandas dataframe output of algormeter call# costs: list of column labels in dfplt.show(block=True)It is possible to graph performance profiles by preparing a pandas data frame using a spreadsheet with the mandatory columns 'Problem','Dim','Algorithm','Status' and the columns costs that you want to drawdf=pd.read_excel(r'Path of Excel file\File name.xlsx',sheet_name='your Excel sheet name')perfProf(df,costs=['cost1','cost2'])plt.show(block=True)MinimizeIn case you need to find the minimum of a problem/function by applying an algorithm developed with algormeter, the minimize method is available. (See example6.py):p=MyProb(K)found,x,y=p.minimize(myAlgo)Visualizer.pyRunning visualizer.py produce or updates contour image in folder 'pics' for each experiment with dimension = 2 with data in folder 'npy'.Examples indexexample1.py: Simplest possible exampleexample2.py: Dolan, More performance profileexample3.py: dbx.print, trace,counter.up, counter.log, override stop, break exampleexample4.py: algorithm parameters tuningexample5.py: multiple run of each problem with random start pointexample6.py: minimize new problem with algometer algorithmContributingYou can download or fork the repository freely.https://github.com/xedla/algormeterIf you see a mistake you can send me a mail [email protected] you open up a ticket, please make sure it describes the problem or feature request fully.Any suggestion are welcome.LicenseIf you use AlgorMeter for the preparation of a scientific paper, the citation with a link to this repository would be appreciated.This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.InstallationAlgormeter is available as pypi pip package.pip3installalgormeterDependenciesPython version at leastPython 3.10.6Package installable with pip3numpypandasmatplotlibAlgormeter plays well withVisual Studio Codeand in jupyter
algorsort
Sort lists with Algorsort supports number lists and word lists batteries not includedcreated by: Jased#0001 and Github CopilotChangelogtip: dates are in MM/DD/YYYY format.2 (11/20/2022) You know it’s not the same as it was ——————- - Started adding support for words - Seperated words and numbers into classes - Changed readme - Added my new email and website1 (8/5/2022) Sodium Cloride ——————- - released :pog:
algorthm
algorthmA python package for visualizing and learning algorithms.AuthorsDinak Lal V -[www.dinaklal.in][email protected] package -pip install algorthmImport into your code -import algorthmUse methods. Default case the algorithms in this package give you step wise result so that one can understand the back ground operations-algorthm.sort.bubbleSort(list)For using algorithms without stepwise result, pass "False" as last argument eg -:algorthm.sort.bubbleSort(list,False)
algorum-quant-client-py3
No description available on PyPI.
algorun
Algorun CLITHIS IS IN BETAIs this for me?This tool simplifies setting up and starting an Algorand mainnet node. You should know your way around a CLI if you're planning to use itInstallPrerequisitesThe key required dependency is Python 3.10+, but some of the installation options below will install that for you.Algorun also has some runtime dependencies that also need to be available for particular commands.Docker - Docker Compose (and by association, Docker) is used to run the Algorand mainnet container, we require Docker Compose 2.5.0+Pipx - a better package manager than pip that you'll use to install the cliInstall Algorun with pipx on any Mac, Linux and Windows subsystem for LinuxEnsure desired prerequisites are installedPython 3.10+pipxDockerInstall using pipxpipx install algorunRestart the terminal to ensure Algorun is available on the pathVerify installationMaintenanceTo update Algorun:pipx upgrade algorunTo remove Algorun:pipx uninstall algorunVerify installationVerify Algorun is installed correctly by runningalgorun --versionand you should see output similar to:algorun, version 0.1UsageCreate a directory where you're comfortable keeping the node config and files, we suggest naming italgorand, open that directory in a terminalalgorun startwill start your node by creatingdocker-compose.yml,config.jsonfiles and adatadirectory where your node will persist.algorun stopwill shut down your nodealgorun goalis a wrapper for theGoal CLItypingalgorun goal node statuswill return your nodes status, typingalgorun goal node status -w 1000instead will keep giving you node status updates every 1 secondNoteIf you get receive one of the following errors:command not found: algorun(bash/zsh)The term 'algorun' is not recognized as the name of a cmdlet, function, script file, or operable program.(PowerShell)Then ensure thatalgorunis available on the PATH by runningpipx ensurepathand restarting the terminal.If you're experiencing issues with algorunraise an issue.
algorythm
AlgoRythmAlgoRythm is a real-time audio visualizer with customizable features and Windows media integration to graphically display information about audio levels and media.Made using Python while utilizing performant programming techniques.CIS4930 - Performant Programming with Python - UF Summer 2021Project ResourcesOutline:https://docs.google.com/document/d/1MjfzGPgUQ3EDTRZ4OSIiPHjVnTdgo9IleFzqqXE-JPoTestPyPI link:https://test.pypi.org/project/algorythm/Project Repository link:https://github.com/cburrows1/AlgoRythmInstallation instructionsInstall Python 3.8 or LaterManually install pyaudio (see section below)On Windows enable Stereo mix (or skip this step and Algorythm will visualize your default input device):Control panel -> Hardware and Sound -> Sound -> Recording -> Stereo Mix -> *Right Click* EnableIf Stereo Mix does not appear under recording devices, follow the Driver Installation Instructions belowRunpip install -i https://test.pypi.org/simple/ algorythmORDownload the latest wheel package from ourrelease listNavigate to the downloaded package and install withpip install <filename>.whlPyAudio Installation InstructionsDownload PyAudio whl fromhttps://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudiocorresponding to your python versionNavigate to download directoryInstall it withpip install <filename>.whlRealtek Stereo Mix Driver Installation InstructionsCheck that it isn't disabled by right clicking, then select "Show Disabled Devices"If it shows up, then enable it. Otherwise it is necessary to download the driver from Realtek:Download the driver executable (64 bit) fromRealtekor aMuch Faster MirrorRun the executable and follow the installation instructionsRestart Computer and continue with the Algorythm installation instructions aboveExecution of programRun withpython -m algorythmChanges to settings are saved to a file,algorythm_settings, in the current working directory.If no bars appear, even with Stereo Mix enabled, a USB DAC or audio device is likely interfering and bypassing RealTek. Unplug that device and connect to AUX instead. Restart Algorythm.
algos-37a
Failed to fetch description. HTTP Status Code: 404
algosec
docstestspackageA Python SDK providing simple access to AlgoSec APIs, including handy methods to implement common network security policy management tasks, such as:Check whether specific traffic is allowed by the firewalls and security devices in the network.Open a network security change request.Check status of existing change requests.Update business application connectivity requirements (and automatically trigger change requests as needed)Useful for automation and orchestration (e.g. DevOps), building custom portals, or exposing specific functionality to Application Owners, IT, Helpdesk, Information Security, Security Operations, etc.Included in this package are clients for AlgoSec Firewall Analyzer, FireFlow and BusinessFlow.InstallationInstall the latest version from PyPi by running:pip install algosec --upgradeor clone this repo and run:python setup.py installContributionContributions are welcome! Please follow the standard pull request process.DocumentationDocumentation available online at:https://algosec-python.readthedocs.io/en/latest/How to build doc’s locally?Using Spinx:$ cd docs $ make htmlThen see thedocs/_buildfolder created for the html files.DevelopingTo install the package for local development just run:pipenv installThis will install all the dependencies and set the project up for local usage and development .TestingTo run the unittests for all supported python versions, simply run:tox
algosec-resilient
Resilient Circuits Components For The AlgoSec Integration
algoseek-connector
Algoseek ConnectorA wrapper library for ORM-like SQL builder and executor. The library provides a simple pythonic interface to algoseek datasets with custom data filtering/selection.Supported FeaturesThe following query operations on datasets are supported:Selecting columns and arbitrary expressions based on columnsFiltering by column value/column expressionGrouping by column(s)Sorting by column(s)All common arithmetic, logical operations on dataset columns and function applicationFetching query results as a pandas DataFrameInstallationalgoseek-connectoris available on the Python Package Index. Install it using thepipcommand:pip install algoseek-connectorDocumentationDocumentation is availablehere.Dev installationalgoseek-connectoris installed usingPoetry.A Makefile recipe is available to install the package in developer mode along with developer dependencies:makedev-installIfmakeis not available, run:poetry install --with dev,docs pre-commit installTestingRefer to the README inside the tests directory.Building the docsThe documentation is generated using the sphinx library. First, install the necessary dependencies with the following command:poetryinstall--withdocsBuild the documentation using the Makefile located in thedocsdirectory:makehtmlPublishing to pypiIn order to pubish a new package version to pypi:update library version inpyproject.toml(note, we use semantic versioning with where version numbers correspond to major, minor and patch)runpoetry buildto create a packageconfigure your pypi credentials for poetry withpoetry config http-basic.pypi <username> <password>runpoetry publishto publish the library to PyPI
algoshop
No description available on PyPI.
algospace
发布方本地部署指南最保密、最快速的发布方式⚡️⚡️⚡️ 一分钟极速发布 ⚡️⚡️⚡️所需环境👉 任何可以上网的计算机👉 可以跑通的算法👉Python>=3.7第一步:准备算法预测函数例如:deflandmark_detection(image_path):'''人脸关键点标注args:image_path: 本地图片路径'''# 这里是具体算法实现 #return{'output_image_path':output_image_path,# 带关键点标注的本地图片路径'dets':dets,# 目标图像检测的人脸坐标点}第二步:安装 Python 包在算法所用 Python 环境的命令行执行:pipinstallalgospace-ihttps://pypi.python.org/simple第三步:初始化配置文件进入算法根目录,命令行执行:algospaceinitalgospace命令也可以简写为asc执行后在当前目录下生成algospace-config.py配置文件。第四步:填写配置文件根据algospace-config.py中的注释信息,填写第一步准备完成的预测函数的信息。例如第一步预测函数的配置信息应当填写为:service_filepath='./main.py'service_function='landmark_detection'service_input={'image_path':{'type':'image_path','describe':'人脸图片',}}service_output={'output_image_path':{'type':'image_path','describe':'带标注点的人脸图片'},'dets':{'type':'str','describe':'目标图像检测的人脸坐标点'}}最后一步:运行!进入算法根目录,命令行执行:algospacestart也可以挂在后台运行:nohupalgospacestart>./algospace.log2>&1&🎉 算法将会自动注册、运行、发布。🎉 稍等片刻后即可在「我的算法」页面中查看新增的算法。
algos-py
What is algos-py?This package contains implementations of some classic computer science algorithms. My main goal is to understand these algorithms and the best way to do that is to implement them myself.Along the way I practice test driven development (withpytest), continuous integration (withtravisandappveyor), coverage tracking (withcoverallsandcodecov), version control (withgit,githubandgitlab), documentation (withsphinxandreadthedocs) and a lot more.How to test?To run all of the unit-tests:$pytest-n2To run unit-tests for a specific module:$pytest./tests/test_heap.pyTo run all the unit-tests and produce a coverage report:$pytest-n2--cov=srcWhere to find?Primary repository:https://github.com/algos-all/algos-pySecondary (mirror) repository:https://gitlab.com/alisianoi/algos-pyRelease procedure:$# change version in setup.py$gitaddsetup.py$gitcommit-m"Bump version to 1.0.0"$gittagv1.0.0$gitpushgithubmain&&gitpushgithub--tags$gitpushgitlabmain&&gitpushgitlab--tags$pipinstall--upgradewheel$pythonsetup.pybdist_wheel$pipinstall--upgradetwine$twinecheck./dist/algos_py-1.0.0-py3-none-any.whl$twineupload./dist/algos_py-1.0.0-py3-none-any.whl
algosquare
# AlgoSquare
algo-square
No description available on PyPI.
algotaf
No description available on PyPI.
algotech
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTIONDefinitions.“License” shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.“Licensor” shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.“Legal Entity” shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, “control” means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.“You” (or “Your”) shall mean an individual or Legal Entity exercising permissions granted by this License.“Source” form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.“Object” form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.“Work” shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).“Derivative Works” shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.“Contribution” shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, “submitted” means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as “Not a Contribution.”“Contributor” shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:You must give any other recipients of the Work or Derivative Works a copy of this License; andYou must cause any modified files to carry prominent notices stating that You changed the files; andYou must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; andIf the Work includes a “NOTICE” text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.END OF TERMS AND CONDITIONSCopyright 2021 AlgoTech Capital Management LLCLicensed 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.Description: UNKNOWN Platform: UNKNOWN
algotemplate
No description available on PyPI.
algotester2array
Failed to fetch description. HTTP Status Code: 404
algotides
Algo TidesDescriptionThis Python application is a graphic interface for the user who owns or have access to an Algorand node and would like to issue operations through a GUI rather than CLI. (i.e.: manage wallets and addresses, send transactions, save a contact list)DisclaimerClone this repo only if you want to develop. If you are just a user please download the python package following instructions below.This repo is not guaranteed to work between commits.Installation$ pip install algotidesor you can download the.tar.gzpackage and install it that way.Users shouldn't download from this repo because it is not guaranteed to work between commits.Better to install viapipSecurityPlease keep in mind that this software stores some serialized data inside<HOME_FOLDER>/.algo-tides.As a result of this any user should put over this folder permissions that are stricter than usual.It is possible to inject arbitrary code when deserializingjsonpicklefiles so please be mindful.DonationsPlease consider donating ALGO to this project at the following address:TIDESVS3UR7WQTR5J3M5ADEJVOUUS2C2YOEIU4Z6VTPU2EMQME7PSDK76AAny donation will be used to fund the development and maintenance of Algo Tides.Algo Tides will always remain a free and open source app. Donations are on a voluntary basis.RequirementsPython 3.7Packages:PySide2py-algorand-sdkjsonpickleqasyncaioifyTroubleshootqt.qpa.plugin: Could not load the Qt platform plugin "xcb"This step creates a symlink from the existing library to the needed library:on MXLinux 19.4:sudo ln -s /usr/lib/x86_64-linux-gnu/libxcb-util.so.0.0.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1on Debian 10:sudo ln -s /usr/lib/x86_64-linux-gnu/libxcb-util.so /usr/lib/x86_64-linux-gnu/libxcb-util.so.1
algotik-tse
AlgoTik-tseاین ماژول جهت مصارف آموزشی، علمی و تحقیقاتی با زبان برنامه نویسی پایتون توسعه یافته است. سعی شده امکاناتی در این ماژول در نظر گرفته شود، که بتواند نیاز به تمامی اطلاعات سازمان بورس را مرتفع نماید و مانند یک وب سرویس دریافت اطلاعات کار کند. خروجی تمامی ساب ماژول ها با فرمت دیتافریم می تواند دریافت گردد.ویژگی های ماژول:قابلیت دسترسی به داده‌های یک سهم با استفاده از نماد يا نام کامل فارسی   <---قابلیت انجام تعدیل قیمت به صورت یکجا با احتساب انواع افزایش سرمایه و پرداخت سود نقدی   <---هوشمندی در تشخیص جابجایی یک نماد بین بازارهای مختلف و یکپارچه سازی همه سوابق نمادهای دارای جابجایی   <---قابلیت دسترسی به سوابق همه شاخص‌های بازار بورس و هوشمندی در تشخیص اشتباهات املایی و نگارشی عناوین شاخص صنایع بورسی   <---قابلیت دسترسی به سابقه داده‌های درون‌روز یک نماد شامل عمق بازار و ریز معاملات   <---قابلیت دسترسی و رصد لحظه‌ای دیده‌بان و عمق بازار در ساعت انجام معاملات در بازار   <---قابلیت تهیه لیست جامعی از مشخصات همه سهم‌های بازار   <---قابلیت دانلود دسته‌جمعی سابقه قیمت لیستی از سهم‌ها و ساخت پنل قیمت پایانی تعدیل شده برای آنها   <---قابلیت دسترسی به سابقه ۱۰ ساله قیمت دلار بازار آزاد   <---خروجی سازگار با دیتافریم پانداز و قابلیت فیلترینگ زمانی مجدد بر اساس تاریخ شمسی   <---قابلیت ارائه تاریخ شمسی، میلادی و نام ایام هفته برای داده‌های روزانه   <---همچین می‌توانید از طریقاین لینکبه آدرس تلگرامی ما دسترسی داشته باشیدالهام گرفته شده از finpy-tse و tsemodule5نصب ماژولpipinstallalgotik-tseآپدیت ماژولpipinstallalgotik-tse--upgradeفراخوانی ماژولimportalgotik_tseasattدریافت سابقه اطلاعات روزانه یک نماددریافت سابقه قیمت:att.stock(stock='شتران',start='1402-01-01',end='1402-07-01',values=0,tse_format=False,auto_adjust=True,output_type="standard",date_format="jalali",progress=True,save_to_file=False,multi_stock_drop=True,adjust_volume=False,return_type=None,)دریافت سابقه حقیقی-حقوقی:att.stock_RI(stock='شتران',start='1402-01-01',end='1402-07-01',values=0,tse_format=False,output_type="standard",date_format="jalali",progress=True,save_to_file=False,multi_stock_drop=True,)دریافت لیست کلیه دارایی های موجود در بورس تهران:att.stocklist(bourse=True,farabourse=True,payeh=True,haghe_taqadom=False,sandogh=False,payeh_color=None,output="dataframe",progress=True)دریافت اطلاعات مربوط به یک دارایی:att.stockdetail(stock='شتران')دریافت لیست سهامداران عمده سهم:att.shareholders(stock='شتران',date=None,shh_id=False)دریافت لیست افزایش سرمایه های سهم:att.stock_capital_increase(stock='شتران',)======= History0.2.8 (2023-12-17)First release on PyPI.0.2.9 (2023-12-18)Second release on PyPI.fix bug in returns0.3.2 (2024-01-05)Third release on PyPI.Add Shareholders0.3.3 (2024-01-05)Third release on PyPI.Fix bug in change_amount of shareholders0.3.4 (2024-01-11)Fourth release on PyPI.Add Capital Increase in simple method0.3.5 (2024-01-18)Fifth release on PyPI.Add stock information in beta phase.0.3.6 (2024-02-02)sixth release on PyPI.Add stock statistics in beta phase.0.3.7 (2024-02-04)seventh release on PyPI.Add currencies and coins in beta phase.0.3.8 (2024-02-27)eighth release on PyPI.Add payeh market color in stocklist.
algo-timer
Algorithm TimerOverviewAn easy-to-use algorithm timer.MechanismWe use a context-manager andwithin Python to give an convinent way to test a specific block of code. Just see the following examples.Note that we design this plot function here to test some algorithms' runing time and you can use it to test(and plot) the time of any block of code with minor change in source code(theTimerPloterclass, specifically)EaxmplesFibnaccifromalgotimerimportTimer,TimerPloterdeffib(n):ifn<=2:return1returnfib(n-1)+fib(n-2)deffibMemo(n):cache={1:1,2:1}defrec(n):ifnnotincache:cache[n]=rec(n-1)+rec(n-2)returncache[n]returnrec(n)if__name__=='__main__':withTimer('fib, 30')ast:print('fib(30) = ',fib(30))withTimer('fib, 35')ast:print('fib(35) = ',fib(35))withTimer('fibMemo, 30')ast:print('fibMemo(30) = ',fibMemo(30))withTimer('fibMemo, 35')ast:print('fibMemo(35) = ',fibMemo(35))ploter=TimerPloter()ploter.plot()The output:fib(30) = 832040 fib, 30 Spends 0.217 s fib(35) = 9227465 fib, 35 Spends 2.434 s fibMemo(30) = 832040 fibMemo, 30 Spends 0.0 s fibMemo(35) = 9227465 fibMemo, 35 Spends 0.0 sAnd we get two files:logging,csvis the time data.fib, 30, 0.217 fib, 35, 2.434 fibMemo, 30, 0.0 fibMemo, 35, 0.0AndTimer.png, a plot of the data.ClassificationfromalgotimerimportTimer,TimerPloterfromsklearnimportdatasetsfromsklearn.naive_bayesimportGaussianNBfromsklearn.neighborsimportKNeighborsClassifieriris=datasets.load_iris()withTimer('GaussianNB, Train'):gnb=GaussianNB()clf=gnb.fit(iris.data,iris.target)withTimer('GaussianNB, Test'):y_pred=clf.predict(iris.data)print("Number of mislabeled points out of a total%dpoints :%d"%(iris.data.shape[0],(iris.target!=y_pred).sum()))withTimer('KNN(K=3), Train'):neigh=KNeighborsClassifier(n_neighbors=3)clf=neigh.fit(iris.data,iris.target)withTimer('KNN(K=3), Test'):y_pred=clf.predict(iris.data)print("Number of mislabeled points out of a total%dpoints :%d"%(iris.data.shape[0],(iris.target!=y_pred).sum()))withTimer('KNN(K=5), Train'):neigh=KNeighborsClassifier(n_neighbors=5)clf=neigh.fit(iris.data,iris.target)withTimer('KNN(K=5), Test'):y_pred=clf.predict(iris.data)print("Number of mislabeled points out of a total%dpoints :%d"%(iris.data.shape[0],(iris.target!=y_pred).sum()))# plot itploter=TimerPloter()ploter.plot()The output:GaussianNB, Train Spends 0.001 s Number of mislabeled points out of a total 150 points : 6 GaussianNB, Test Spends 0.001 s KNN(K=3), Train Spends 0.019 s Number of mislabeled points out of a total 150 points : 6 KNN(K=3), Test Spends 0.019 s KNN(K=5), Train Spends 0.001 s Number of mislabeled points out of a total 150 points : 5 KNN(K=5), Test Spends 0.01Filelogging.csv:GaussianNB, Train, 0.001 GaussianNB, Test, 0.001 KNN(K=3), Train, 0.019 KNN(K=3), Test, 0.019 KNN(K=5), Train, 0.001 KNN(K=5), Test, 0.01FileTimer.png