A project containing packages common to various other Python projects.
Project description
Table of Contents
About Corny Commons
Corny Commons is a Python package containing modules for use by Konrad Guzek. They are used projects such as Dzwonnik 2 and other private work-in-progress projects.
Contents
There are currently two core modules and one package inside Corny Commons: the console_graphics and file_manager modules, and the util package.
Standalone modules
1. console_graphics.py
This module contains a graphics engine that can display a text-based GUI, rather than having to rely on window managers such as Tkinter or Pygame. It's useful for quick console output for games or simulators. It's currently used in projects such as lcd-display or console-dino.
2. file_manager.py
This module contains many functions related to file handling on the server as well as general input/output.
log() -- Formats and outputs a log message both to the terminal and a log file, defaulting to a file called .log in the current working directory.
read_env() -- Reads the file in .env in the current working directory and applies the environment variable assignments contained within it.
... and more!
Packages
1. util
As you can guess, this package contains more specific, utility-oriented modules.
a) web.py
The web module implements functionality for creating web requests. It is used in various web APIs that must retrieve information from an external source. In essence, this module is a wrapper around the built-in requests module.
make_request() -- takes a URL and creates a web request to that address. If the function has been called before the maximum request cooldown has passed, web.TooManyRequestsException is raised. Otherwise, the request is made. If the response is not retrieved within 10 seconds, or if it returns a response with a HTTP code that is not between 200-299, raises web.InvalidResponseException. If all checks pass, returns the response object.
get_html() -- makes a request using the make_request() function, then decodes the binary content and returns it as a string.
b) currency.py
The currency module contains functions that utilise a public API to get the latest currency exchange information and provide it as-needed for a given fiat currency.
convert() -- this function converts a value from one currency into another.
c) polish.py
Since Konrad Guzek is Polish by blood and currently lives in the Silesian area of Poland at the time of writing, some projects involve the Polish language. It is a complex language that has in-depth conjugation rules, which means that lots of boilerplate code has to be used when dealing with worded numbers, for example. This module contains code that was necessary for a project and may see future use in other projects.
conjugate_numeric() -- this function correctly conjugates a noun when used with a quantifing number, since the noun form changes depending on the amount of the item that is present. Take for example the word jabłko meaning 'apple': 1 apple would be 1 jabłko, 2 apples would be 2 jabłka, and 7 apples would be 7 jabłek -- note the suffix change.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file corny_commons-1.0.2.tar.gz.
File metadata
- Download URL: corny_commons-1.0.2.tar.gz
- Upload date:
- Size: 46.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79b538ffd420afc013316e610a623a78f60a8544556c604affd1abcd879ec9ba
|
|
| MD5 |
1ccf112731f578e39ac8271126696595
|
|
| BLAKE2b-256 |
9682c922ef25e6fc233b0f41f2442942df8bc2eedacc2e2b63a686d516700699
|
Provenance
The following attestation bundles were made for corny_commons-1.0.2.tar.gz:
Publisher:
python-publish.yml on kguzek/corny-commons
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
corny_commons-1.0.2.tar.gz -
Subject digest:
79b538ffd420afc013316e610a623a78f60a8544556c604affd1abcd879ec9ba - Sigstore transparency entry: 157647022
- Sigstore integration time:
-
Permalink:
kguzek/corny-commons@a8817803fae01261e49defd55f168389ac9b21a3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kguzek
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@a8817803fae01261e49defd55f168389ac9b21a3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file corny_commons-1.0.2-py3-none-any.whl.
File metadata
- Download URL: corny_commons-1.0.2-py3-none-any.whl
- Upload date:
- Size: 34.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
063761b5341c3053dc89845693238bfc1a1262be0f666cf73b72094956a956cc
|
|
| MD5 |
2f657d8216c72540623e556d7a2bb7db
|
|
| BLAKE2b-256 |
a76938628693d0b2e5e4541198dfba9112da4391b46054f6568c59a21480c6fd
|
Provenance
The following attestation bundles were made for corny_commons-1.0.2-py3-none-any.whl:
Publisher:
python-publish.yml on kguzek/corny-commons
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
corny_commons-1.0.2-py3-none-any.whl -
Subject digest:
063761b5341c3053dc89845693238bfc1a1262be0f666cf73b72094956a956cc - Sigstore transparency entry: 157647023
- Sigstore integration time:
-
Permalink:
kguzek/corny-commons@a8817803fae01261e49defd55f168389ac9b21a3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kguzek
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@a8817803fae01261e49defd55f168389ac9b21a3 -
Trigger Event:
push
-
Statement type: