Saravanan666/pypi-org huggingface dataset:
Package: fastly-client
The Fastly API client (api.fastly.com) that supports billing and stats.Developed using marshmallow (for serialization) and requests (for REST API calls).Exampleimport fastly_client

client = fastly_client.Client('your-api-token')
period = fastly_client.period(2017, 12, months=1)

try:
    bill = client.bill(period)
    regions = client.regions(period)
    services = client.services()
    stats = client.service_stats(period, services[0].id, regions[0])
except fastly_client.FastlyException:
    print("An error occurred")
    raise
Package: fastlz5
FastLZPython wrapper for FastLZ_, a lightning-fast lossless compression library.Example:from fastlz5 import compress, decompress
s = decompress(compress("hello there world", level=1))
assert(s == "hello there world")Example:import os
import sys
import argparse

try:
    from fastlz5 import compress, decompress
except ModuleNotFoundError:
    sys.stderr.write(
        'fastlz lib not found, please install it with "python -m pip install fastlz5"')
    sys.exit(1)

# Breaks an array into chunks of n length each.
def chunks(l, n):    
    for i in range(0, len(l), n):
        yield l[i:i + n]

def bytes_to_c_array(bytes, variable_name):
    output_c_array = (
        "#include <stdint.h>\n" +
        f"extern const uint8_t {variable_name}[{len(bytes)}] = " + "{\n"
    )
    for byte_block in chunks(bytes, 64):
        output_c_array += '  '
        for byte in byte_block:
            output_c_array += f'{byte},'
        output_c_array += '\n'
    output_c_array += "};\n"
    return output_c_array

def main():
    parser = argparse.ArgumentParser(description='Prepare data file for teensy by compressing it and outputting a c-array')
    parser.add_argument('--input', help='Input file', required=True)
    parser.add_argument('--output', help='Output file, otherwise stream to stdout', required=False)
    parser.add_argument('--variable-name', help='Name for the variable of c_array', required=False)
    parser.add_argument('--no-compress', help='Disable FastLZ compression to file', action='store_true')

    args = parser.parse_args()
    if not os.path.exists(args.input):
        sys.stderr.write(f'File {args.input} does not exist.\n')
        sys.exit(1)

    with open(args.input, "rb") as fd:
        file_input_bytes = fd.read()

    if not args.no_compress:
        file_input_bytes = compress(file_input_bytes, level=1)

    var_name = args.variable_name or "data"
    output_c_array = bytes_to_c_array(file_input_bytes, var_name)

    if args.output:
        with open(args.output, "wt") as fd:
            fd.write(output_c_array)
    else:
        sys.stdout.write(f"{output_c_array}\n")

if __name__ == '__main__':
    main()
Package: fast-mail-parser
fast_mail_parserfast_mail_parser is a Python library for .eml files parsing.
The main benefit is a performance: the library is much faster than python implementations.Based onmailparselibrary usingpyo3.Benchmark-------------------------------------------------------------------------------------------- benchmark: 2 tests -------------------------------------------------------------------------------------------
Name (time in ms)                              Min                Max               Mean            StdDev             Median               IQR            Outliers       OPS            Rounds  Iterations
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test__fast_mail_parser___parse_message      1.8136 (1.0)       1.8938 (1.0)       1.8426 (1.0)      0.0176 (1.0)       1.8465 (1.0)      0.0277 (1.0)         180;0  542.7141 (1.0)         450           1
test__mail_parser___parse_message          14.5583 (8.03)     15.8571 (8.37)     15.0264 (8.16)     0.2368 (13.49)    14.9702 (8.11)     0.2887 (10.42)         5;1   66.5495 (0.12)         32           1
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Legend:
  Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.
  OPS: Operations Per Second, computed as 1 / MeanInstallationUse the package managerpipto install fast_mail_parser.pipinstallfast-mail-parserUsageimportsysfromfast_mail_parserimportparse_email,ParseErrorwithopen('message.eml','r')asf:message_payload=f.read()try:email=parse_email(message_payload)exceptParseErrorase:print("Failed to parse email: ",e)sys.exit(1)print(email.subject)print(email.date)print(email.text_plain)print(email.text_html)print(email.headers)forattachmentinemail.attachments:print(attachment.mimetype)print(attachment.content)print(attachment.filename)ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.
Package: fastmap
Note: Fastmap is currently in beta.Fastmap offloads and parallelizes arbitrary Python functions on the cloud.🌤  Offload anythingFastmap is the easiest way to offload Python code. Use fastmap.offload wherever you would might have needed an EC2.🔗  Parallelize in one lineWith Fastmap, you can parallelize any Python function across as many workers as it takes. Use fastmap.map wherever you might have needed a Lambda.🚀  Deploy in minutesFastmap comes with an open-source cloud service. With a Google Cloud Platform account, you can setup and deploy fastmap with one command.** 🛀  Built for productivity** Fastmap is designed to eliminate infrastructure and speed up your work. Spend your time writing code - not fighting infrastructure.Fastmap is in active development. For more information, seehttps://fastmap.io.
Package: fastMapper
## Introducea random map generation tool,  can generate new random map by using the existing maprow map![row map](https://img-blog.csdnimg.cn/20200513194736208.jpg)result![result](https://img-blog.csdnimg.cn/2020051319520156.jpg)## How to usefirst download project and unzip
cd ./fastMapperwith pythonpython3 setup.py install
python3 ./script demo.pywith cppcd script
./demo.shwith lua./script/to_lua.lua## What to do next ?it not only support bitmap . it will support vector map like svg . i am doing this!## How it work ?![pic](https://img-blog.csdnimg.cn/20200514150849493.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM4ODcxMTcz,size_16,color_FFFFFF,t_70)## reference
-https://github.com/mxgmn/aveunctionollapse
Package: fast-marching-square
Fast Marching SquareTheFast Marching Square (FM2) methodis a path planning algorithm which is a variation of theoriginal Fast Marching Method, which it is based on the idea of guiding the desired path by following light propagation. The path that light follows is always the fastest feasible one, so the proposed planning method ensures the calculation of the path of least possible time. Since the method is based on wave propagation, if there is a feasible solution, it is always found, so it is complete.This implementation of the Fast Marching Squared method is based on theMirebeau implementation, so feel free to visit the repository.InstallationFollow the next steps for installing the simulation on your device.Requirements:Python 3.10.0 or higherInstall miniconda (highly-recommended)It is highly recommended to install all the dependencies on a new virtual environment. For more information check the conda documentation forinstallationandenvironment management. For creating the environment use the following commands on the terminal.condacreate-nfm2python==3.10.9
condaactivatefm2Install from pipThe ADAM simulator is available as a pip package. For installing it just use:pip install fast-marching-squareInstall from sourceFirstly, clone the repository in your system.gitclonehttps://github.com/vistormu/fast_marching_square.gitThen, enter the directory and install the required dependenciescdfast_marching_square
pipinstall-rrequirements.txtDocumentationThe official documentation of the package is available onRead the Docs. Here you will find theinstallation instructions, theAPI referenceand someminimal working examples.
Package: fastmask
fastmaskPython library and command line tool for Fastmail's Masked EmailInstall & SetuppipinstallfastmaskexportFM_ME_TOKEN='YOUR-API-TOKEN-HERE'exportFM_USERNAME='user@domain.com'Usagefastmask [OPTIONS] COMMAND [ARGS]...

  Manage Fastmail masked email from the command line

Options:
  --username TEXT  [default: (FM_USERNAME)]
  --token TEXT     [default: (FM_ME_TOKEN)]
  --help           Show this message and exit.

Commands:
  activate  Set state of masked email to Active
  block     Set state of masked email to Blocked
  delete    Delete masked email
  edit      Edit information associated with a masked email
  list      List masked emails associated with account
  new       Create a new masked email
  search    Search for masked emailsSee full CLI and library documentation athttps://fastmask.readthedocs.io/
Package: fastmath
FastMathA Soon To Be The Best Math Library In PythonExplore the docs »View Example·Report Bug·Request Feature·Send a Pull RequestTable of ContentsTable of ContentsPrerequisitesInstallationUsageToDoContributingPrerequisitesNumpyInstallationpip3 install fastmathUsageTo add numbers do:add(1, 2)This is the same as 1 + 2To subtract do:sub(2, 3)This is the same as 2 - 3To multiply do:mul(2, 2)This is the same as 2 * 2To divide do:div(4, 2)This is the same as 4 / 2To caculate the area of a circle do:circle_area(5)This is the same as 5^2 * 3.14To use the quadratic formula do:qudratic(6, 17, 12)This is the same as (-17 (+ or -) sqrt(17^2 - 4 * 6 * 12)) / 2 * 6To do factorial:fac(2)This is the same as !2To do natural logarithm:ln(2)To do square root:sqrt(4)This is the same as √4To do sine:sin(45)To do cosine:cos(45)To do tangent:tan(45)To do cotangent:cot(45)To do cosecant:csc(45)To do secant:sec(45)ToDoAdd More Math FormulasMake code fasterContributingContributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make areextremely appreciated.Fork the ProjectCreate your Feature Branch (git checkout -b feature/AmazingFeature)Commit your Changes (git commit -m 'Add some AmazingFeature')Push to the Branch (git push origin feature/AmazingFeature)Open a Pull Request
Package: fast-mda-traceroute
fast-mda-traceroutefast-mda-tracerouteis an experimental multipath traceroute tool based oncaracalanddiamond-miner. It aims to provide a faster alternative toparis-tracerouteandscamperfor running one-off measurements. It runs on Linux and macOS, on x86-64 and ARM64 systems.🚧 This tool is highly experimental, may not always work, and its interface is subject to change from one commit to
another.QuickstartDockerdockerrunghcr.io/dioptra-io/fast-mda-traceroute--helpThelatesttag maps to the latest tagged commit and themaintag maps to the latest commit on themainbranch.PythonYou can use pip, orpipxto installfast-mda-traceroutein a dedicated virtual environment:pipxinstallfast-mda-traceroute
fast-mda-traceroute--helpUsage# Show helpfast-mda-traceroute--help# Multipath traceroute towards example.org with default optionsfast-mda-tracerouteexample.org# Print paris-traceroute equivalent commandfast-mda-traceroute--print-command=paris-tracerouteexample.org# Print scamper equivalent commandfast-mda-traceroute--print-command=scamperexample.orgfast-mda-tracerouteoutputs log messages tostderrand measurement results tostdout.Developmentpoetryinstall
poetryrunfast-mda-traceroute--helpdockerbuild-tfast-mda-traceroute.
dockerrunfast-mda-traceroute--help
Package: fastmessage
FastMessageFastMessage is an easy framework to create PipelineHandlers forMessageFluxYou can find the full documentationhereRequirementsPython 3.7+Installation$pipinstallfastmessageExamplesfromfastmessageimportFastMessage,OtherMethodOutputfrommessageflux.iodevices.rabbitmqimportRabbitMQInputDeviceManager,RabbitMQOutputDeviceManagerfm=FastMessage()@fm.map()defhello(name:str,birthYear:int):age=2023-birthYearprint(f'Hello{name}. your age is{age}')returnOtherMethodOutput(next_year,age=age)# this sends its output to 'next_year' method@fm.map()defnext_year(age:int):print(f'next year you will be{age+1}')if__name__=="__main__":input_device_manager=RabbitMQInputDeviceManager(hosts='my.rabbit.host',user='username',password='password')output_device_manager=RabbitMQOutputDeviceManager(hosts='my.rabbit.host',user='username',password='password')service=fm.create_service(input_device_manager=input_device_manager,output_device_manager=output_device_manager)service.start()# this runs the PipelineService and blocksThis example shows two methods:helloandnext_year, each listening on its own queue
(with the same name)the__main__creates an input and output device managers (RabbitMQin this case), and starts the service
with these devices.every message that is sent to thehelloqueue should have the following format:{"name":"john","birthYear":1999}in that case the process will print (in 2023...):Hello john. your age is 24
next year you will be 25
Package: fastmeteo
Fast MeteoA super-fast Python package to obtain meteorological parameters for your flight trajectories.Installstable versionpip install fastmeteodevelopment versionpip install git+https://github.com/junzis/fastmeteoor, if you preferpoetry:git clone https://github.com/junzis/fastmeteo
cd fastmeteo
poetry installUsageLocal modeYou can get the weather information for a given flight or position with the following code. Basic information on time, latitude, longitude, and altitude is needed.importpandasaspdfromfastmeteoimportGridflight=pd.DataFrame({"timestamp":["2021-10-12T01:10:00","2021-10-12T01:20:00"],"latitude":[40.3,42.5],"longitude":[4.2,6.6],"altitude":[25_000,30_000],})# define the location for local storefmg=Grid(local_store="/tmp/era5-zarr")# obtain weather informationflight_new=fmg.interpolate(flight)Server-client modeWhen running the tool in a server-client mode. The following script can be used to start a FastAPI service on the server. It handles the flight date request and obtains Google ARCO data if the partition is not on the server. After that, it will perform the interpolation of weather data and return the final data to the client.fastmeteo-serve --local-store /tmp/era5-zarrAt the client side, the following code can be used to submit and get the process flight with meteorology data.importpandasaspdfromfastmeteoimportClientflight=pd.DataFrame({"timestamp":["2021-10-12T01:10:00","2021-10-12T01:20:00"],"latitude":[40.3,42.5],"longitude":[4.2,6.6],"altitude":[25_000,30_000],})# define the client objectclient=Client()# send the flight and receive the new DataFrameflight_new=client.submit_flight(flight)
Package: fastmetrics
Fast MetricsThis project provides a set of faster alternatives to some of the methods in sklearn.metrics. If you use any of the classification metrics supported by this package, you will see a vast improvement in the runtime of your code, up to 100x depending on the function used and the size of the data set. Speedups were achieved by using Numba to vectorize the generation of confusion matrices.Fast Metrics supports the following metrics:Accuracy ScoreBalanced Accuracy ScoreF1 ScorePrecisionRecallJaccard ScoreROC AUCInstallationRun the following to install:pipinstallfastmetricsUsageUse Fast Metrics the same way you would use sklearn.metrics. Feed the methods a NumPy array of true results and a NumPy array of predictions, and they will return their respective metric. For instance:fastmetrics.fast_accuracy_score(y_true,y_pred)fastmetrics.fast_balanced_accuracy_score(y_true,y_pred)fastmetrics.fast_f1_score(y_true,y_pred)Additional Notes:Unlike sklearn, Fast Metrics methods do not have additional optional arguments beyond y_true and y_pred.The first time you run a Fast Metrics function, it will be slower than its sklearn counterpart because the vectorized confusion matrix code needs time to compile.
Package: fastmicro
FastMicroFast, simple microservice frameworkFastMicro is a modern, fast (high-performance) framework for building microservices with Python 3.7+ based on asyncio.InstallTo install FastMicro run the following:$pipinstallfastmicro[redis]ExampleThis example shows how to use the default in-memory backend for evaluation and testing.Note:The in-memory backend cannot be used for inter-process communication.Create itCreate a filehello.pywith:#!/usr/bin/env python3importasynciofrompydanticimportBaseModelfromfastmicro.messaging.memoryimportMessagingfromfastmicro.serviceimportServiceclassUser(BaseModel):name:strclassGreeting(BaseModel):name:strgreeting:strservice=Service("test")loop=asyncio.get_event_loop()messaging=Messaging(loop=loop)user_topic=messaging.topic("user",User)greeting_topic=messaging.topic("greeting",Greeting)@service.entrypoint(user_topic,greeting_topic)asyncdefgreet(user:User)->Greeting:greeting=Greeting(name=user.name,greeting=f"Hello,{user.name}!")returngreetingasyncdefmain()->None:awaitservice.start()asyncwithmessaging:user=User(name="Greg")print(user)greeting=awaitservice.greet(user)print(greeting)awaitservice.stop()if__name__=="__main__":loop.run_until_complete(main())Run it$pythonhello.py{'name': 'Greg'}{'name': 'Greg', 'greeting': 'Hello, Greg!'}BackendsFastMicro supports the following backends:KafkaRedisTo install FastMicro with one of these backends run one of the following:$pipinstallfastmicro[kafka]$pipinstallfastmicro[redis]Another ExampleThis example shows how to use the Redis backend for inter-process communication.Create itCreate a fileexample.pywith:#!/usr/bin/env python3importasynciofrompydanticimportBaseModelfromfastmicro.messaging.redisimportMessagingfromfastmicro.serviceimportServiceclassUser(BaseModel):name:strclassGreeting(BaseModel):name:strgreeting:strservice=Service("test")loop=asyncio.get_event_loop()messaging=Messaging(loop=loop)user_topic=messaging.topic("user",User)greeting_topic=messaging.topic("greeting",Greeting)@service.entrypoint(user_topic,greeting_topic)asyncdefgreet(user:User)->Greeting:print(user)greeting=Greeting(name=user.name,greeting=f"Hello,{user.name}!")print(greeting)returngreetingif__name__=="__main__":service.run()Create a filetest.pywith:#!/usr/bin/env python3importasynciofrompydanticimportBaseModelfromfastmicro.messaging.redisimportMessagingfromfastmicro.serviceimportServiceclassUser(BaseModel):name:strclassGreeting(BaseModel):name:strgreeting:strservice=Service("test")loop=asyncio.get_event_loop()messaging=Messaging(loop=loop)user_topic=messaging.topic("user",User)greeting_topic=messaging.topic("greeting",Greeting)@service.entrypoint(user_topic,greeting_topic)asyncdefgreet(user:User)->Greeting:...asyncdefmain()->None:asyncwithmessaging:user=User(name="Greg")print(user)greeting=awaitservice.greet(user)print(greeting)if__name__=="__main__":loop.run_until_complete(main())Run itIn a terminal run:$pythonexample.py{'name': 'Greg'}{'name': 'Greg', 'greeting': 'Hello, Greg!'}^CIn another terminal run:$pythontest.py{'name': 'Greg'}{'name': 'Greg', 'greeting': 'Hello, Greg!'}LicenseThis project is licensed under the terms of the MIT license.
Package: fast-microservice
fast-microserviceSmall Microservice Abased on FastAPIRequirementsPython 3.6.1 or newerInstallationpipinstallfast-microserviceDevelopmentThis project usespoetryfor packaging and
managing all dependencies andpre-committo runflake8,isort,mypyandblack.Clone this repository and runpoetryinstall
poetryrunpre-commitinstallto create a virtual enviroment containing all dependencies.
Afterwards, You can run the test suite usingpoetryrunpytestThis repository follows theConventional Commitsstyle.
Package: fastml-engine
介绍fastml-engine. 采用GunicornWeb服务框架搭建,以简化模型推理工程部署的工作内容功能特性集成Gunicorn Flask 服务组件,稳定可靠,可用于生产.统一推理服务接口,支持多种接口请求格式(text/json/octet-stream/form-data)搭配inference-template使用,支持自定义模型推理代码支持简便的启动命令安装pip installfastml-engine使用说明下载 inference-template-python代码地址启动服务fastmlserver--help#查看帮助
#service_path参数为inference-template-python目录的绝对路径fastmlserver--service-path/home/<service_path>--host0.0.0.0--port5000#在未声明service-path参数的情况下，则使用当前命令执行路径fastmlserver--host0.0.0.0--port5000#支持定义 model-path参数声明模型存放路径，未声明则默认使用<service-path>/modelfastmlserver--service-path/home/<service_path>--model-path/opt/model--host0.0.0.0--port5000#快速启动，执行如下命令，采用默认参数fastmlserver验证服务a)通过浏览器访问健康检查接口 ip:port/healthb)查看启动日志,日志目录在代码根路径/logs目录下API接口接口说明URI请求协议返回内容健康检查/healthGET｛ status:UP｝推理接口/algo/{endpoint}POST返回预测结果健康检查接口响应报文{"status":"UP"}推理接口响应报文{"status":true,"data":{"k":"v"},"metadata":{"duration":1.65576171875,"content_type":"json"}}测试注意：请求头需要添加Content-Type参数,用来指定请求报文格式Content-Type说明text/plain文本格式application/jsonjson格式application/octet-stream文件multipart/form-dataform-data格式日志运行日志存放在推理引擎根目录logs文件夹下access.log为请求调用日志error-access.log为错误日志app.log为业务日志,使用python logging模块打印
Package: fast-model-server
Fast[API] Model Serverpython服务框架快速开始【安装】pip install fast-model-server -U【概念】server---服务代码库整体框架router---服务中的某个具体应用【自动创建代码库】完成fast-model-server安装后。可以使用python -m fast_model_server.main进行代码库自动构建1、构建整个代码框架python -m fast_model_server.main开发者的邮箱前缀：fubo
需要创建的模块类型[server, router]：server创建服务的路径：/Users/fubo/tmp服务名称：nlp_parse服务Host：0.0.0.0服务端口：8000服务进程数：3成功创建服务是否创建demo router[y/n]：n2、在代码框架中添加新的routerpython -m fast_model_server.main开发者的邮箱前缀：fubo
需要创建的模块类型[server, router]：router创建路由的路径：/Users/fubo/tmp/nlp_parse/routers路由名称：demo./nlp_parse├──init.py├── configs //配置文件夹│   └── config.json├── routers //不同任务的router│   ├──init.py│   └── demo //demo名称的router│       ├──init.py│       ├── common.py  //demo router的数据字段定义│       ├── configs  //demo router的配置文件│       │   └── config.json│       ├── resources  //demo router的资源文件│       │   └── resources.placeholder│       ├── router.py  //demo router的接口定义│       └── service.py  //demo router的业务逻辑实现├── server.py  //服务入口└── start.sh  //服务启动脚本测试如何执行自动化测试如何贡献贡献patch流程及质量要求维护者ownersfubocommittersfubo
Package: fastmodule
FastModuleMini tool to create FastAPI applications with a basic project structure inspired by Nest.jsInstallationCreate a virtual enviroment (Optional)python-mvenvvenvsourcevenv/bin/activate# venv/Scripts/activate on WindowsInstall package (require python ^3.10 version)pipinstallfastmoduleExampleCreate a controller file and add the following code:fromfastmodule.commonimportController,Get,PostfrompydanticimportBaseModelclassUser(BaseModel):id:intname:str@Controller('users')classUserController:@Get('/')deffind_all(self)->str:return'This action returns all users'@Get('/{id}')deffind_one(self,id:int)->str:returnf'This action returns one user with id{id}'@Post('/')defcreate(self,user:User)->str:returnf'This action create a user with data{user}'Add the controller in the main fileAdd in the main file:fromfastmoduleimportFastModule
fromsrc.user_controllerimportUserControllerapp=FastModule()app.include_router(UserController().router)Run the application:uvicornmain:app--port8000Open docs in the browser at localhost:8000/docs: