Skip to main content

K-General-Kit 🛠️

This project aims to provide a rich set of useful general functions frequently needed and frequent objects.

Features 💡

  • It contains a general library, for general functions on containiers, string, a bit of mathematics
  • We also find a search_sort library, with powerful search and sort algorithms going from the sequential search to the exponential search and from the select sort to the merge sort.
  • We also have the gen_obj library for frequents objects like math constants with the ability to ameliorate their precisions
  • We also have eval_sequence, which gives powerful functions to evaluate recursive functions, bypassing the recursivity.
  • Thera are also an interesting set of datas going from prime numbers collections to txt dictionnaries (for words counting functions).

Examples of use 📝

from k_general_kit.gen_func import all

print(nel(45)) # prints "quarante cinq"

print(words_sentence("Hello, everyone!", 'en')) # prints "['Hello', 'everyone']"
import k_general_kit.search_sort as ks

tab = [1, 4, 0, -1, 8, 9]

tab_heap = ks.Heap(tab)

print(tab_heap.elements) # prints [-1, 0, 1, 4, 8, 9]

print(tab_heap) # Heap representation of tab before sorting

""" Result
       1 
     ↙   ↘   
   4       0 
  ↙ ↘     ↙ ↘  
-1   8   9 
"""

tab_heap.sort()

print(tab_heap) # Heap representation of tab after sorting

""" Result
      -1
     ↙   ↘   
   0       1 
  ↙ ↘     ↙ ↘  
 4   8   9 
"""
import k_general_kit.search_sort as ks

tab = [1, 4, 0, -1, 8, 9]

ks.merge_sort(tab, start=0, end=-1, ord=1) # We sort tab in the descending order

print(tab) # Result: [9, 8, 4, 1, 0, -1]

ks.quick_sort(tab, start=0, end=-1, ord=0) # We sort tab in the ascending order

print(tab) # Result: [-1, 0, 1, 4, 8, 9]

print(ks.exp_search(0, tab, start=0, end=-1)) # We use exp_search since tab is now sorted, and which is better that dich_search for large tabs

""" Result: 1 """

print(ks.interpol_search(2, tab, start=0, end=-1)) # We use interpol_search since tab is now sorted and which is the best search algorithm for general tabs

""" Result: -1 """

For more tests, use in the project directory the command python -m tests.eval_func or the built-in command in .vscode

Author ✍️

This project was created by KpihX. You can contact me at kapoivha@gmail.com for any questions or suggestions.

License 📄

This project is licensed under the MIT license - see the LICENSE file for more details.

: https://github.com/KpihX

Metadata

Release files for k-general-kit 1.2.0

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

Source distribution (sdist)

Source distribution for k-general-kit 1.2.0
File Size Uploaded
k_general_kit-1.2.0.tar.gz 23.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for k-general-kit 1.2.0
File Interpreter ABI Platform
k_general_kit-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.0 MB

Release files / k_general_kit-1.2.0.tar.gz

Download URL k_general_kit-1.2.0.tar.gz
Size 23.0 MB
Tags Source
SHA-256 checksum
How to use checksums
fdce7f77c2f8835d83c41b75a1819af28424d69a7b29666263c8e6a9658ec7ef
BLAKE2b-256 checksum
How to use checksums
93103d14b0d5f0fe8f3805df83ed4404f56988b4b17b04678b09213b63e64aed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.5

Release files / k_general_kit-1.2.0-py3-none-any.whl

Download URL k_general_kit-1.2.0-py3-none-any.whl
Size 25.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cad61e60727047ec71f8fca4b094bd4a72fe847df1c0c8ce7537537f237d3932
BLAKE2b-256 checksum
How to use checksums
890fc4897777734228202700fe727d1c853f9b8c4ff82b0551d6b1b168800807
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.5

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.0

2 release files

1.0.1

1 release file

1.0.0

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

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