Saravanan666/pypi-org huggingface dataset:
Package: calculator-gkukse
About the packagemy_calculator.py is cource code for a Python Package calculator, which performs math task: Addition, Subtraction, Multiplication, Division, (n) root of a number, Reset memory. The Functions take in floats or integers as arguments and return the sum of operations until asked to reset memory.testing.py is a test code aimed to my_calculator.pyHere's an example of functions
'''
calculator.Addition(4)4.0
calculator.Subtraction(1)
3.0
calculator.Multiplication(9)
27.0
calculator.Division(3)
9.0
calculator.Root(2)
3.0
calculator.Reset_memory()
0.0
'''Getting SetupInstall Python 3.6.1 or later fromhttps://www.python.orginstall the Calculator package:
'''
pip install calculator_gkukse
'''
Package: calculatorGS
calculatorGSThe calculatorGS is a state-of-the-art calculator module for Python. It lets you perform calculation tasks
not only by adding or subtracting numbers, but also by using advanced techniques such as multiplication,
division or even taking an nth root of the number.This is by far not a complete module. Many more features could be included in the future versions. Some
of them are:Add more operations, such as exp, ln, sin, cos, etc.Tests could be more thorough. Current tests do not check every function. * Instruction could probably be a bit clearer. Readme file needs some fine tuning.An example>fromcalculatorGSimportCalculator>calc=Calculator()>calc.add(8)>calc.divide(2)>calc.root(2)>calc.display()Currentcalculatorvalue:2InstallationInstall calculatorGS module using pip:python-mpipinstallcalculatorGSTestingTesting of the modules requires pytest and hypothesis. Tests can be run after installation with:pytesttest_calculator.pyLicenseCopyright Holger Krekel and others, 2004.
Distributed under the terms of the MIT license, pytest is free and open source software.
Package: calculator_gskv_m1_s1
Calculator_gskv_m1_s1Calculator_gskv_m1_s1 is a Python module for performing simple mathematical operations.InstallationUse the package managerpipto install calculator_gskv_m1_s1.pipinstallcalculator_gskv_m1_s1Usageimportcalculator_gskv_m1_s1ascalc# Initiates a calculator object with a default value of 0calculator=calc.Calculator()# Returns the current value of the calculator objectcalculator.current_value# Adds float or int argument to the current value and returns the resultcalculator.add(float)# Subtracts float or int argument from the current value and returns the resultcalculator.subtract(float)# Multiplies the current value by float or int argument and returns the resultcalculator.multiply(float)# Divides the current value by float or int argument and returns the resultcalculator.divide(float)# Raises the current value to the power of float or int argument and returns the resultcalculator.exponentiate(float)# Takes the root of the current value taking the float or int argument as root indexcalculator.root(float)# Resets the current value to zero returns current valuecalculator.reset()TestingAfter making changes to the module tests should be run.
Testing the package that is installed can be done by runningpytestpytestTesting the package that is not installed can be done by invoking pytest trough the python interpreterpython-mpytestContributorsGediminas SkvarnavičiusWith the help of Turing CollegeLicenseMIT
Package: calculator-halimah
CalculatorThis is a lightweight calculator package for performing simple calculation operations such as addition, subtraction, multiplication, division, root, and reset. For each operation, it takes only one input number and combines it with the current value in the calculator memory. The memory value can be reset at any time.FeaturesAddition : Adds input value to memory valueSubtraction : Subtracts input value from memory valueMultiplication : Multiplies input value by memory valueDivision : Divides input value by memory valueRoot : Returns the input value root of the memory valueReset : Resets memory value to zeroTechnology/ToolsPython : To build the packageDocker : To containerize the packagePytest : To test the packageInstallationRun any of the commands below for installation:To install the package from PyPI$python3-mpipinstall--index-urlhttps://test.pypi.org/simple/--no-depscalculator-halimahTo install from github$pipinstallgit+https://github.com/halimahO/calculator.gitTo get image from dockerhub$FROMhaleemah/calculatorContributionTo contribute or extend this packageClone the package usinggit clone https://github.com/halimahO/calculator.gitInstall dependencies usingpip install -r requirements.txtRun the project usingsrc/calculator/python calculator.pyRun the tests usingtests/pytestAdd contributions or make changesWrite tests if requiredRun tests again to ensure the changes doesn't break anythingPush the changes to a new branchRaise a pull requestSample UsageThis calculator always uses the memory value as the start value, remember to reset to start a new calculation. For example:2 + 3 -- Will start by running add 2, then add 34 - 2 -- Will start by running add 4, then subtract 22 * 5 -- Will start by running add 2, then multiply 56 * 3 -- Will start by running add 6, then divide 33√4 -- Will start by running add 4, then root 3Usage example for each method is given belowfromcalculator.calculatorimportCalculatorcalculator=Calculator()$calculator.add(5)$calculator.subtract(3)$calculator.multiply(3)$calculator.divide(3)$calculator.root(2)$calculator.reset()TestingTo run the tests, cd to 'tests' directory and run$pytestAcknowledgementTuring CollegeLicenseThis project is licensed under the terms of the MIT licenseAuthorHalimah Oladosu
Package: calculator-JN
CalculatorOverviewThis Calculator is a simple Python class designed to perform basic arithmetic operations including addition, subtraction, multiplication, and division. It can also calculates the n-th root of a number and reset the current result.FeaturesBasic Arithmetic Operations: Perform addition, subtraction, multiplication, and division.N-th Root Calculation: Calculate the n-th root of the current result.Reset Memory: Calculator has its own memory and it manipulates its starting number 0 until it is reset.Input Validation: Validates all inputs to ensure they are numeric.Error Handling: Handles invalid root calculations when the root is even and the number is negativeInstallationThis package has been uploaded on PyPI and you can install it using pippip install calculator-JNUsageInitializationCreate an instance of the Calculator class:from calculator import Calculator
calc = Calculator()Performing OperationsYou can perform arithmetic operations as follows:result = calc.add(5)
result = calc.subtract(2)
result = calc.multiply(3)
result = calc.divide(4)
result = calc.n_root(2)Resetting the CalculatorReset the calculator to its initial state:calc.reset()RequirementsPython 3.xLicenseThis project is licensed under the MIT License - see theLICENSEfile for details.
Package: calculator-kazbad
About CalculatorThis Calculator is created as my very first project for Turing College, Sprint 1. 08 February, 2023.FunctionalityThis is a Calculator that can be used to:Add numbers;Subtract numbers;Multiply numbers;Divide numbers;Take nth root of a positive numbers.Calculator has its own memory which can be reset, like in a pocket calculator.Calculator has user-friendly command line interface, where possible commands are outlined, and calculation results are displayed.InstalationThis package is uploaded to PiPI and can be installed using pip command:
pip install calculator_kazbadTo start calculating:Run python (i.e. macOS shell enter: % python)Enter: from calculator_kazbad import calculatorCalculator should start running and greet you with list of commands.ExampleFirs command line prompt outlines the possible operations and user inputs to utilise it. Calculations start with internal memory value of 0. For example:input: +
input: 1
output: Answer: 1.0Calculations can continue with a new internal memory value (continuing from previous example):input: +
input: 1
output: Answer: 2.0If memory value is 0, and multiplication of division operation is chosen, user is asked to input new value, for example:input: Answer: 0.0
input: *
input/output: Type a new multiplier: 10
input/output: Type a multiplicand: 5
output: Answer: 50.0If n-th root operation is attempted with negative memory value, user is asked to input new value, for example:Answer: -60.0
n
Type a new positive radicand: 9
Type a root index: 2
Answer: 3.0TestingCalculator methods was tested using 'pytest' package and it passed all 6 tests. Additionally this package has test.py file to repeat tests independently.FeedbackFeedback and improvement suggestions on this package is appreciatd. You can create a pull request or open an issue in GitHub.LicenseMIT
Package: calculatorkz
calculatorkzcalculatorkzis the package of automated calculator and performing simple arritmetics operations likeaddition, subtraction, multiplication, division and n-root.InstallationpipinstallcalculatorkzHow to useAutomated calculatorCall automated calculator and package functions:>>>fromcalculatorkzimportCalculator>>>calculator()Selectoperation:0.Exit1.Add2.Subtract3.Multiply4.Divide5.Take(n)root6.ResetcalculatorEnterchoice(0/1/2/3/4/5/6):After imported package functioncalculator()initiates automated calculator, which asks you select one of the action/operation you would like to be performed. Thus, enter the choise - integer number from 0 to 6. Then you will be asked to enter the number you want operation would be applied to.Automated calculator has memory, which at the begining starts from 0. But after the operation and number entering it accumulates,
e.g.0 + 2 = 2, 2*3 = 6, 6/2=3, etc.The memory can be reseted after selection of 6.To keep the calculation further enteryes, to end calculation answerno. Exit calculation can be by entering 0 on the choise selections step.For examples:>>>calculator()Selectoperation:0.Exit1.Add2.Subtract3.Multiply4.Divide5.Take(n)root6.ResetcalculatorEnterchoice(0/1/2/3/4/5/6):1Enteryournumber:2Result:0.0+2.0=2.0Let's do next calculation? (yes/no): yesEnterchoice(0/1/2/3/4/5/6):3Enteryournumber:3Result:2.0*3.0=6.0Let's do next calculation? (yes/no): yesEnterchoice(0/1/2/3/4/5/6):2Enteryournumber:4Result:6.0-4.0=2.0Let's do next calculation? (yes/no): yesEnterchoice(0/1/2/3/4/5/6):6Resetto:0Let's do next calculation? (yes/no): yesEnterchoice(0/1/2/3/4/5/6):5Enteryournumber:9Result:0.0^(1/9.0)=0.0Let's do next calculation? (yes/no): yesEnterchoice(0/1/2/3/4/5/6):1Enteryournumber:9Result:0.0+9.0=9.0Let's do next calculation? (yes/no): yesEnterchoice(0/1/2/3/4/5/6):5Enteryournumber:2Result:9.0^(1/2.0)=3.0Let's do next calculation? (yes/no): yesEnterchoice(0/1/2/3/4/5/6):4Enteryournumber:2Result:3.0/2.0=1.5Let's do next calculation? (yes/no): noFinalresult=1.5Calculator class methodsIn this package you can allso use class methods, e.g.Create the object of two values:>>>x1=2>>>x2=3>>>obj=Calculator(x1,x2)>>>obj<calculatorkz.Calculatorobjectat0x101b6dde0>Add them:>>>obj.add()5Substract two values:>>>obj.subtract()-1Multiply two values:>>>obj.multiply()6Divide them:>>>obj.divide()0.6666666666666666Take x2 root from x1:>>>obj.n_root()1.2599210498948732LicenseMIT
Package: calculatorkzv1
calculatorkzv1calculatorkzv1is the package of automated calculator and performing simple arritmetics operations likeaddition, subtraction, multiplication, division and n-root.Installationpipinstallcalculatorkzv1How to useAutomated calculatorCall automated calculator and package functions:>>>fromcalculatorkzv1.calculatorkzv1importCalculator,calculator>>>calculator()Selectoperation:0.Exit1.Add2.Subtract3.Multiply4.Divide5.Take(n)root6.ResetcalculatorEnterchoice(0/1/2/3/4/5/6):After imported package functioncalculator()initiates automated calculator, which asks you select one of the action/operation you would like to be performed. Thus, enter the choise - integer number from 0 to 6. Then you will be asked to enter the number you want operation would be applied to.Automated calculator has memory, which at the begining starts from 0. But after the operation and number entering it accumulates,
e.g.0 + 2 = 2, 2*3 = 6, 6/2=3, etc.The memory can be reseted after selection of 6.To keep the calculation further enteryes, to end calculation answerno. Exit calculation can be by entering 0 on the choise selections step.For examples:>>>calculator()Selectoperation:0.Exit1.Add2.Subtract3.Multiply4.Divide5.Take(n)root6.ResetcalculatorEnterchoice(0/1/2/3/4/5/6):1Enteryournumber:2Result:0.0+2.0=2.0Let's do next calculation? (yes/no): yesEnterchoice(0/1/2/3/4/5/6):3Enteryournumber:3Result:2.0*3.0=6.0Let's do next calculation? (yes/no): yesEnterchoice(0/1/2/3/4/5/6):2Enteryournumber:4Result:6.0-4.0=2.0Let's do next calculation? (yes/no): yesEnterchoice(0/1/2/3/4/5/6):6Resetto:0Let's do next calculation? (yes/no): yesEnterchoice(0/1/2/3/4/5/6):5Enteryournumber:9Result:0.0^(1/9.0)=0.0Let's do next calculation? (yes/no): yesEnterchoice(0/1/2/3/4/5/6):1Enteryournumber:9Result:0.0+9.0=9.0Let's do next calculation? (yes/no): yesEnterchoice(0/1/2/3/4/5/6):5Enteryournumber:2Result:9.0^(1/2.0)=3.0Let's do next calculation? (yes/no): yesEnterchoice(0/1/2/3/4/5/6):4Enteryournumber:2Result:3.0/2.0=1.5Let's do next calculation? (yes/no): noFinalresult=1.5Calculator class methodsIn this package you can allso use class methods, e.g.Create the object of two values:>>>x1=2>>>x2=3>>>obj=Calculator(x1,x2)>>>obj<calculatorkz.Calculatorobjectat0x101b6dde0>Add them:>>>obj.add()5Substract two values:>>>obj.subtract()-1Multiply two values:>>>obj.multiply()6Divide them:>>>obj.divide()0.6666666666666666Take x2 root from x1:>>>obj.n_root()1.2599210498948732LicenseMIT
Package: calculator-linpel-calc
Basic CalculatorA basic Python class for arithmetic calculations.Calculatorperforms simple arithmetic calculations:Addition / SubtractionMultiplication / DivisionTake (n) root of a number.InstallationYou can incorporate the Calculator class into your Python project by importing it :InstallationYou can incorporate theCalculatorclass into your Python project by importing it :pipinstallcalculator_linpel_calcUsage/ExamplesSetting up a calculatorTo set upCalculatorcalss by importingCalculatorfromcalculator_linpel_calcand creating an instance.fromCalculator.CalculatorimportCalculator# Creata an instance of the Calculatorcalculator=Calculator()Executing Calculator operationsTheCalculatorclass able is able to perform calculations:Addition(*arg: float): Sum numbers.Subtraction(*arg: float): Subtract numbers.Multiplication(*arg: float): Multiply numbers together.Division(*arg: float): Divide numbers.Root(nth_root: float, number: float): Take nth root of number.
Example of Usagecalculator=Calculator()calculator.Addition(1,2,3)# Adds 1, 2, 3, result: 6.0calculator.Subtraction(1,2,3)# Subracts 1, 2, 3 from self.memory = 0, result: -6.0calculator.Multiplication(7,3)# Multiplies 7 by 3, result: 21.0calculator.Division(9,3)# Divides 9 by 3, result: 3.0calculator.Root(2,9)# Takes n-th root (2) of 9, result: 3.0Error HandlingTheCalculatorclass raises aZeroDivisionErrorwhen attempting to divide by zero, or 0 root calculations.LicenseThis code is released under theMIT License
Package: calculator-mega99
Basic CalculatorCommandsadd(a, b)sub(a, b)mul(a, b)div(a, b)add_one(a)sub_one(a)sq(a)sqrt(a)ex(a, b)cbrt(a, b)randnum(a, b)sin(a)cos(a)tan(a)asin(a)acos(a)atan(a)atan2(a, b)fib(a)cosec(a)sec(a)cot(a)How To Importfrom calculator_mega99.calculator import *How To Installpip install calculator_mega99
Package: calculator-mgaidy
Calculator_mgaidyOverviewA basic calculator class that supports arithmetic operations and maintains a history log.InstallationYou can install the Calculator_mgaidy package using pip:pip install calculator-mgaidy==0.0.7Attributesmemory(float): The current memory value of the calculator.logs(List[str]): A list to store the history log of operations.precision(int): The precision to round results to.ConstantsMAX_NUMBER(float): The maximum allowed absolute value of number in calculations.MAX_POWER_LEVEL(int): The maximum allowed power level for exponentiation.MAX_PRECISION(int): The maximum allowed power level for exponentiation.MethodsEach of the functions below have validations set in place to ensure that inputs and results are allowed values.
Precision must be more than zero but less than 300. By default 10.
Numbers maximum allowed absolute value is 1e300. (applies to input and output)
Power and root inputs must be more than zero but less than 300.set_precision(self, precision: int) -> NoneSet the precision for rounding results.reset_memory(self) -> floatReset the calculator memory to zero and clear the history log.print_history_logs(self) -> Noneprints out log of operations since last reset.add(self, number: float) -> floatAdd a number to the calculator memory.subtract(self, number: float) -> floatSubtract a number from the calculator memory.multiply(self, number: float) -> floatMultiply the calculator memory by a number.divide(self, number: float) -> floatDivide the calculator memory by a number.power(self, number: float) -> floatRaise the calculator memory to the power of a given number.root(self, number: float) -> floatCalculate the root of the calculator memory with a given exponent.Usage ExamplefromcalculatorimportCalculator# Create a calculator instancecalc=Calculator()# Perform operationsresult=calc.add(5)print(result)# Output: 5.0result=calc.multiply(3)print(result)# Output: 15.0DevelopmentFor development, ensure that you have Python and pip installed. You can set up a virtual environment:sourcevenv/bin/activate# On Windows, use `venv\Scripts\activate`ContributingFeel free to contribute to this project by submitting bug reports, feature requests, or pull requests.TestingRun the tests to ensure everything is working as expected:pytestLicenseThis project is licensed under the MIT License- see theLICENSEfile for details.
Package: calculator-module
Arithmetic Calculator ModuleThis module is a simple arithmetic calculator. It can perform addition, subtraction, multiplication, and division. It can also perform square root and resetting opertations.Installation via pipUse the package managerpipto install the module.pipinstallcalculator-moduleInstallation via DockerUse the package managerdockerto install the module.dockerpullminasefikadu/calc_imageUsagefromcalculatorimportCalculatorcalculator=Calculator()calculator.add(2)# adds 2 to the current valuecalculator.subtract(10)# subtracts 10 from the current valuecalculator.multiply(50)# multiplies the current value by 50calculator.divide(2)# divides the current value by 2calculator.square_root(9,2)# returns the nth root of the current value# in this case, the square root of 9calculator.reset()# resets the current value to 0ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Package: calculator_olu_ile
CalculatorArithmetic calculator with operations add, subtract, divide, multipy and root.Installationpipinstallcalculator_olu_ileUsageForexample:AdditionwithpackageonIDLE>>>fromcalculator_olu_ile.calculatorimportCalculator>>>cal=Calculator()>>>cal.add(2)>>>print(cal.accum)2>>>cal.add(2)>>>print(cal.accum)4Forexample:SubtractionwithpackageonIDLE>>>fromcalculator_olu_ile.calculatorimportCalculator>>>cal=Calculator()>>>cal.subtract(2)>>>print(cal.accum)-2>>>cal.subtract(2)>>>print(cal.accum)-4Forexample:MultiplicationwithpackageonIDLE>>>fromcalculator_olu_ile.calculatorimportCalculator>>>cal=Calculator()>>>cal.multiply(2)>>>print(cal.accum)0>>>cal.accum=2>>>cal.multiply(2)>>>print(cal.accum)4Forexample:DividewithpackageonIDLE>>>fromcalculator_olu_ile.calculatorimportCalculator>>>cal=Calculator()>>>cal.divide(2)>>>print(cal.accum)0.0>>>cal.accum=2>>>cal.divide(2)>>>print(cal.accum)1.0Forexample:RootwithpackageonIDLE>>>fromcalculator_olu_ile.calculatorimportCalculator>>>cal=Calculator()>>>cal.accum=9>>>cal.root(2)>>>print(cal.accum)3.0Forexample:Is_input_validwithpackageonIDLE>>>fromcalculator_olu_ile.calculatorimportCalculator>>>cal=Calculator()>>>print(cal.is_input_valid("text"))False>>>print(cal.is_input_valid(6))True
Package: calculatorpackage
Getting Started with APIMATIC CalculatorIntroductionSimple calculator API hosted on APIMATICInstall the PackageThe package is compatible with Python versions2 >=2.7.9and3 >=3.4.
Install the package from PyPi using the following pip command:pipinstallcalculatorpackage==1.0.0You can also view the package at:https://pypi.python.org/pypi/calculatorpackageTest the SDKYou can test the generated SDK and the server with test cases.unittestis used as the testing framework andnoseis used as the test runner. You can run the tests as follows:Navigate to the root directory of the SDK and run the following commandspip install -r test-requirements.txt
nosetestsInitialize the API ClientNote:Documentation for the client can be foundhere.The following parameters are configurable for the API Client:ParameterTypeDescriptionenvironmentEnvironmentThe API environment.Default:Environment.PRODUCTIONhttp_client_instanceHttpClientThe Http Client passed from the sdk user for making requestsoverride_http_client_configurationboolThe value which determines to override properties of the passed Http Client from the sdk usertimeoutfloatThe value to use for connection timeout.Default: 60max_retriesintThe number of times to retry an endpoint call if it fails.Default: 0backoff_factorfloatA backoff factor to apply between attempts after the second try.Default: 2retry_statusesArray of intThe http statuses on which retry is to be done.Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]retry_methodsArray of stringThe http methods on which retry is to be done.Default: ['GET', 'PUT']The API client can be initialized as follows:fromapimaticcalculator.apimaticcalculator_clientimportApimaticcalculatorClientfromapimaticcalculator.configurationimportEnvironmentclient=ApimaticcalculatorClient(environment=Environment.PRODUCTION,)List of APIsSimple CalculatorClasses DocumentationUtility ClassesHttpResponseHttpRequest