Skip to main content

Bubble Sort Python

Bubble Sort Python is a Python module for dealing with bubble sort needs in python. Although python already has an in-built sort mechanism — sort() I thought this would be a fun project!

Installation

Use the package manager pip to install Bubble Sort Python.

pip install bubble-sorter

Usage

##Basic Sorting

from bubble_sorter import *

sort(2, 1, 3, 19, 8, 4) # returns [1, 2, 3, 4, 8, 19]
sort('goose', 'duck', 'cow', 'chicken', 'horse') # returns ['chicken', 'cow', 'duck', 'goose', 'horse']
rev_sort(2, 1, 3, 19, 8, 4, order = 'desc') # returns [19, 8, 4, 3, 2, 1]

##Using Speed Test

from bubble_sorter import *

speed_test(n) # n is a positional argument and is the number of values you want to sort in the speed test. The function tells you the amount of time it took to complete the test sort.

More Options: type, range, order, verbose

speed_test(n, type = 'str') 
speed_test(n, type = 'int') # default

# type is a keyword argument. You can make it equal to 'str' or 'int' which is the default. Using type = 'str' sorts random words from a collection of the 10,000 most common English words. type = 'int' sorts n numbers between 0 and 99 if no range is specified.

speed_test(n, range = (1, 10)) # this sorts n numbers between 1 and 10 and returns the time taken

# range is a keyword argument. You can make it equal to any tuple. The default is (0, 99). It defines the range of random numbers that will be generated for the speed test.

speed_test(n, order = 'asc') # default
speed_test(n, order = 'desc')

# order is a keyword argument. You can make it equal to 'asc' (ascending order) or 'desc' (descending order). The default is 'asc'. It defines the order in which the list will be sorted. 

speed_test(n, verbose = True)
speed_test(n, verbose = False) # default

# verbose is a keyword argument. You can make it equal to True or False. The default is False and does not print the sorted list. Use it to print or not pront the sorted list. 

Support/Contributions

Raise an issue here

License

MIT

Metadata

Release files for bubble-sorter 2.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bubble-sorter 2.0.6
File Size Uploaded Provenance
bubble-sorter-2.0.6.tar.gz 3.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bubble-sorter 2.0.6
File Interpreter ABI Platform
bubble_sorter-2.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 6.2 kB

Release files / bubble-sorter-2.0.6.tar.gz

Download URL bubble-sorter-2.0.6.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b81256777275722ce80d6cb9d2b9dff84acd0ee8fd0ce7dbec6c6ea5c59be5b9
BLAKE2b-256 checksum
How to use checksums
8bb1f7f984e7c516d3ac6b75b79e0ce09dc83991ce2ef717608f3288cff88934
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.4

Release files / bubble_sorter-2.0.6-py3-none-any.whl

Download URL bubble_sorter-2.0.6-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3b7824405b2771fa0fc97a3e3ec07766ea8684e6fca5cf7685569c327fd6cb7
BLAKE2b-256 checksum
How to use checksums
e7b7f130b8721d41aa4575bd460d7b3534629a3ab36d0198178934af3370223a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.4

Security for bubble-sorter 2.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page