{"id":20557029,"url":"https://github.com/sharpvik/python-libs","last_synced_at":"2026-05-29T08:32:16.419Z","repository":{"id":114206300,"uuid":"131217942","full_name":"sharpvik/python-libs","owner":"sharpvik","description":"Some Python libs with good readme and comments in code","archived":false,"fork":false,"pushed_at":"2019-07-25T02:02:48.000Z","size":17070,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-06T06:48:32.876Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sharpvik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-26T22:41:11.000Z","updated_at":"2018-11-16T01:03:07.000Z","dependencies_parsed_at":"2023-06-15T23:30:41.620Z","dependency_job_id":null,"html_url":"https://github.com/sharpvik/python-libs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sharpvik/python-libs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpvik%2Fpython-libs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpvik%2Fpython-libs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpvik%2Fpython-libs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpvik%2Fpython-libs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sharpvik","download_url":"https://codeload.github.com/sharpvik/python-libs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpvik%2Fpython-libs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33644285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T03:34:22.388Z","updated_at":"2026-05-29T08:32:16.402Z","avatar_url":"https://github.com/sharpvik.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Libs\n\n## General\n\nThese are just some of the functions that I wrote myself. I didn't write them for external use. I know that there are precompiled binary subroutines in Python that work thousands times faster. I wanted to write these basic functions myself just to prove that I can. That's all.\n\nThere's one thing however, that I like about these functions -- since they are open source, you can easily see how they work and **customize them** for your own purposes.\n\n## Python Modules Applied\n\nTo use any of these _.py_ files as a functions' library:\n\n1. Fork this repo or Download it as a ZIP file;\n2. Put necessary file into your working directory;\n3. In your project's _.py_ file use `import filename` to import all functions from the file or `from filename import functionname` to only import a specific function;\n4. If you've imported the **whole file** you will have to use dot notation to call functions that it contains;\n5. If you've used the second notation to only import **one function**, you can call it buy its name like you would do to a normal function from your file;\n\n```python\n# First method -- importing the whole file\nimport primes\nprimes.check(13)\n```\n\n```python\n# Second method -- importing a specific function from the file\nfrom stringD import reverse\nreverse(\"Hello, world!\")\n```\n\n## Dictionary\n\nHere I will list all the files, functions inside them and their purposes so that you can know what they contain without having to actually look through each and every file. Filenames I will put in **bold**, functions and classes will be *cursive*.\n\n### combinatorics.py\n\n+ *factorial* --\u003e returns factorial (n!) of given number;\n+ *nPr* --\u003e returns number of permutations of n elements for r positions;\n+ *nCr* --\u003e returns number of combinations of n elements for r positions;\n+ *anagram* --\u003e returns list of every possible arrangement of a given string;\n\n### divisors.py\n\n+ *find* --\u003e returns (a) list of divisors; (b) number of divisors; (c) sum of divisors of a given number;\n\n### fistD.py\n\n+ *class Fist* --\u003e class that may be used to create and interact with final state machines that use binary-based input (string consisting of 0s and 1s);\n\n### graphD.py\n\n+ *class Graph* --\u003e class that may be used to create and interact with undirected graphs where edges don't have values (every edge is as good a path as any other edge);\n\n### listD.py\n\n+ *unsorted* --\u003e returns unsorted list of numbers of given size and given range;\n+ *lsum* --\u003e returns sum of a given list of numbers;\n\n### logates.py\n\n+ *_not* --\u003e returns the reverse of binary input;\n+ *_and* --\u003e returns 1 if both inputs were 1, otherwise returns 0;\n+ *_or* --\u003e returns 1 if either of two inputs were 1, otherwise returns 0;\n+ *_xor* --\u003e returns 1 if two inputs were different, otherwise returns 0;\n\n(Each of these methods work with inputs longer than one character, for example you can input 10010)\n\n### mathL.py\n\n+ *power* --\u003e returns given number to the given positive power \u003e 1;\n+ *fib* --\u003e returns i-th number from Fibonacci sequence if i is positive, otherwise returns -1;\n+ *mod* --\u003e returns True if given x is divisible by given y, otherwise returns False;\n+ *intersect* --\u003e returns the intersection of two given lists or sets;\n+ *coprimes* --\u003e returns list of coprimes of a given number;\n+ *gcd* --\u003e returns greatest common divisor of two given numbers;\n+ *floor* --\u003e returns rounded version of a given number (0.5 --\u003e 1; 0.4 --\u003e 0);\n+ *additorial* --\u003e returns sum of all numbers below some given n, including n itself; additorial(3) = 3 + 2 + 1 = 6;\n+ *divisors* --\u003e returns all proper divisors of n (excluding n);\n+ *matadd* --\u003e returns sum of two given matrices;\n+ *matnmul* --\u003e returns the result of multiplying matrix m by some number n;\n+ *matmul* --\u003e returns the result of multiplying matrix m by matrix n;\n+ *minor* --\u003e returns the minor of the given matrix;\n* *det* --\u003e returns a determinant of the given matrix;\n\n### primes.py\n\n+ *check* --\u003e returns True if number is prime, otherwise returns False;\n+ *find* --\u003e returns list of prime numbers less than given limit;\n+ *find_distincts* --\u003e returns (a) list of distinct prime divisors; (b) sum of distinct prime divisors of a given number;\n+ *find_prime_factors* --\u003e returns list of prime factors of n;\n\n### queueD.py\n\n+ *class Queue* --\u003e implementation of Queue datatype;\n\n### search.py\n\n+ *binary* --\u003e returns index of the element in a given list if found, otherwise returns -1;\n+ *linear* --\u003e returns index(s) of the element in a given list if found, otherwise returns -1;\n\n### sort.py\n\n+ *insertion* --\u003e returns sorted list of numbers;\n+ *merge* --\u003e returns sorted list of numbers;\n+ *bubble* --\u003e returns sorted list of numbers;\n\n### stackD.py\n\n+ *class Stack* --\u003e implementation of Stack datatype;\n\n### stringD.py\n\n+ *reverse* --\u003e returns reversed string;\n+ *remove_repeats* --\u003e returns string without repetitions;\n\n## Contact\n\nFor any personal or business enquiries:\n\n+ Email: *sharp.vik@gmail.com*\n+ [Twitter](https://twitter.com/sharp_vik)\n+ [VK](https://vk.com/perigrinus)\n+ [Instagram](https://www.instagram.com/viktooooor)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharpvik%2Fpython-libs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharpvik%2Fpython-libs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharpvik%2Fpython-libs/lists"}