Saravanan666/pypi-org huggingface dataset:
Package: dynamic-sitemap
Dynamic sitemapThe simple sitemap generator for Python projects.Installationusing pippipinstalldynamic-sitemapUsageStaticfromdatetimeimportdatetimefromdynamic_sitemapimportSimpleSitemap,ChangeFrequrls=['/',{'loc':'/contacts','changefreq':ChangeFreq.NEVER.value},{'loc':'/about','priority':0.9,'lastmod':datetime.now().isoformat()},]sitemap=SimpleSitemap('https://mysite.com',urls)# or sitemap.render()sitemap.write('static/sitemap.xml')DynamicOnly FlaskSitemap is implemented yet, so there is an example:fromdynamic_sitemapimportFlaskSitemapfromflaskimportFlaskapp=Flask(__name__)sitemap=FlaskSitemap(app,'https://mysite.com')sitemap.build()Then run your server and visithttp://mysite.com/sitemap.xml.The basic example with some Models:fromdynamic_sitemapimportChangeFreq,FlaskSitemapfromflaskimportFlaskfrommodelsimportPost,Tagapp=Flask(__name__)sitemap=FlaskSitemap(app,'https://mysite.com',orm='sqlalchemy')sitemap.config.TIMEZONE='Europe/Moscow'sitemap.ignore('/edit','/upload')sitemap.add_items('/contacts',{'loc':'/faq','changefreq':ChangeFreq.MONTHLY.value,'priority':0.4},)sitemap.add_rule('/blog',Post,loc_from='slug',priority=1.0)sitemap.add_rule('/blog/tag',Tag,loc_from='id',changefreq='daily')sitemap.build()Also you can set configurations from your class (andit's preferred):fromdynamic_sitemapimportChangeFreq,FlaskSitemapfromflaskimportFlaskfrommodelsimportProductclassConfig:FILENAME='static/sitemap.xml'IGNORED={'/admin','/back-office','/other-pages'}ALTER_PRIORITY=0.1app=Flask(__name__)sitemap=FlaskSitemap(app,'https://myshop.org',config=Config)sitemap.add_items('/contacts',{'loc':'/about','changefreq':ChangeFreq.MONTHLY.value,'priority':0.4},)sitemap.add_rule('/goods',Product,loc_from='id',lastmod_from='updated')sitemap.build()Not supported yet:urls with more than 1 converter, such as/page/<int:user_id>/<str:slug>Check out theChangelog.ContributingFeel free to suggest any improvements :)DevelopmentFork this repository, clone it and install dependencies:pipinstall-rrequirements/all.txtCheckout to a new branch, add your feature and some tests, then try:makeprecommitIf the result is ok, create a pull request to "dev" branch of this repo with a detailed description.Done!
Package: dynamicsizerecarray
A dynamic, appandable version of Numpy’srecarray. The goal is to have arecarray-like-object which can be appended to in a transparent and
efficient way.installpipinstalldynamicsizerecarraybasic useInitialize an emptyDynamicSizeRecarraywith adtype.importdynamicsizerecarraydra=dynamicsizerecarray.DynamicSizeRecarray(dtype=[("hour","u1"),("minute","u1"),("temperature","f8")])len(dra)0Or initialize theDynamicSizeRecarraywith an already existingrecarray.importnumpyrec=numpy.core.records.recarray(shape=1,dtype=[("hour","u1"),("minute","u1"),("temperature","f8")],)rec["hour"][0]=2rec["minute"][0]=13rec"temperature"][0]=20.123dra=dynamicsizerecarray.DynamicSizeRecarray(recarray=rec)len(dra)1After initializing, theDynamicSizeRecarraycan be appended to dynamically.
You can append arecord, i.e. a dict.dra.append_record({"hour":3,"minute":53,"temperature":22.434})len(dra)2Or you can append anotherrecarray.rec=numpy.core.records.recarray(shape=1,dtype=[("hour","u1"),("minute","u1"),("temperature","f8")],)rec["hour"][0]=13rec["minute"][0]=41rec"temperature"][0]=18.623dra.append_recarray(rec)len(dra)3When the dynamic appending is done, theDynamicSizeRecarraycan be exported
to a classic, and staticrecarray.final=dra.to_recarray()Further theDynamicSizeRecarrayprovides the propertiesshapeanddtype, and also implements__gettitem__,__setitem__.dra.shape# shape(3,)dra[0]# __gettitem__(2,13,20.123)dra[1]=(7,25,21.45)# __setitem__len(dra)# __len__3dra.dtype# exposes the internal recarray's dtypedtype((numpy.record,[('hour','u1'),('minute','u1'),('temperature','<f8')]))wordingrecord: Adictwith keys (and values) matching thedtypeoftheDynamicSizeRecarray. (Wording is adopted frompandas).recordsis just alistofrecord``s(Also adopted from ``pandas).recarray: Is short fornp.core.records.recarray.
Package: dynamic_stock_model
dynamic_stock_model=====Python class for efficient handling of dynamic stock modelsThis project contains a class and a connected unit test for modelling dynamic stocks of materials or products,as used in dynamic material flow analysis and industrial ecology.Created on Mon Jun 30 17:21:28 2014@main author: stefan pauliuk, NTNU Trondheim, Norway <br>with contributions from <br>Chris Mutel, PSI, Villingen, CH<br><b>Dependencies:</b> <br>numpy >= 1.9<br>scipy >= 0.14<br><br><b>Tutorial:</b><br>http://nbviewer.ipython.org/github/stefanpauliuk/dynamic_stock_model/blob/master/Doc/dynamic_stock_model_Documentation.ipynb<br><b>Documenation of all methods and functions:</b><br>http://htmlpreview.github.com/?https://github.com/stefanpauliuk/dynamic_stock_model/blob/master/Doc/dynamic_stock_model.html<br><b> Below, a quick installation guide and a link to the tutorial are provided:</b><br><br><b>a) Installation from the web repository:</b> <br>This is the easiest way of installing dynamic_stock_model. Github hosts an installation package for dynamic_stock_model, which can be downloaded directly from the command line using pip: <br>> pip install dynamic_stock_model<b>b) Installation as package:</b> <br>Pull package via git pull or download as .zip file and unpack. Choose a convenient location (Here: 'C:\MyPythonPackages\'). Then open a console, change to the directory ../dynamic_stock_model-master/, and install the package from the command line: <br>> python setup.py installThis makes the package available to Python. At any other place in a system with the same python installation, dynamic_stock_model is now ready to be imported simply by <br>> import dynamic_stock_modelThis setup also allows us to run the unit test: <br>> import unittest> import dynamic_stock_model> import dynamic_stock_model.tests> unittest.main(dynamic_stock_model.tests, verbosity=2)Or, to run a specific test> unittest.main(dynamic_stock_model.tests.test_known_results, verbosity=2)<br><b>c) Manual installation, by modifying the python path</b><br>Pull package via git pull or download as .zip file and unpack. Choose a convenient location (Here: 'C:\MyPythonPackages\'). Then include in your code the following lines <br>> import sys> sys.path.append('C:\\MyPythonPackages\\dynamic_stock_model-master\\dynamic_stock_model\\')> from dynamic_stock_model import DynamicStockModel
Package: dynamictableprint
AboutThis python3 module aims to add additional functionality to the already amazing
TablePrint (github.com/nirum/tableprint).While TablePrint is functionally excellent at printing out text to
the console in a beautiful manner, I have found that it lacks some dynamicism.
When printing to a console that is constantly different sizes for example,
wrapping the text around produces basically illegible tables.This module aims to improve the situation where the user is doing data heavy
string representation, using data processing packages such as Pandas (which,
this module only supports, and also,thank youto nirum for adding in Pandas
DataFrame support). Based on the size of the console, and some priorities to
each column given by the user, we will squish columns as needed until it fits
nicely within the given constraints. When the console width changes, the
program will need to be reloaded, but will adjust to fit the new screen.InstallationYou'll have to clone directly from github into your source repo for now.
Looking into improving this!UsagefromdynamictableprintimportDynamicTablePrintimportpandasaspdd={'names':["Albert Einstein","Issac Newton","Stephen Hawkings"],'places':["Ulm, Germany","Wolsthorpe Manor, United Kingdom","Oxford, United Kingdom"],'Foods':["Spaghetti","Pasta","Noodles"]}data_frame=pd.DataFrame(data=d)dtp=DynamicTablePrint(data_frame,angel_column='Foods',squish_column='places')dtp.banner('Things!')dtp.dtp.write_to_screen()Thesquish_columnrepresents the column that you would like to be squished
first. Typically the 'squish factor' is 20% at most, but will dynamically vary
depending on how the other columns are. Theangel_columnis the column that
you would prefer to be modified last, that is, having the highest priority on
being the same.Dependenciespython3.6, an possibly other versions>3.0tableprintpandasLicenseMIT
Package: dynamic-tensor
dynamic-tensor(This package is still developing and not formally tested. Please report any potential issues. Constantly reshaping the tensor could be inefficient and not suitable for high-performance computing)A Python package for automatically and minimally expanding tensors for__setitem()__operations based on NumPy. You don't need to worry about tensor shape initialization,reshape(), orexpand_dims()anymore as if the tensor has an infinite size. Both basic (integer, slice,np.newaxis, ellipsis) and advanced (integer & boolean array) indexing are supported (refer toIndexing on ndarrays).You can also configure aDynamicTensorto adapt the tensor type to the new value to avoidastype()(enabled by default).UsageRequires Python 3.6+ and NumPy 1.16+.pipinstalldynamic-tensor# or using condacondainstalldynamic-tensorOr install from source:gitclonehttps://github.com/eurekazheng/dynamic-tensor.gitcddynamic-tensor# build the packagepythonsetup.pysdistbdist_wheel
pipinstall-e.Usage:importdensord=densor.dt([[1,2],[3,4]])d[2,1:3,[2,3]]=5.6print(d,d.shape)# Expected output:# [[[1.  0.  0.  0. ]#   [2.  0.  0.  0. ]#   [0.  0.  0.  0. ]]##  [[3.  0.  0.  0. ]#   [4.  0.  0.  0. ]#   [0.  0.  0.  0. ]]##  [[0.  0.  0.  0. ]#   [0.  0.  5.6 5.6]#   [0.  0.  5.6 5.6]]] (3, 3, 4)# Helper: convert a list to tensor when possibledensor.tensorify([[1,2],[3,4]])# return ndarraydensor.tensorify([[1,2],[3,4,5]])# return FalseRationaleThe underlying data structure ofdensor.dtisnumpy.ndarray_a. Upon a__setitem(idx, val)__call, the following preprocessing is done:Determine the target shape.Based on target shape, (potentially) expand the dimension of_a.(Optional) Based onvaldtype, (potentially) change the dtype of_a.Based on target shape, (potentially) change the size of_aat each dimension.Refer tosrc/densor.pyfor more details.
Package: dynamicTreeCut
Python translation of the hybrid dynamicTreeCut method created by Peter Langfelder and Bin Zhang.dynamicTreeCut was originally published by inBioinformatics:Langfelder P, Zhang B, Horvath S (2007) Defining clusters from a hierarchical cluster tree:
the Dynamic Tree Cut package for R. Bioinformatics 2008 24(5):719-720dynamicTreeCut R code is distributed under the GPL-3 License and
original sources should be cited.dynamicTreeCut contains methods for detection of clusters in hierarchical clustering dendrograms.NOTE: though the clusters match the R output, the cluster names are shuffledInstallingTo install, it’s best to create an environment after installing and downloading theAnaconda Python Distributionconda env create –file environment.ymlPyPI install, presuming you have all its requirements (numpy and scipy) installed:pip install dynamicTreeCutImportation>>> from dynamicTreeCut import cutreeHybrid
>>> from scipy.spatial.distance import pdist
>>> import numpy as np
>>> from scipy.cluster.hierarchy import linkage
>>> d = np.transpose(np.arange(1,10001).reshape(100,100))
>>> distances = pdist(d, "euclidean")
>>> link = linkage(distances, "average")
>>> clusters = cutreeHybrid(link, distances)
..cutHeight not given, setting it to 495.1  ===>  99% of the (truncated) height range in dendro.
..done.
>>> clusters["labels"]
[2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3
 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 1 1 1 1 1 1 1 1 1
 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]Compared to R:> library(dynamicTreeCut)
> d = matrix(1:10000, 100)
> distances <- dist(d, method="euclidean")
> dendro <- hclust(distances, method="average")
> clusters <- cutreeDynamic(dendro, distM=as.matrix(distances))
  ..cutHeight not given, setting it to 495  ===>  99% of the (truncated) height range in dendro.
  ..done.
> clusters
  [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3
  [38] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 1 1 1 1 1 1 1 1 1
  [75] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1InstallationIf you dont already have numpy and scipy installed, it is best to downloadAnaconda, a python distribution that has them included.https://continuum.io/downloadsDependencies can be installed by:pip install -r requirements.txtLicensedynamicTreeCut is available under the GPL-3 License
Package: dynamic-unet
Dynamic U-Nets with PyTorchThis package has some convenience functions for setting up U-Nets with pre-trained ResNets as the encoder.Installpip install dynamic_unetLaterExamples of how to use this packageAdd-ons for having arbitrary image classification networks being used as encoders, not just ResNets (which are limited to 3 channel inputs, and need some ad-hoc work to set up as encoders)Contactdthiagarai@gmail.com
Package: dynamic-upload-image-field
Dynamic Upload Image FieldDescriptionA django ImageField that generates it's upload_to value from the model instance method get_upload_to.Installationpipinstalldynamic-upload-image-fieldorpipenvinstalldynamic-upload-image-fieldUsagefromdjango.dbimportmodelsfromdynamic_upload_image_field.fieldsimportDynamicUploadImageFieldclassExampleModel(models.Model):name=models.CharField(max_length=56)image=DynamicUploadImageField()defget_upload_to(self,field_name):class_name=self.__class__.__name__.lower()instance_name=self.namereturn"{}/{}".format(class_name,instance_name)
Package: dynamicviz
Dynamic visualizationEric SunPython package for generating bootstrap visualizations of high-dimensional data. Great for assessing stability of visualizations and increasing robustness of interpretations. Also included are methods for computing variance scores along with classical concordance scores for quantifying the quality of a visualization.Installation and setupOption 1: PyPIInstall the package through PyPI withpip. We recommend setting up a conda environment (or another virtual environment) first sincedynamicvizcurrently relies on specific versions for its dependencies:conda create -n myenv python=3.8
conda activate myenv

pip install dynamicvizOption 2: GithubAnother way to install the package along with associated test and tutorial files is to clone the directory and then install the requirements for using the package. To do this, first clone the repository using git (you can install git following the instructionshere):git clone https://github.com/sunericd/dynamicviz.gitWe recommend setting up a conda environment to install the requirements for the package (instructions for installing conda and what conda environment can do can be foundhere). Installation of requirements can then be done with the following commands:conda create -n dynamicviz python=3.8
conda activate dynamicviz

cd dynamicviz
pip install -r requirements.txtTo test that the installation is working correctly, you can use the Jupyter notebooktutorial.ipynb(requires installing Jupyter, instructions foundhere, and adding the conda environment we just created to the Jupyter notebook kernels, instructions foundhere) or the test scripttest.pyto check against expected outputs of the key methods.For the test data in the tutorial notebook, expected run times are under 5 minutes for interactive visualization and under 10 minutes for global variance score calculation.For Jupyter notebooks and Python scripts associated with our original publication, please refer tohttps://github.com/sunericd/dynamic-visualization-of-high-dimensional-data
Package: dynamic-watershed
dynamic_watershedPackage descriptionWe implement the splitting algorithm for splitting nuclei nucleas described in in 'Nuclei segmentation in histopathology images using deep neural networks'. This algorithm is essentially a dynamic watershed.
The main function is named:post_process.Installationdynamic_watershed can be installed by unzipping the source code in one directory and using this command: ::python setup.py installYou can also install it directly from the Python Package Index with this command (not working yet): ::pip install dynamic_watershedExample>>>fromdynamic_watershedimportpost_process>>>fromskimage.ioimportimread>>>probability_image=imread('example.png')>>>p1,p2=7,0.5>>>result_segmentation=post_process(probability_image,p1,thresh=p2)LicenceSee file LICENCE.txt in this folder.Contributedynamic_watershed is an open-source software. Everyone is welcome to contribute !CiteIf you use this work please cite our paper.BibTeX:@inproceedings{naylor2017nuclei,
    title={Nuclei segmentation in histopathology images using deep neural networks},
    author={Naylor, Peter and La{\'e}, Marick and Reyal, Fabien and Walter, Thomas},
    booktitle={Biomedical Imaging (ISBI 2017), 2017 IEEE 14th International Symposium on},
    pages={933--936},
    year={2017},
    organization={IEEE}
    }
Package: dynamicxml
dynamicxmlA simple extension of Etree that gives users the ability to directly access attributes and nodes without having to
implement boilerplate python code.Rationale for this library:Dynamic XML Library with PythonPip Installer:pippython -m pip install dynamicxmlDynamicElementis a drop-in replacement for any Etree code that you already have<!-- ConfigFile.xml --><ConfigurationData><Runtimetimeout="1000"runtimeDataPath="/path/to/runtime/data"/></ConfigurationData># main.pyimportdynamicxml# parse the data and get back an instance of DynamicElementroot=dynamicxml.parse('data/ConfigFile.xml')# Print the tag of the root element, just like you would a typical etree# elementprint(root.tag)# get access to the runtime data node, which is a child of# <ConfigurationData />.  The library returns a list of child# nodes, regardless of how many elements there are.  An "AttributeError"# is raised if the node does not exist.runtimeNode=root.Runtime[0]# Access the attributes of the node directly using the "attr_" prefix.print(runtimeNode.attr_timeout)print(runtimeNode.attr_runtimeDataPath)# set the data directlyruntimeNode.attr_timeout=str(int(runtimeNode.attr_timeout)+1)# easy writing of the datadynamicxml.write('data/ConfigFile_Updated.xml',root)
Package: dynamite-cli
Dynamite-cliA cli to copy dynamo table items to another tableRequirementsYou needpoetryas a dependency managerInstallationpip install dynamite-cliUsageYou can print an help menu withdynamite-cli --helpThesource table,source region,source profileanddestination tablearerequiredfieldsIf you don't specify a destinationregionand/or a destinationprofile, the source one are used.Theprofilefield is used to retrieve the credentials to connect to your AWS account. So you need at least one account configured in your.aws/credentialsfile (aws_access_key_id, andaws_secret_access_key)NOTE: the tables should have the same schemaExample:dynamite-cli <SRC_TABLE> <SRC_REGION> <SRC_PROFILE> <DST_TABLE> [DST_REGION] [DST_PROFILE]
Package: dynamixel-control
Dynamixel ControlUseUse this library to communicate with Dynamixel motors. Currently, this is set up for position control and feedback for Dynamixel XL-320 and XL-330 motors, although more can be added with ease.Instalation and DependenciesClone this package into your project or add as a submodule:gitclonehttps://github.com/OSUrobotics/dynamixel_control.git
or
gitsubmoduleaddhttps://github.com/OSUrobotics/dynamixel_control.gitThis library requires the following dependencies:Numpypython3-mpipinstallnumpyDynamixel-SDKpython3-mpipinstalldynamixel-sdkThere are two modules -dynamixel.pyanddxl.py.dynamixel.pycontains all of the functions needed to control and read dynamixels. Examples are provided at the bottom of the file. For every Dynamixel motor attached,dynamixel.pycreates a Dxl object fromdxl.py. That object contains all the neccessary parameters and stores the Dynamixel's cablibration, current position, etc.From directory, build package:
python3 -m build
Upload Package:
python3 -m twine upload dist/*
Package: dynamixel-controller
dynamixel-controllerdynamixel-controller is a Python library designed from the ground up to work with any Dynamixel motor on the market with few to no modifications.InstallationUse the package managerpipto install dynamixel-controller.pipinstalldynamixel-controllerUsageImport:fromdynioimport*Port handling:dxl_io=dxl.DynamixelIO('portname')# your port for U2D2 or other serial devicePre-made motor declarations:Seedocumentationfor full list of motors.
See below for sample:ax_12=dxl_io.new_ax12(1)# AX-12 protocol 1 with ID 1mx_64_1=dxl_io.new_mx64(2,1)# MX-64 protocol 1 with ID 2mx_64_2=dxl_io.new_mx64(3,2)# MX-64 protocol 2 with ID 3Motor Control:Seedocumentationfor full list of functions
and their usage.The most prevalent functions are pre-implemented as methods for the motor objects.
These include:motor.torque_enable()motor.torque_disable()motor.set_acceleration(acceleration)motor.set_velocity_mode()motor.set_velocity(velocity)motor.set_position_mode()motor.set_position(position)motor.set_angle(angle)motor.set_extended_position_mode()motor.set_position(position)position=motor.get_position()angle=motor.get_angle()current=motor.get_current()All other values can be easily read from or written to using theircontrol tablename. Example:motor.write_control_table("LED",1)# Turns the LED onspeed=motor.read_control_table("Present_Speed")# Returns present velocityContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Especially encouraged is new control tables to be published as part of the package.LicenseApache 2.0