Saravanan666/pypi-org huggingface dataset:
Package: dez
The dez library includes an asynchronous server benchmarking toolset; advanced, inotify-based static caching; XML and JSON stream parsing; Stomp, OP, HTTP, and WebSocket servers; and WebSocketProxy, which enables web application deployment on existing, unmodified TCP servers without straying from the HTML5 spec. In addition, dez offers a highly sophisticated API for implementing custom protocols, as well as a controller class that simplifies the creation of applications that require multiple servers to run in the same process.
Package: dezimal
Arbitrary precision decimal numbersA module with a simple implementation for arbitrary precision
decimal numbers. The key difference to most otherdecimallibraries is that there is no maximum precision for example
when doing divisions.>>> from dezimal import Dezimal
>>> Dezimal("355") / Dezimal("113")
Dezimal('3.14159292035398230088495575221238938053097345132743362831858407079646017699115044247787610619469026548672566371681')dezimalwill calculate as many digits after the decimal point as
there are, noROUNDING_MODEor whatever needed.If the calculation
would result in a period,dezimaldetects that and stops the calculation
as needed:>>> Dezimal("1") / Dezimal("7")
Dezimal('0.14285714285714285')However, it prints a minimum number of digits, as to display at least
the same precision as a regularfloatwould (a bit more actually).>>> Dezimal("1") / Dezimal("3")
Dezimal('0.33333333333333333')
>>> 1.0 / 3.0
0.3333333333333333These parameters can be controlled by invoking the staticdivmethod inDezimaldirectly:>>> Dezimal.div(Dezimal("1"), Dezimal("3"), minscale=5)
Dezimal('0.33333')Also a maximum precision can be given:>>> Dezimal.div(Dezimal("355"), Dezimal("113"), maxscale=30)
Dezimal('3.141592920353982300884955752212')ConstructionAn instance ofDezimalcan be constructed fromint,float,bool,
or astr. The usual formats like3,3.0,7e1,-7e-9, or+13.03e-3are understood.Supported operationsThe following operations are supported:+ - * / // < <= > >= == !=Why?For fun.
Package: dezmq
dezbee-zmq[de|ez|dz]bee via zmq (zmq.REP)python 3.8 onlySince some of dezmq's dependent packages (notablyfast-scoresetc) arepython 3.8only.Pre-installfasttextpip install fasttext(linux) orpip install fasttext*whl(Windows)pycld2, PyICUe.g.poetry run pip install pycld2-0.41-cp38-cp38-win_amd64.wh PyICU-2.9-cp38-cp38-win_amd64.whlpolyglot fix:poetry run pip install -U git+https://github.com/aboSamoor/polyglot.git@masterorpip install artifects\polyglot-16.7.4.tar.gz(modified cloned polyglot: futures removed from requirements.txt)Or (excerpt fromroutine-tests.yml)-name:Pre-installfastextpycld2pyicurun:|if["$RUNNER_OS"=="Windows"];thenpoetryrunpipinstallhttps://github.com/ffreemt/ezbee/raw/main/data/artifects/fasttext-0.9.2-cp38-cp38-win_amd64.whlpoetryrunpipinstallhttps://github.com/ffreemt/ezbee/raw/main/data/artifects/pycld2-0.41-cp38-cp38-win_amd64.whlpoetryrunpipinstallhttps://github.com/ffreemt/ezbee/raw/main/data/artifects/PyICU-2.8.1-cp38-cp38-win_amd64.whlpoetryrunpipinstallpybind11elsepoetryrunpipinstallfasttextpycld2pyicufipoetryrunpipinstallhttps://github.com/ffreemt/ezbee/raw/main/data/artifects/polyglot-16.7.4.tar.gzshell:bashRefer toworkflows/actionsfor detailed steps.Install itpipinstalldezmq# pip install git+https://github.com/ffreemt/dezbee-zmq# poetry add git+https://github.com/ffreemt/dezbee-zmq# git clone https://github.com/ffreemt/dezbee-zmq && cd dezbee-zmqUse itDEZMQ_HOST (default local) and  DEZMQ_PORT (default 5555)python-mdezmq# docspython-mdezmq--help
Package: dezrest
dezbee-restServe ezbee via FastAPI port 5555 ([de|dz]bee may be supported later)Install it (Python 3.8 only)pipinstalldezrest# pip install git+https://github.com/ffreemt/dezbee-rest# poetry add git+https://github.com/ffreemt/dezbee-rest# git clone https://github.com/ffreemt/dezbee-rest && cd dezbee-restPython virutal environment (Optional)You may wish to create a python virutal environment first, e.g.,mkdir temp-dir && cd temp-dir
py -3.8 -m venv .venv
call .venv\Scripts\activate
pip install dezrestPost- or Pre-install (same as for ezbee)pip install fastext
pip install pyicu==2.8 pycld2
pip install https://github.com/ffreemt/ezbee/raw/main/data/artifects/polyglot-16.7.4.tar.gzIn linux/macos, you may need to run (if the required packages are not already present in the system) something similar toapt install libicu-dev

# or for macos
brew install icu4c
brew link icu4c --force
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"
export LDFLAGS="-L/usr/local/opt/icu4c/lib"
export CPPFLAGS="-I/usr/local/opt/icu4c/include"Refer to thepre-installpart in workflow fileroutine-tests.ymlUse it# sart the server at port 5555 via `uvicorn` with 2 workerspython-mdezrest# ordezrest# or run at external IPpython-mdezrest--host0.0.0.0# or dezrest --host 0.0.0.0# cli helppython-mdezrest--help# ordezrest--help# REST docs (Swagger UI)http://127.0.0.1:5555/docsSample run:$ dezrest
[D 221220 10:48:21 fastlid:34] fetching lid.176.ftz (once only)
[I 221220 10:48:22 fastlid:44] Downloading https://dl.fbaipublicfiles.com/fasttext/supervised-models/lid.176.ftz (need to do this just once)
[I 221220 10:48:27 __main__:204]  pid: C:\mat-dir\playground\venv-python
INFO:     Uvicorn running on http://127.0.0.1:5555 (Press CTRL+C to quit)
INFO:     Started parent process [486952]
INFO:     Started server process [548488]
INFOINFO:     Started server process [:     Waiting for application startup.
547296]
INFOINFO:     Application startup complete.
:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     127.0.0.1:7114 - "POST /post/ HTTP/1.1" 200 OK
INFO:     Shutting down
INFO:     Waiting for application shutdown.
INFO:     Application shutdown complete.
INFO:     Finished server process [547296]To kill the server in Windows, kill the parent process (CTRL+C does not quite work in Windows at least), e.g.taskkill /f /pid 486952Test the REST API:importhttpxres=httpx.post("http://127.0.0.1:5555/post/",json=["test\nlove","没有\n测试\n其他\n爱"]).json()print(res)# [['', '没有', ''], ['test', '测试', '0.75'], ['', '其他', ''], ['love', '爱', '0.87']]
Package: df1
DF1A very basic Allen Bradley DF1 protocol implementation in Python.How to usefrom df1.df1_client import Df1Client
from df1.commands import Command0FA2
from df1.file_type import FileType

with Df1Client(src=0x0, dst=0x1) as client:
    client.connect('192.168.0.32', 10232)
    command = client.create_command(Command0FA2, table=43, start=245, bytes_to_read=10, file_type=FileType.INTEGER)
    reply = client.send_command(command)
    print(reply.get_data(FileType.INTEGER))
Package: df1py3
# DF1A very basic Allen Bradley DF1 protocol implementation in Python.### How to use: example 1- Reading TCP using commandsfrom df1.df1_client import Df1Client
from df1.commands import Command0FA2
from df1.file_type import FileTypewith Df1Client(src=0x0, dst=0x1) as client:client.connect(‘192.168.0.32’, 10232)
command = client.create_command(Command0FA2, table=43, start=245, bytes_to_read=10, file_type=FileType.INTEGER)
reply = client.send_command(command)
print(reply.get_data(FileType.INTEGER))### How to use: example 2- using wrapper functions for writing/reading TCPseehttps://github.com/reyanvaldes/pydf1/blob/master/tests/df1/df1_tcp_serial_example.py### How to use: example 3- using wrapper functions for writing/reading serialSeehttps://github.com/reyanvaldes/pydf1/blob/master/tests/df1/df1_serial_example.py
Package: df2d
Drosophila 2D PoseLoad the model.frommodelimportDrosophila2DPosefromparserimportcreate_parsercheckpoint_path='/home/user/Desktop/DeepFly3D/weights/sh8_deepfly.tar'args=create_parser().parse_args('')model=Drosophila2DPose(checkpoint_path=checkpoint_path,**args.__dict__).cuda()Load the data.frominferenceimportpath2inpfromdatasetimportDrosophila2Datasetfromtorch.utils.dataimportDataLoaderimage_path='/home/user/Desktop/DeepFly3D/data/test/'inp=path2inp(image_path)# extract list of images under the folderdat=DataLoader(Drosophila2Dataset(inp),batch_size=8)Do the inference.frominferenceimportinferencepoints2d=inference(model,dat)
Package: df2file
Project : df2file:A Python utility designed for efficiently appending Pandas DataFrames to a single Excel file, each in a separate sheet.Features:Convenient Dataframe Appending:Easily append Pandas DataFrames to an existing Excel file, with each DataFrame creating a new sheet within the workbook.Sheet Customization:Specify sheet names, starting row positions, and other options to customize the placement of each DataFrame within the Excel file.Excel File Management:If the specified Excel file does not exist, the utility will create it. If it does exist, the utility will append DataFrames to existing sheets or create new sheets as needed.Installation:url =https://pypi.org/project/df-to-excel-appender/Install the package using pip:1.pip install df2file2.from df2file.df_to_file import append_df_to_excel3.from df2file.df_to_file import append_df_to_csvUse the function to append a DataFrame to an Excel file:Example usage:output_file = 'output.xlsx'
your_dataframe = pd.DataFrame({'Column1': [1, 2, 3], 'Column2': ['A', 'B', 'C']})
append_df_to_excel(output_file, your_dataframe, sheet_name='Sheet1', index=False)Run the script from the command line:df_to_excel_appender input.csv -o output.xlsxOptions:-i, --input: Input CSV file.-o, --output: Output Excel file.Dependencies:pandasopenpyxlContributing:If you find any issues or have suggestions for improvements, please open an issue or create a pull request.License:This project is licensed under the MIT License - see the LICENSE file for details.
Package: df2mysql
df2mysql是一个用于连接和操作 Microsoft SQL Server 数据库的 Python 包。它提供了一个名为Database的类，可以使用该类的方法执行各种数据库操作，如创建和删除数据库、创建和删除表、插入和检索数据等。使用方法：
以下是使用df2mysql包的一般步骤：安装包：通过运行pip install df2mysql安装包。导入包：在你的 Python 脚本或交互式会话中使用from df2mysql import Database导入Database类。3.创建Database实例：通过创建Database类的实例并提供 SQL Server 主机、用户名和密码来建立数据库连接。db=Database(host='your_host',user='your_username',password='your_password')4.连接到数据库：使用connect_db(database)方法连接到指定的数据库。db.connect_db(database='your_database')5.执行数据库操作：使用Database类提供的方法执行数据库操作，如创建表、插入数据、检索数据等。db.create_table(database='your_database',table_name='your_table',table_head=['column1','column2'])db.insert_data(database='your_database',table_name='your_table',data=your_data)result=db.select_data(database='your_database',table_name='your_table')6.关闭连接：在完成所有数据库操作后，使用 close() 方法关闭数据库连接。db.close()请确保已安装 pymssql 和其他所需的依赖项，并提供正确的数据库连接信息。这样，你就可以使用 df2mysql 包连接到 Microsoft SQL Server 数据库并执行相应的操作了。
Package: df2obs
A tool to convert DataFrame to a list of objects of some class or vice versaSignaturesdefdf2obs(df:pd.DataFrame,clazz:Any)->List[Any]ordefobs2df(obs:List[Any])->pd.DataFrameHow to useDefine class attribute : pandas DataFrame column mapping in your class directlyInherit your class from df2obs.base.Base, and make df2obs.base.BaseType as its metaclassYou are ready to go using df2obs() and/or obs2df()Exampleimportpandasaspdfromdf2obs.baseimportBase,BaseTypemovie_df=pd.DataFrame({'title1':['The American President',"Queen's Gambit",'Wall Street'],'year1':[1995,2020,1987],'director2':['Rob Reiner','Scott Frank','Oliver Stone']})classMovie(Base,metaclass=BaseType):# class attribute = pandas DataFrame column nametitle='title1'year='year1'director='director2'if__name__=="__main__":m=Movie()packed_obs=list(m.df2obs(movie_df))print(packed_obs)print('='*100)print(m.obs2df(packed_obs))Result:[{'title': 'The American President', 'year': 1995, 'director': 'Rob Reiner'}, {'title': "Queen's Gambit", 'year': 2020, 'director': 'Scott Frank'}, {'title': 'Wall  Street', 'year': 1987, 'director': 'Oliver Stone'}]====================================================================================================title  year      director
0  The American President  1995    Rob Reiner
1          Queen's Gambit  2020   Scott Frank
2             Wall Street  1987  Oliver Stone
Package: df2onehot
df2onehotdf2onehotis a Python package to convert unstructured DataFrames into structured dataframes, such as one-hot dense arrays.⭐️ Star this repo if you like it ⭐️Install df2onehot from PyPIpipinstalldf2onehotImport df2onehot packagefromdf2onehotimportdf2onehotDocumentation pagesOn thedocumentation pagesyou can find detailed information about the working of thedf2onehotwith many examples.Examplesresults=df2onehot(df)# Force features (int or float) to be numeric if unique non-zero values are above percentage.out=df2onehot(df,perc_min_num=0.8)# Remove categorical features for which less then 2 values exists.out=df2onehot(df,y_min=2)# Combine two rules above.out=df2onehot(df,y_min=2,perc_min_num=0.8)Example: Process Mixed datasetExample: Extracting nested columnsExample: Setting custom dtypesMaintainersErdogan Taskesen, github:erdogantContributions are welcome.If you wish to buy me aCoffeefor this work, it is very appreciated :)
Package: df3dbehav
Installpipinstalldf3dbehavRundf3dbehav--path'/folder/with_pose_result_file/'It will automatically find the pose_result file and save a file called df3d_behav.csv under the same folder.Analyze the ResultsYou can read the csv file using pandas:importpandasaspdpd.read_csv('behav_clsf.csv')
Package: df3tools
Command-line tools to convert POV-Ray density files (DF3) to a bunch
of images and vice versa.InstallationThe easiest way to install is via standard Python package manager:pip install df3toolsOptionally, you may clone package’s repository, and runsetup.pyscript:git clone https://github.com/a5kin/df3tools.git
cd df3tools
python setup.py installQuickstartAfter successful installation, two tools will be available at
command-line:df3splitanddf3combine.The former, by default, splits density file to a bunch of images and
saves them intolayerNNN.tgafiles in current directory:df3split path-to-original-density-file.df3The latter, by default, combines alllayer*files in current
directory into a single density file. Image format is auto-detected:df3combine path-to-new-density-file.df3You may also pass an images’ prefix like-pdata/layer. See the
full list of options below.df3splitSplit POV-Ray.df3density file to a series of separate images.Usagedf3split [-h] [-t {tga,png}] [-p PREFIX] [-s] df3filePositional arguments:df3file    Filename of density file to split.Optional arguments:-h, --help                        Show help message and exit.
-t {tga,png}, --format {tga,png}  Output files format.
-p PREFIX, --prefix PREFIX        Output files prefix.
-s, --silent                      Suppress output.df3combineCombine a series of separate images into POV-Ray.df3density file.Usage:df3combine [-h] [-p PREFIX] [-s] df3filePositional arguments:df3file    Filename of density file to combine images into.Optional arguments:-h, --help                        Show help message and exit.
-p PREFIX, --prefix PREFIX        Input files prefix.
-s, --silent                      Suppress output.Note, images format is autodetected. You may combine any type of
images, supported by Pillow.TestsTo run full test suite for all supported Python versions, installtoxpackage, and run it from project’s top directory, containingsetup.py:pip install tox
toxOptionally, you can run tests only for your current Python version by
typing:python -m unittest discover -s testsAcknowledgementsThanks toYury Poberezhnyfor the idea and motivation to create this
package.
Package: df4loop
df4loopdf4loop supports general purpose processes that requires a combination of both pandas.DataFrame and loop. Specifically, the mission of df4loop is to "speed up processing" and "make complex code intuitive" at low installation costs.Installationpipinstalldf4loopUsageThe following DataFrame is defined to assist users envision the use of df4loop.importpandasaspdsample_dict={"column_1":[100,200,300,400,500],"column_2":["A","B","C","D","E"],"column_3":["a","b","c","d","e"],}df=pd.DataFrame.from_dict(sample_dict)dfcolumn_1column_2column_30100Aa1200Bb2300Cc3400Dd4500EeDFIteratorDFIterator helps developers writing the following code. This is code written using pandas.DataFrame.iterrows for the purpose of referencing a value by row.forindex,rowindf.iterrows():tmp=row["column_1"]DFIterator reproduces this process and speeds it up. Actually, DataFrame and its row pandas.Series are converted to lists and dictionaries to speed up. However, the usage is almost the same.fromdf4loopimportDFIteratordf_iterator=DFIterator(df)forindex,rowindf_iterator.iterrows():tmp=row["column_1"]If you do not need to output the index, setreturn_indexes=False.fromdf4loopimportDFIteratordf_iterator=DFIterator(df)forrowindf_iterator.iterrows(return_indexes=False):tmp=row["column_1"]DFGeneratorDFGenerator supports the generation of DataFrame with rows set by loops. Adding rows to the DataFrame in a loop will take a long time to process. The secret to speeding up is to organize rows in a list or dictionary and then make them pandas.DataFrame at once. DFGenerator supports this process for intuitive implementation.The following code is an example of selecting the dict type as the row.fromdf4loopimportDFGenerator# It is not necessary to specify columns.df_generator=DFGenerator(columns=df.columns.values.tolist())for_,rowindf.iterrows():tmp_row={"column_1":row["column_1"],"column_2":row["column_2"],"column_3":row["column_3"],}df_generator.append(tmp_row)new_df=df_generator.generate_df()The following code is an example of selecting the list type as the row. columns must be specified during initialization.fromdf4loopimportDFGeneratordf_generator=DFGenerator(columns=df.columns.values.tolist())for_,rowindf.iterrows():tmp_row=[row["column_1"],row["column_2"],row["column_3"],]df_generator.append(tmp_row)new_df=df_generator.generate_df()
Package: dfac
Data Factory aka 'dfac'A simple to use python app for generating data of different types and configurations. Can be run as a module or used as library.Usage Instruction as appUsage: dfac.py [OPTION...] [OUTPUT]...
Datafactory generates random string of data for testing and other purposes.Examples:dfac.py -t a -v n

dfac.py -t s -v u -x [filename]DESCRIPTION
Datafactory generates random string of data for testing and other purposes.OPTIONS
-t, --datatype
Option for the data type to be generated. Below are the available datatypes.Data Types
    s, string 
        print out string as data type
    a, array 
        print out array as data type-v, --valuetype
Option for the type of value to be generated. Below are the available value type options.Value Types
    For String data type
        n, alphanumeric 
            print out string containing random values of latin alphabet and numbers
        a, alphabet
            print out random string alphabet in a mix of uppercase and lowercase.
        u, upper
            print out random string of alphabet in uppercase.
        l, lower
            print out random string of alphabet in lowercase.
        y, alphasymbolic
            print out random mix of alphabet and symbols.

    For Array data type
        n, alphanumeric
            print out array containing strings with random alphabets and numbers.
        a, alphabet
            print out array containing strings with random alphabets uppercase and lowercase.
        u, upper
            print out array containing strings with random alphabets uppercase.
        l, lower
            print out array containing strings with random alphabets containing lowercase.
        y, alphasymbolic
            print out array containing strings with random alphabets and symbols.
        i, integer
            print out array containing strings with random integer.
        d, decimal
            print out array containing strings with random decimal numbers.
        o, symbolic
            print out array containing string with random symbols.-0, --length
Option to print out length of string or array.-L, --low
(For Array types) Option to set minimum length of value.-H, --high
(For Array types) Option to set maximum length of value.-x, --file
Print out generated value to file, if no name is provided output.txt is used.-h, --help
Print this help text.Usage Instruction as libraryExamples:from core.StringGenerator import StringGeneratorobject=StringGenerator(7,'AlphaNumeric')object.generate()Example Output:hDCyDM6Class Available:
    a. StringGenerator(length, type) [from core.StringGenerator]
    b .ArrayGenerator(length,type, low, high) [from core.ArrayGenerator]
        low = lowest length of the data generated
        high = highest length of the data generatedTypes available for ArrayGenerator:
'AlphaNumeric',
'Alphabet',
'Alphabet_Upper',
'Alphabet_Lower',
'AlphaSymbolic',
'Integer',
'Decimal',
'Symbolic'Types available for StringGenerator:
'AlphaNumeric',
'Alphabet',
'Alphabet_Upper',
'Alphabet_Lower',
'AlphaSymbolic'
Package: dface
dFaceFace detection and recognition library that focuses on speed and ease of use.
This is a stripped down version of timesler'sfacenetrepo with some improvements notably on memory overflows. This repository is actively developed and used in production.MTCNNis used for face detection andFaceNetis used for generating face embeddings.InstallationBoth algorithms can be used directly by copying the source file into your code base. They are single file and single model implementations with no interdependence.Alternatively you can install withpip3 install dfacecommand. Weights will be  downloaded from github automatically in the first run.MTCNNThis implementation takes a list of frames and returns a list of detected faces. The input and output lists always have the same size. If no face is detected for a frame, the corresponding list element is returnedNone, otherwise it's a tuple of three elements;(bounding_boxes, probabilities, landmarks).mtcnn=MTCNN('cuda')...result=mtcnn.detect(frames)forresinresult:ifresisNone:continueboxes,probs,lands=resBounding boxes is a list of four coordinates(x1, y1, x2, y2)for each face detected in the frame. Probabilities is a list of confidence scores between 0 and 1 for each face. Landmarks is a list of facial landmark points. There are five points for each face.The implementation is atmtcnn.pyFaceNetThis implementation takes a list of cropped faces and returns a list of face embedding vector of 512 dimensions. These embeddings then can be used for detecting facial similarities, clustering identities and so on.facenet=FaceNet('cuda')...embeds=facenet.embedding(faces)The implementation is atfacenet.pyBoth algorithms accept model path as the second argument if you want to load models from a custom location.Full working exampleThe repo contains anexamplescript that uses both MTCNN and Facenet to read a video and cluster the faces. It usesOpenCVto read video frames andDBSCANto cluster faces.You can run the example by simply typing:python3 example.py video.mp4. A directory will be created with the same name as video that contains clustered identities. The following is an example image.The implementation is atexample.py