Saravanan666/pypi-org huggingface dataset:
Package: pyfolio-tej
pyfolio is a Python library for performance and risk analysis of financial portfolios that works well with theZiplineopen source backtesting library.Trading Strategy Analysis with pyfolioAt the core of pyfolio are various tear sheets that combine various individual plots and summary statistics to
provide a comprehensive view of the performance of a trading algorithm.Here's an example of a simple tear sheet analyzing a strategy executed with the Zipline backtesting engine:Performance MetricsThe tear sheet presents performance and risk metrics for the strategy separately during the backtest and out-of-sample periods:Performance PlotsIn addition, it visualizes how several risk and return metrics behave over time:InstallationTo install pyfolio, run:pipinstallpyfolio-reloadedorcondainstall-cml4tpyfolio-reloadedDevelopmentFor development, you may want to use avirtual environmentto avoid dependency conflicts between pyfolio and other Python projects you have.To get set up with a virtual env, run:mkvirtualenvpyfolioNext, clone this git repository and runpython -m pip install .[all]and edit the library files directly.UsageA good way to get started is to run the pyfolio examples in aJupyter notebook. To do this, you first want to
start a Jupyter notebook server:jupyternotebookFrom the notebook list page, navigate to the pyfolio examples directory
and open a notebook. Execute the code in a notebook cell by clicking on it
and hitting Shift+Enter.Questions?If you find a bug, feel free toopen an issuein this repository.You can also join ourcommunity.SupportPleaseopen an issuefor support.ContributingIf you'd like to contribute, a great place to look is theissues marked with help-wanted.For a list of core developers and outside collaborators, seethe GitHub contributors list.
Package: pyfolk
Folk EduFolk python编程依赖包。A Python package used by Folk.安装 / Installing在终端执行如下指令以安装pyfolk。Input the following code in powershell(cmd.exe) to install pyfolk.pip install pyfolk激活 / Activatingpyfolk使用前需要使用激活工具进行激活。请联系作者，获得对应的激活工具与相关文档。Pyfolk needs to be activated initially. Please contact with the author to get activator and related documents.查看版本 / Checking version在控制终端执行pip list 进行查看Input "pip list" in powershell(cmd.exe) to get pyfolk's verison在程序中执行Using the following code.import pyfolk
ver = pyfolk.get_version()
print(ver)使用 / Usage使用以下代码获取一个UserApi实例后，可以通过UserApi所提供的接口对folk无人机进行控制。接口说明请查看doc/html/中文/index.html文件。Use the following codes to create a userApi instance. Its interfaces can be used to control folk plane. Go to doc/html/English/index.html to see the interface specification.import pyfolk
api = pyfolk.UserApi()更新说明 / Updatev 1.0.0首发版本First version提供遥控器模式和舞步模式飞行控制接口，共44个Provide flying control interfaces, a total of 44提供灯光控制接口，共5个Provide light control interfaces, a total of 5提供摄像头控制接口，共4个Provide camera control interfaces, a total of 4提供视频流控制接口，共21个Provide video streaming control interfaces, a total of 21提供目标识别、二维码识别、手势识别、跟踪等AI功能接口，共6个Provide target detection, QR detection, gesture detection, tarck interfaces, a total of 6提供飞机状态的获取接口，共7个Provide equipment status getting interfaces, a total of 7提供设备创建、连接、系统设置等接口，共10个Provide equipment creation, equipment connection, system config interfaces, a total of 10可使用pip进行包管理Pip can be used to manage lib packages支持python3所有版本Support all python3 versions提供中英双语言版本的文档Provide Chinese/English documents使用FolkTools.exe进行激活和版本更新Use FolkTools to activate pyfolk and download pyfolk's documents
Package: pyfollower
Follower Crowd SimulationFollower Crowd Simulation (Follower) is a project that simulates the movement of a crowd of comformists with self-organizing characteristic. InFollower,ORCAis adapted as the basic collision avoidance model. This project is writen in C++ and built using CMake.pyfolloweris the python interfaces forFollowerwith many easy-to-use APIs.Getting startedTo get started with Follower Crowd Simulation, you'll need to have Python 3.6+ installed on your system. You can download Python from theofficial website, and Follower Crowd Simulation can be installed using pip:pipinstallpyfollowerThe installation process of this project requires Cmake and C++ compilation environment, so if you are a Windows user, it is a better choice to use acompiled wheel filepipinstallpyfollower-xxx.whlAfter you have installed it, you can simply use this simulation Engine. As an example(Please make sure the numpy and matplotlib is installed):importnumpyasnpfrompyfollowerimportFollowerEngine# Initial scenariodest=dict()N=50sim=FollowerEngine(agent_radius=0.5)foridx,iinenumerate(np.linspace(0,1,N+1)):ifi==1:breaktheta=i*np.pi*2ox,oy=np.cos(theta),np.sin(theta)dx,dy=np.cos(theta+np.pi),np.sin(theta+np.pi)t=np.array([ox,oy,dx,dy])*20agent_id=sim.add_agent(*t)dest[agent_id]=t[-2:]# Test obstaclessim.add_obstacles([(5,5),(-5,5),(-5,-5),(5,-5)])sim.process_obstacles()obs=np.array([(-5,-5),(-5,5),(5,5),(5,-5),(-5,-5)])# Run simulation --- Main looptraj=[]foriinrange(100):ifnoti%10:print(sim.time)x=sim.get_agent_positions()foragent_idinrange(N):dx=dest[agent_id]-x[agent_id,:]dist=np.sqrt(np.sum(dx**2))ifdist<0.5:prev=(0,0)else:prev=1.3*dx/distsim.set_agent_pref(agent_id,*prev)traj.append(x)print(x.T)sim.follower_step()# Plotimportpylabaspltraj=np.stack(traj)pl.xlim(-20,20)pl.ylim(-20,20)pl.imshow(np.zeros((40,40),float),extent=(-20,20,-20,20))importmatplotlib.cmascmcolors=cm.hsv(np.linspace(0,1,N))foriinrange(N):pl.plot(traj[:,i,0],traj[:,i,1],c=colors[i])pl.scatter(*x.T,c=range(N),s=20,cmap='hsv')pl.plot(obs[:,0],obs[:,1],c='white')pl.show()ContributingIf you'd like to contribute to Follower Crowd Simulation, feel free to submit a pull request. Please make sure that your code follows thePEP 8style guide and that any new features are thoroughly tested.
Package: pyfomo
OverviewFomo is aFairnessOrientedMultiobjectiveOptimization toolbox for training regression and classification models.
Fomo focuses on optimizing the trade-offs between various metrics in ML fairness that are often in direct conflict.
The goal is to assist decision makers in weighing multiple criteria by generating good solutionsets, rather than singular models.CiteIf you use Fomo please cite the following:W.G. La Cava (2023). Optimizing fairness tradeoffs in machine learning with multiobjective meta-models. GECCO '23.arXiv:2304.12190IntroductionFomo is designed to be incrediblygeneral.
It works with any ML model that has ascikit-learninterface (i.e.fit()andpredict()methods) and takes sample weights as part of its loss function.
Specifically, thefit()method should optionally take an argument,sample_weight, that provides a weight to each observation inX,y.
That covers nearly all estimators insklearn, including linear models  (linear and logistic regression, lasso), SVMs, neural nets, decision trees, and ensemble methods like random forests, gradient boosting, and XGBoost.In addition, Fomo works with many differentmetricsof fairness and accuracy.
It currently supports:Subgroup Fairness (False Positive, False Negative, and Demographic Parity)Differential Fairness (Demographic Parity and Calibration)MulticalibrationProportional MulticalibrationIn addition, users can specify any callable function they would like to be optimized, as long as it matches the call signature of these functions.
Users can specify the combination of performance metrics and fairness metrics that best suit the task they are studying.
You can specify any number and combinatoin of these metrics.Finally, Fomo works with many differentoptimizationmethods available frompymoo, including NSGA-II, NSGA-III, MOEAD, and others.Quick StartInstallationpip install pyfomoDependenciesThe requirements forfomoare listed inenvironment.yml.Note on pymooIf you are working in linux and get a warning about pymoo, is recommended that you manually install it from the github repo rather than pip:gitclonehttps://github.com/anyoptimization/pymoocdpymoo
makecompile
pipinstall.DevelopmentTo install a development version, do the following:gitclonehttps://github.com/cavalab/fomocdfomo
pipinstall.Basic UsageHere is an example of training a fair classifier on the adult income prediction dataset.fromfomoimportFomoClassifierfrompmlbimportpmlbX,y=pmlb.fetch_data('adult',return_X_y=True)groups=['race','sex']est=FomoClassifier()est.fit(X,y,protected_features=groups)LicenseSeeLICENSE.ContactWilliam La Cava: william dot lacava at childrens dot harvard dot edu
Package: pyfomod
pyfomodA high-level fomod library written in Python.:warning:Note: This is a mature library with all planned features added and no known bugs - do not be alarmed by the lack of commits.pyfomodmakes it easy to work on fomod installers:Pythonic data strutureEasy data extraction and modificationNo need to deal with complex xml schemas or trial and error changespyfomodautomatically ignores any schema errors in an installer and corrects them
when writing - you can fix most schema errors simply by parsing then writing the
installer withpyfomod.InstallationTo installpyfomod, use pip:pip install pyfomodQuick ExamplesUse an existing installer:>>>root=pyfomod.parse("path/to/package")Get the installer metadata::>>>root.name'Example Name'>>>root.author'Example Author'>>>root.description'This is an example of metadata!'>>>root.version'1.0.0'>>>root.website'https://www.nexusmods.com/example/mods/1337'Create a new installer:>>>root=pyfomod.Root()Save the installer:>>>pyfomod.write(root,"path/to/package")DocumentationFor more information check outpyfomod's documentation atpyfomod.rtfd.ioIssuesPlease use theGitHub issue trackerto submit bugs or request features.What Is Fomod Anyway?Fomod is a package format for mod installers. It's game-agnostic, meaning it
works on any game. It follows a specific package struture with a mandatory
xml file in a subfolder that follows a specific xml schema and an optional
xml file that does not. For more information visit thefomod documentation.Developmentpyfomoduses poetry to manage package versions:path/to/python.exe -m pip install poetry
path/to/python.exe -m poetry installEnsure that everything is correct before committing:path/to/python.exe -m poetry run check
path/to/python.exe -m poetry run testWhen you're done with a feature/fix, bump the version:path/to/python.exe -m poetry run bump2version {major|minor|patch}To finally publish to PYPI:path/to/python.exe -m poetry publish --build -u $PYPI_USER -p $PYPI_PASS
Package: pyfongo
pyfongopyfongo is an in-process library that implements a self-contained, serverless, zero-configuration, mongodb database engine with pymongo's interface.Inspired by pymongo and sqlite.Written for Python 3.6.When to useunit testing of apps that use mongodbstand-in for mongodb during demos and testingas application file formatdata analysis using mongodb queriestemporary database for reorganizing datain embedded systemsExamples>>> import pyfongo
>>> cx = pyfongo.FongoClient('/path/to/datadir')
>>> db = cx.test
>>> db.my_collection.insert_one({'x': 10}).inserted_id
ObjectId('5aded7ff7aea217b9056e9d0')
>>> db.my_collection.insert_one({'x': 12}).inserted_id
ObjectId('5aded8467aea217b9056e9d1')
>>> db.my_collection.find_one()
{'x': 10, '_id': ObjectId('5aded7ff7aea217b9056e9d0')}
>>> for item in db.my_collection.find().sort('x', -1):
...     print(item['x'])
...
12
10TestingThe same tests are run against both pyfongo and a local mongodb server
using pymongo to ensure that pyfongo mimics mongodb/pymongo's behavior correctly.Run the tests with:pipenv run pytest -svNote that you will need to runpipenv install --devonce before you can
run the tests.
Package: pyfont
Documentation生成文字图片：在一定的区域，支持换行，丢弃，缩小来完成适应区域
The documentation is hosted athttps://github.com/BingerYang/pyfontInstallationpipinstallpyfontUsageexample:
1. write 通过控制 limit_width, limit_count 与 传入回调返回，决定是否保留换行，或者截断丢弃# -*- coding: utf-8 -*-
from pyfont import FontAttr, FontDraw
from PIL import Image

image = Image.new('RGBA', (int(400), int(400)), (1, 1, 1, 0))
path = 'C:\Windows\Fonts\simsun.ttc'
font = FontAttr(path=path, size=20, limit_width=220, fill_color=(1, 1, 1, 255))
# obj = FontDraw(bg=image, font=font)
obj = FontDraw(font=font)

# 通过控制 limit_width，limit_count 与 传入回调返回，决定是否换行，或者丢弃
# limit_text_cb=None 不处理（超过）
# limit_text_cb 返回值False丢弃多余，返回True（保留换行）
def limit_text_cb(index, line, state):
    print('index:', index, line[index:], state)
    return True


result = obj.write(text="我们是中国人，我爱我的祖国\n你好", limit_text_cb=limit_text_cb)
img = result.img
print(img.size)
img.show()
print(font.size, font.line_height)通过 limit_width, limit_height 适当的缩小字体范围，以适应区域from pyfont import FontAttr, FontDraw
from PIL import Image

image = Image.new('RGBA', (int(400), int(400)), (1, 1, 1, 0))
path = 'C:\Windows\Fonts\simsun.ttc'
font = FontAttr(path=path, size=20, limit_width=220, fill_color=(1, 1, 1, 255))
# obj = FontDraw(bg=image, font=font)
obj = FontDraw(font=font)

text="我们是中国人，我爱我的祖国\n你好"
size = obj.get_size_at_limit_range(text, font.size)
font.size = size
result = obj.write(text=text)
print(result.offset, result.lines)
img = result.img
print(img.size)
img.show()
Package: pyfony
Pyfony frameworkPyfony is aDependency Injection (DI) powered frameworkwritten in Python greatly inspired by theSymfony Frameworkin PHP &Spring Frameworkin Java.The DI functionality is provided by theInjecta Dependency Injection Container.Pyfony =Injecta + bundles (extensions) APIInstallation$ pip install pyfonyPyfony initialization(The following steps are covered in theBaseKernelTest)To start using Pyfony, create a simpleconfig_dev.yamlfile to define your DI services:parameters:api:endpoint:'https://api.mycompany.com'services:mycompany.api.ApiClient:arguments:-'@mycompany.api.Authenticator'mycompany.api.Authenticator:class:mycompany.authenticator.RestAuthenticatorarguments:-'%api.endpoint%'-'%env(API_TOKEN)%'Then, initialize the container:frominjecta.config.YamlConfigReaderimportYamlConfigReaderfrompyfony.kernel.BaseKernelimportBaseKernelappEnv='dev'kernel=BaseKernel(appEnv,'/config/dir/path',# must be directory, not the config_dev.yaml file path!YamlConfigReader())container=kernel.initContainer()Usecontainer.get()to finally retrieve your service:frommycompany.api.ApiClientimportApiClientapiClient=container.get('mycompany.api.ApiClient')# type: ApiClientapiClient.get('/foo/bar')Advanced examplesAdvanced services configuration using InjectaExtending Pyfony with bundles
Package: pyfoobar2k
A Python library to controlfoobar2000media player viafoo_httpcontrolplugin (by oblikoamorale)Currently only some of foo_httpcontrol functions are implemented:Some basic playback commandsFetching track info and  album art from playerFetching playlistsfoobar2000 Setup and Requirements:foobar2000 version >= 1.1Install foo_httpcontrolplugin(by oblikoamorale) (tested on version 0.97.17)Import foo_httpcontrol template from this projectTemplate Installation:Copytemplate/directory content from this project intofoo_httpcontrol_data/directory of foobar2000.foobar2000 standard installation: usually goes into%APPDATA%\foobar2000\foo_httpcontrol_data\pyfoobar2kfoobar2000 portable installation: usually goes into<foobar2000_root_dir>\foo_httpcontrol_data\pyfoobar2kA successful installation of the template can be verified athttp://<player_ip_address>:8888/pyfoobar2kIf you like this projectBuy Me A Beer?
Package: pyfoobot
A Python wrapper for theFooBot API. It allows you to pull data from yourFoobot device.Installationpip install pyfootbotExamplefrom pyfoobot import Foobot

fb = Foobot("API secret key", "username", "password")
devices = fb.devices()

# Devices is a list, in case you have more than one foobot
device = devices[0]

# Get the most recent sample
latest_data = device.latest()

# Get data from the last hour
last_hour_data = device.data_period(3600, 0)

# Get data for a data range
range_data = device.data_range(start='2016-04-12T11:00:00',
                               end='2016-04-12T12:00:00',
                               sampling=0)
Package: pyfood
Pyfood is a simple Python package to process food, in different languages. Pyfood's ambition is to be the go-to library to deal with food, recipes, online menus or cookbooks.InstallationPyfood is intended to work withPython 3.6 or above. Installation can be done withpip:pipinstallpyfoodQuickstartAt the core of Pyfood is the concept of ashelfembedded in a givenregion, a certainmonth_idand optionally asourcelanguage.
You can load a shelf embedded in France in January with the following Python snippet:frompyfood.utilsimportShelfshelf=Shelf(region='France',month_id=0)Pyfood works in the following region by defaultEU(Europe), which includesFrance,Germany,Italy,Portugal,Spain,United Kingdom. Support forCanada,Israel,JapanandSenegalis also provided🍐 Label baskets or recipesIn a few lines of code, Pyfood can help automaticallyextract, translate, labela list of ingredients, e.g., from a basket of food,a recipe, a menu,a cookbookor a webapp, with multiple labels, e.g., vegetarian, vegan, nutrition and seasonality:results=shelf.process_ingredients(['apple','kiwi','sugar'])results['labels']# vegetarian, vegan, nutrition, seasonality🍋 Translate ingredientsPyfood comes with a vocabulary of more than 600 ingredients and synonymes, in multiple languages, and makes it easy to work with recipes in different languages or translate ingredients from a language to another one:results=shelf.process_ingredients(['apple','kiwi','sugar'],lang_dest='FR')results['ingredients_by_taxon']# [[pomme, kiwi], [sucre]]Pyfood supports the following language by defaultUN(Universal), which includesDE(German),EN(English),ES(Spanish).FR(French),IT(Italian),PT(Portuguese)🍓 What's in season?Finally, Pyfood can also be used to simply query whatfruitsorvegetablesare in season:fruits_in_season=shelf.get_seasonal_food(key='001')vegetables_in_season=shelf.get_seasonal_food(key='002')Credits📊CIQUAL ANSES📷PexelsandUnsplashUseful links🛠️Documentation🐛Issue tracker🍕Package releasesLicenseThis work is licensed under aCreative Commons Attribution 4.0 International LicensebyLocal Seasonal
Package: pyfoot
pyfootPyfoot is a high-level library for writing simple 2d games.
It is based upon the Python librarypygameand was inspired by the java libaryGreenfoot.InstallingSimply pip install the librarypip install pyfootYou can create a sample project via the command linepython -m pyfoot init ProjectNameLicenseThis project is licensed under the GNU License - see theLICENSE.mdfile for details
Package: pyfootball
pyfootball is a client library forfootball-data.orgwritten in Python.You can familiarize yourself with pyfootball’s API with thedocumentation.RequirementsA valid API key for football-data. You can request for one athttp://api.football-data.org/register.Python 3.5+Therequestslibrary. pip should handle this for you when installing pyfootball.Installationpip install pyfootballExample Usage>>> import pyfootball
>>> f = pyfootball.Football(api_key='your_api_key')
>>> bayern = f.get_team(5)
>>> bayern.market_value
582,225,000 €SupportIf you encounter any bugs, please let me know bycreating an issueor tweeting at me@timorthi.ContributingPlease see the repository’sCONTRIBUTINGfile.LicenseThe project is licensed under the MIT license.
Package: py-football
py-football library for Roanuz Football APIIts a python library to get football scores,schedule and statistics from [Roanuz Football](https://www.footballapi.com).Itseasy to access with the access key,secret key and app id.Changes List:1.0.4:1.Updated urllib3 version to fix the warnings in Python 3.101.0.3:Supported Fantasy APIs for Football1.0.2:Fixed Bugs1.0.1:Fixed Bugs1.0.0:Initial ReleaseGetting started:Install py-football usingpip install py-footballCreate a Football API App here [My APP Login](https://www.footballapi.com/login/?next=/apps/)Import py-cricket and create Authentication using ‘RcaFileStorageHandler’ or ‘RcaStorageHandler’ approach.To check all our API’s please visit :https://github.com/roanuz/py-football
Package: pyfootballdata
pyfootballdataA Python client forfootball-data.orgAPI.InstallationpipinstallpyfootballdataUsage# Step 1: import the packagefrompyfootballdataimportFootballData# Step 2: initialize the client (can be `async`)fd=FootballData('YOUR_API_KEY')# Step 3: query the data# (e.g. standings for EPL circa 2021)epl_standings=fd.standings(competition=2021,season=2021)sorted_by_goals_conceded=epl_standings.overall.sort_by(key="goals_against",direction="desc")worst_defense=sorted_by_goals_conceded[0]print(worst_defense.team.name,worst_defense.goals_against)# Norwich City FC 84DocumentationTBAExamplesTBA
Package: pyfop
Implementsforward-oriented programmingin Python. This shares configuration arguments across multiple components
and determines their valuesafterthe main business logic.Dependencies:makefunDeveloper:Emmanouil (Manios) KrasanakisContant:maniospas@hotmail.comFeaturesAdapt arguments to usage contextArgument sharing between methodsSpeed up library developmentEasy adoption with decoratorsQuickstartEnable lazy execution and automatically annotate arguments with defaults as aspects:frompyfopimportlazy,autoaspects@lazy@autoaspectsdefaffine(x,scale=1,offset=0):returnx*scale+offsetProduce results with python code:GM=(affine(2)*affine(8))**0.5Set aspect values of previous code:print(GM(scale=3))# 12Advanced featuresInternal call of lazy methods while exposing their aspects.@lazy@autoaspectsdefgm(x,y,affine=affine):# pass the method as an argumentreturn(affine(x)*affine(y))**0.5GM=gm(2,8)print(GM(scale=3))# 12Print list of aspects.print(GM.get_input_context(scale=3))# context:#	- scale:#		 value: 3,#		 priority: Priority.HIGH#		 shares: 1#	- offset:#		 value: 1,#		 priority: Priority.INCREASED#		 shares: 4Aspects are shared between everything contributing to the result.@lazy@autoaspectsdefsquare(x,scale=1):returnscale*x*xprint(affine(2)(scale=2))# 4print((affine(2)+square(1))(scale=2))# 5Priority-based selection between defaults.@lazydeflogpp(x,offset=Aspect(1,Priority.INCREASED)):importmathreturnmath.log(x+offset)/math.log(2)result=affine(2)+log(3)print(result(scale=2))# 5+2=7Toggle caching.@lazy# automatically performs cachingdefinc(x):print("running")returnx+1print(inc(2)())# running# 3print(inc(2)())# 3print(inc(3)())# running# 4@lazy_no_cache# disables cachingdefinc(x):print("running")returnx+1print(inc(2)())# running# 3print(inc(2)())# running# 3print(inc(3)())# running# 4BadgeShow usage of pyfop in your projects by adding the following badge to your README.md file:[![pyfop](https://img.shields.io/badge/pyfop-v0.3.4-blue)](https://github.com/maniospas/pyfop)This will display the following:
Package: pyforbes
PyForbes - Python wrapper for Forbes APIPyCalendlyWelcome to the GitHub repository ofPyForbesPyForbesis an unofficial Python wrapper for Forbes API.PyForbes allows developers to analyze Forbes data or build web application with Forbes data.PyForbes provides ease of access to developers and data scientists by providing python interface to directly get the Forbes data as aPandas.DataFrameor JSON Dictionary.A Simple PyForbes application typically looks like thisfrompyforbesimportForbesListflist=ForbesList()# Get ForbesList data as a JSONbillionaires_json=flist.get_json('billionaires',year=2020)# Get ForbesList data as a DataFramebillionaires_df=flist.get_df('billionaires',year=2020)# 30Under30 - Social Media Influencerssocial_media_30=flist.get_df('30under30-social-media',year=2020)In order to make the most out of PyForbes, you should start
with thePyForbes Documentation: Examplesthat will lead you through the most common aspects of the package.DocumentationRefer the documentation, examples and other instructions here:PyForbes DocumentationContributingPlease refer theContribution Guidelines.