Saravanan666/pypi-org huggingface dataset:
Package: unit-convert
unit-convertEasily convert units to different quantities.For conveniance, abbreviations are accepted, where an attempt will be made to calculate the type based on the other inputs (eg. "m" can evaluate as either "minute" or "metre").This library is deprecated: A recommendation is to usepintinstead.Example Usage>>>fromunit_convertimportUnitConvert# Yards + kilometres to miles>>>UnitConvert(yards=136.23,kilometres=60)['miles']37.35976780046479# Bytes to terabytes>>>UnitConvert('b',19849347813875,'megabytes',512)['tb']18.053364951617368# List available conversions>>>UnitConvert(metres=1).keys()['nm','nanometres','Î¼m','micrometres','mm','millimetres','cm','centimetres','i','inches','ft','feet','m','metres','meters','yd','yards','km','kilometres','kilometers','miles','lightyears','au','astronomical_units','parsec']Data size, time, distance, mass and temperatures are supported.
Package: unit-converter
Unit ConverterDescriptionPackage for converting quantities into different units.Basic usages>>> from unit_converter.converter import convert, converts
>>>
>>> convert('2.78 daN*mm^2', 'mN*µm^2')
>>> Decimal('2.78E+10')
>>>
>>> converts('2.78 daN*mm^2', 'mN*µm^2')
>>> '2.78E+10'
>>>
>>> converts('78 min', 'h')
>>> '1.3'
>>>
>>> converts('52°C', '°F')
>>> '125.6'
>>>
>>> converts('120 km*h^-1', 'mile*h^-1')
>>> '74.56454306848007635409210214'Note: It is necessary to provide the value as a string. Indeed, the high precision of conversion (1E-27) is possible only with string, by using Decimal object in replacement of float object.ContributingPlease submit and comment on bug reports and feature requests.To submit a patch:Fork it (https://bitbucket.org/negetem/unit_converter/fork).Create your feature branch (git checkout -b my-new-feature).Make changes.Commit your changes (git commit -am ‘Add some feature’).Push to the branch (git push origin my-new-feature).Create a new Pull Request.LicenseThis app is licensed under the MIT license.WarrantyThis software is provided “as is” and without any express or
implied warranties, including, without limitation, the implied
warranties of merchantibility and fitness for a particular
purpose.Release History0.0.1 (2016-09-21)Initial release0.1.1 (2016-09-27)ImprovementsAdded support for combined units like ‘kg*m*s^-2’1.0.0 (2018-01-16)ImprovementsBig code refactoringAdded handy functions convert and converts (return a string)1.1.0 (2018-01-16)ImprovementsAdd handling french format number 78,6 instead of 78.6Tests- Check if all prefix + unit are unique
Package: unit-curious
UnitCuriousExplore historical, quirky, and unconventional units of measurement with this easy-to-use Python library.Installation$pipinstallunit_curiousUsageUnitCuriouslets you convert between several unusual units.importunitcurious# Calculate length in ancient Egyptian cubitsresult_feet=unitcurious.cubit(1.8)# Assumes ~1.8 cubits for a forearmprint(f"Result in feet:{result_feet}")# Smoots are serious business at MIT...bridge_length=unitcurious.smoot(364.4,to="meter")print(f"That's{bridge_length}meters in smoots!")# How many barleycorns fit in an inch?inch_in_barleycorns=unitcurious.barleycom(1,to="inches")print(inch_in_barleycorns)Currently supported units:Cubit (ancient length)Barleycorn (English length)Smoot (humorous MIT unit)Stone (British weight)ContributingInterested in contributing? Check out the contributing guidelines.
Please note that this project is released with a Code of Conduct.
By contributing to this project, you agree to abide by its terms.LicenseUnitCuriouswas created by Rajaa Lebchiri. It is licensed under the terms
of the MIT license.
Package: unit-db-test
unit-db-test ·Is your tool hard to debug? Would it be easier to check it at the DB level?This module is for you!unit-db-testis a Python tool for conducting database tests. It is a unittest wrapper focussed on making DB integrity tests.
As it is an extension over theunittest.TestCaseit is easy to configure and easy to integrate with GitHub actions.FeaturesIt has an integrated connection to a Postgres Database: easily configurable using the.envfile.Fully compatible withSQLAlchemyandPandas: get apandas.Dataframeout of any SQL query you want to test.Unit-test oriented: Check if thepandas.Dataframeoutput matches the expected values, or catch it when the test fails.InstallationYou can installdbtestsusing pip:pipinstallunit-db-testUsageHere's how you can use dbtests in your projects:Create a./testfolder as with any other kind ofunittests(it is in fact compatible with otherunittestsjust make there is a connection to a Postgres DB), and create atest-file.my-tool/
├──my-tool/
│├──__init__.py
│├──script_1.py
└──tests/├──__init__.py└──test_script_1.pyOnce the script is created, we need to import the dependencies:# test_script_1.py# Dependenciesimportunittestfromunit_db_test.testcaseimportDBintegrityTestCreate aDBintegrityTestas if it was aunittest.TestCase. It is important to define the path to the.envthat keeps the Postgres DB credentials:classTestDBTestModule(DBintegrityTest):db_config_file='.postgresql.env'Create as manytestfunctions as pleased:deftest_not_null_items_in_column(self):# the query that SHOULDN'T create an assertionsql_query="""SELECTidFROM test_table;"""df=self.db.get_df_from_sql_query(sql_query)self.assertNotNullItemsInColumn(df,'id')if__name__=='__main__':unittest.main()Run it as you please:python-munittesttests/test_script_1.pyThe tests can be run locally or integrated with Github Actions.
For more examples, please check:Github Action exampleTest exampleCustom AssertThedbtestmodule contemplates new assert functions overpandas.Dataframeobjects.
This way the result of a simple query can be easily checked with the standardunittestnomenclature.The list of current Asserts is the following:assertNotNullItemsInColumn(self, df, column)assertCustomNullItemsInColumn(self, df, column, target)assertNoRows(self, df)assertNRows(self, df, target_rows)There will be more to come (under demand most probably). Feel free to suggest new ones though!ContributingIf you want to contribute to this project, please follow these guidelines:Fork the repositoryCreate a new branchMake your changesSubmit a pull requestBugs and IssuesIf you encounter any bugs or issues, please report them here.ContactAuthor: Mikel Cortes (@cortze)Feel free to reach out if you have any questions or suggestions!LicenseThis project is licensed under the MIT License - see theLICENSEfile for details.
Package: unitdox
unitdox will output a documentation a human can read based on your python unittests.MathTest (sample_tests.math_test)
  test 1 plus 1 equals 2
  test sqrt of a negative number raise a ValueError exceptionThe latest versionYou can find the latest version on githubgitclonegit@github.com:FabienArcellier/unitdox.gitCode ExampleIt takes a python module as input.python-munitdoxsample_testsYou must see this outputMathTest (sample_tests.math_test)
      test 1 plus 1 equals 2
      test sqrt of a negative number raise a ValueError exceptionMotivationThis script is inspired from the feature testdox on phpunit.https://phpunit.de/manual/current/en/other-uses-for-tests.htmlInstallationYou can setup the project with pip. The package is not on PyPi yet.pipinstall.After the install, you can use like this :unitdoxsample_testsTestsThere is not unit tests yet.You can check the code consistancy with :makelintContributorsFabien ArcellierLicenseCopyright (c) 1998, Regents of the University of California
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the University of California, Berkeley nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Package: united
United (ˈjuːnɪtɪd)A SI unit representation and conversion tool.Example:Creating a unit with Volt V as a numerator and Ampere A as denominator will result into the
unit Ohm (Ω). Same goes for creating two separate units Volt and Ampere and dividing Volt by Ampere.FeaturesArithmetic operations:MultiplyingDividingAddingSubtractingRaising powerDifferent priorities for the look up tableDefaultElectricMechanicChangelogThis project follows the guidelines ofKeep a changelogand adheres toSemantic versioning.0.1.5- 2021-07-26FixedUnable to retrieve quantity from units with fixed representation.0.1.4- 2021-07-22FixedDividing equal units yields the unit ‘Hz’ instead of ‘1’.AddedRepresentation for the power of units.0.1.3- 2021-03-08AddedNamed unit for radians.0.1.2- 2020-10-14FixedMinor documentation issues.AddedConversion parametermatch_exactly.Named unit Hertz.0.1.1- 2020-06-16FixedMinor documentation issues.0.1.0- 2020-06-03AddedInitial implementation.
Package: united-states-congress-python-api
Python United Congress API ClientTable of ContentsOverviewSetupUsageSupport These ProjectsOverviewThis is a python API client library that is used to collect data from the
United States Congress and a few other departments inside the US Government.
This library will make filtering the requests easier, and give you a nice easy
to use tool to grab vital civic data to be used in a wide range of analysis.SetupToinstallthe library, run the following command from the terminal.pip install united-states-congress-python-apiToupgradethe library, run the following command from the terminal.pip install --upgrade united-states-congress-python-apiUsageHere is a simple example of using thecongresslibrary to pull the bulk data
sources and grabbing a speicifc year of bulk data for the Privacy Act Issuances.frompprintimportpprintfromcongress.clientimportCongress# Initialize the Congress Client.congress_client=Congress()# Grab the data sources.data_sources=congress_client.data_sources()pprint(data_sources)# Grab the different resources from the Privacy Act Issuance.pia_2017=congress_client.privacy_act_issuances(file='2017')pprint(pia_2017)Support These ProjectsPatreon:Help support this project and future projects by donating to myPatreon Page. I'm
always looking to add more content for individuals like yourself, unfortuantely some of the APIs I would require me
to pay monthly fees.YouTube:If you'd like to watch more of my content, feel free to visit my YouTube channelSigma Coding.
Package: unitelabs-connector-framework
UniteLabs Connector FrameworkThe UniteLabs Connector Framework is a free and open-source framework that enables you to build connectors for
laboratory hard- and software systems with interfaces that are based on industry standards likeSiLA 2. If you plan on implementing an interface natively for your device or as wrapper
around an existing proprietary interface, you can use this framework to get it built quickly without deep-diving into
the standard specifications with our intuitive, code-first approach. It provides configurable modules you can use to
quickly integrate the hardware or software you want to connect.InstallationThe UniteLabs Connector Framework requires Python 3.9 or later. To get started quickly, we recommend to clone one of the
starter projects with:$ git clone --depth 1 https://gitlab.com/unitelabs/connector-starter.git <my-connector-name>
$ cd <my-connector-name>
$ poetry install
$ poetry run connector startYou can also manually create a new project from scratch andinstall the frameworkwith pip. In this case, of course, you'll be responsible for creating the project boilerplate files yourself.$ pip install unitelabs-connector-frameworkDocumentationStart by then exploring the UniteLabs Connector Frameworkdocumentation, dive into thecore concepts, and try ourtutorialsfor some hands-on learning.ContributeThere are many ways to contribute to this project and our vision of freely and readily available interfaces for laboratory systems.Check out ourcontribution guidelinesto help us improve this projectJoin the over 400 developers in theSiLA Slack communityGive back to the community and add your connectors to theUniteHubby sending us anemail!Get in touch with our developers regarding feedback and feature requests atdevelopers@unitelabs.chGive us a ⭐️ onGitLabLicenseWe, the UniteLabs AG, provide and maintain this free and open-source framework with the aim to enable the community to
overcome any barriers in digitalizing their laboratory environment. We highly appreciate, if the users of this framework
value the same principles. Therefore, if you want to make your connectors available for others, we encourage you to
share them on our sharing platform, theUniteHub. As we do not want to enforce disclosure of
your work, we distribute this framework under theMIT license.
Package: unitelabs-sila
SiLAThis repository is an un-opinionated library that provides you with all means to develop a SiLA 2 1.1 compliant python
application. It adheres to theSiLA 2 specificationand is used by theUniteLabs
Connector Frameworkto enable rapid development of cloud-native SiLA
Servers with a code-first approach.InstallationThe SiLA library requires Python 3.9 or later. To get started quickly, we recommend to use theUniteLabs Connector
Frameworkto develop your SiLA 2 server. Clone one of the starter
projects with:$ git clone https://gitlab.com/unitelabs/connector-starter.git my-connector
$ cd my-connector
$ poetry install
$ poetry run connector startYou can also manually create a new project from scratch and install the library with pip. In this case, of course,
you'll be responsible for creating the project boilerplate files yourself.$ pip install unitelabs-silaDocumentation🧱🚧🏗️ This is still work in progress 🧱🚧🏗️ContributeSubmit and share your work!https://hub.unitelabs.chPlease submit your feature requests and bug reports using the GitLab issue system with a clear description.
If you have further questions, issues, or suggestions for improvement, don't hesitate to reach out to us atdevelopers@unitelabs.ch.Join the Python channel in theSiLA Slackworkspace to stay up-to-date with new developments and announcements from the community.LicenseThis code is licensed under theMIT license.
Package: unitestify
Unitestify - Generate skeleton test file from Python file.Support Unnitests and Django tests.How to use this package?pythonunitestify--help
Usage:unitestify.py[OPTIONS]Unitestifycommandlinearguments.

Options:--fileTEXTPathtofilefromwhichtogeneratetestfile--typeTEXTTypeoftesttogenerate--helpShowthismessageandexit.There are two commands available:
*--file- Requires path to a Python file from which you want to generate the base test file.
*--type- Test type,unittesteitherdjangoExampledata.pyclassManager:defmanage_data(self):return"Managing data"defretrieve_data(self):return"Retrieved data"Here is our output file.test_data.pyimportunittestclassTestManager(unittest.TestCase):"""TestManager."""deftest_manage_data(self):"""Test manage data."""deftest_retrieve_data(self):"""Test retrieve data."""
Package: unite-toolbox
UNITE ToolboxUnified diagnostic evaluation of physics-based, data-driven and hybrid hydrological models based on information theoryThis repository contains code for the UNITE set of tools based on information theory for the diagnostic evaluation of hydrological models. In the UNITE tools we have functions to calculate different quantities used in information theory: entropy $H(X)$, Kullback-Leibler divergence $D_{KL}(p||q)$, mutual information $I(X; Y)$, using different methods. More specifically, the methods implemented are:Kernel density based estimation (KDE)Binning using histogramsk-nearest neighbor based estimation (kNN)InstallationAlthough the code is still highly experimental and in very active development, a release version is hosted in PyPI and can be installed usingpip. Check thepyproject.tomlfor requirements. The current state of the toolbox can be installed directly from this repository usinggit.pip install unite_toolboxHow-toIn the folderexamples\please find a tutorial on the general usage of the toolbox.
Package: unitexlemmatizer
This is a simple module for lemmatization based on the Unitex inflected word
list. As such, it needs a Unitex vocabulary file in order to work properly.So far, I’ve only worked with Portuguese, with theDELAF_PB fileprovided by NILC.InstallingYou can either clone the repository and install with$pythonsetup.pyinstallor install through pip$pipinstallunitexlemmatizerUsageIn order to use the Unitex Lemmatizer, you need to tell it where the word list
is:>>>importunitexlemmatizerasul>>>ul.load_unitex_dictionary('/path/to/delaf.dic')Then, you can call theget_lemmafunction passing the inflected word and its
part of speech tag (from theUniversal Dependenciestagset).>>>ul.get_lemma('corpora','noun')'corpus'
Package: unit-gears
unit_gearsUnit Fishing Gears intensity model and library for industrial ecology research.Unit Gear ModelSchematic diagram of the unit gear model as three distinct stages that each transform an input variable to an output variable. The dimensions of each variable are reported in square brackets.Included Data SourcesLibrary models are included in themodelsdirectory of the repository.  Eachjsonfile is read for the following fields:source_Every field starting with this string is added to a source documentation stringeffort_modelslist of effort intensity modelsgear_modelslist of gear intensity modelsdissipation_modelslist of dissipation modelsFilenameContentsAkyol 2012.jsonTurkey; driftnets; AlbacoreAvadi 2014.jsonPeru; purse seine; AnchovetaDeshpande 2020.jsonNorway; dissipation for 6 gear typesGabr 2012.jsonEgypt; pelagic longline; AlbacoreGilman 2020-pre.jsonGlobal; dissipation estimates revised from Richardson et al (2019)Grimaldo 2019.jsonNorway; set gillnets; codHoffman 2009.jsonUSA; Trawl gear intensity; Atlantic Croaker and White PerchLaissane 2011.jsonMozambique; small-scale purse seine; sardine, anchovyLaso 2017.jsonSpain; purse seine; European anchovyLCI Model.jsonGeneric "trivial" effort-model for LCI-based gear studiesPravin 2016.jsonIndia; purse seine gear intensitySala 2019.jsonMediterranean; trawl gear intensity meta-analysisSoldo 2019.jsonCroatia; purse seine; anchovyThrane 2006.jsonDenmark; Gear intensity by fuel economy; trawl and Danish seineWatanabe 2016.jsonJapan; small-scale trawl
Package: unitgen
unitgenGenerate unit tests boilerplate codeThis is a simple tool to generate boilerplate code for unit tests. It is for those developers who are not able to follow TDD (Test Driven Development) for few methods and want to write unit tests for them after writing the actual code.All the test files are generated in a folder named "tests" if it does not exist.Example:
examples/calci.pyimportmathclassCalci:def__init__(self):print("Calci class created")defadd(self,a,b=0):c=a+breturncdefsub(self,a,b):returna-bclassStringCalci:defconcat(self,a,b):returna+bdefrepeat(self,a,b):returna*bRun unitgen from command line:# View how to use unitgenunitgen# all files under examples directory are processedunitgenexamples# Files calci.py and pay_handler.py are processedunitgenexamples/calci.pyexamples/pay_handler.pyGenerated result:
tests/test_calci.pyfromunittestimportTestCasefromexamples.calciimportCalci,StringCalciclassTestCalci(TestCase):defsetUp(self):""" Set up objects for each test """self.calci=Calci()deftest___init__(self):""" Test initialiser """self.obj=Calci()deftest_add(self):a=Noneb=Noneactual_result=self.calci.add(a,b)expected_result=Noneself.assertEqual(actual_result,expected_result)deftest_sub(self):a=Noneb=Noneactual_result=self.calci.sub(a,b)expected_result=Noneself.assertEqual(actual_result,expected_result)deftearDown(self):""" Destroy objects after each test """classTestStringCalci(TestCase):defsetUp(self):""" Set up objects for each test """self.string_calci=StringCalci()deftest_concat(self):a=Noneb=Noneactual_result=self.string_calci.concat(a,b)expected_result=Noneself.assertEqual(actual_result,expected_result)deftest_repeat(self):a=Noneb=Noneactual_result=self.string_calci.repeat(a,b)expected_result=Noneself.assertEqual(actual_result,expected_result)deftearDown(self):""" Destroy objects after each test """Enjoy!My Github profile:susmitpyMy Linkedin profile:susmit vengurlekarMy Medium profile:susmit.py
Package: unithandler
This is a package for managing and interacting with units. The focus of
the package is to provide numeric type objects (e.g.floatandint)
which also have aunitattribute. The three core classes of this
package areUnit,UnitFloat, andUnitInt.While there are a variety of packages which support units, this
package focused on enabling straightforward implementation of units
without affecting Pythonic functionality of the numbers.Additionally, theUnitFloatclass was designed to represent the
magnitude of the stored value as best as possible with an appropriate
SI prefix. The value stored is scaled in its representation, but remains
locked to a specified prefix when operated upon. For example,0.005with the unit'L'would be represented as5 mLif printed, but will
behave as0.005for any numeric operations. This was implemented to
automatically keep track of the scale of a unit while allowing the user
to easily visualize the magnitude of the stored value.Installationunithandleris registered on PyPI.pip install unithandlerSource files may be found in theGitLab repository.TheUnitclassThis class handles all unit-associated attributes and methods. Theunitattribute returns an appropriately formatted unit (complete with
superscripts) as a string. Units are managed in dictionary format,
associating a power to each unit denoted. The class (and its subclasses)
are structured) so that the units may be easily modified using python
built-in multiplication and division operators (exactly as one would
track units with pen and paper).TheUnitFloatclassTheUnitFloatclass is afloat-like numeric class that has an
associated unit. The class has all defined Python magic methods, which
enable all appropriate modifications and operations on or byUnitFloatobjects. Typically, the return of each magic method is anotherUnitFloatinstance, but see theUnitFloatdocumentation for further details.Known limitationsSince this package is written entirely in Python, it does not provide
direct access to values as the truefloatandintwould. As such,
some errors or unintended functionality may be encountered.Currentlynumpysupport is limited to basicufuncimplementation.
Unexpected behaviour may be encountered when performingnumpyoperations onUnitFloatorUnitInt. We are working to implement full
support for vectorized operations on the numeric classes in this package.
To the best of our knowledge, themathpackage is fully supported, so
any numeric operations should be performed with that package while we
work to enable numpy support.