Common Python utilities
Project description
COMMON PYTHON MODULES
Overview
This is a collection of python modules I have created and use in several of my projects. This is just a convenient way for me to keep them in sync across projects. The repo is public so that it can be easily referenced by people using my public projects.
Feedback welcome in the form of a GitHub issue. While I will try to address issues in a timely matter, I only intend to invest in feature requests that align with my project work. Feel free to contribute backward compatible enhancements.
Dependencies
Collectively, these modules rely on the following external libraries:
- loguru
- elementpath
- pytz
- tzlocal
- geopy
- timezonefinder
- aiohttp
- boto3
- requests
- pycountry
- html2text
- packaging
- pyyaml
Setup
To use this submodule in your GitHub repository:
- With your repository's
./srcfolder as the default location, issue the following command:
git submodule add https://github.com/brian-ruf/common-python.git common
- Import the library into your python modules:
from common import * # to import all
# OR
from common import misc # import only one of the modules
Modules
The following modules are exposed to your application via the above instructions:
aws.py: Functions for interacting with AWS servicescountry_code_converter.py: Functions for converting between country code formatsdata.py: Functions for managing and manipulating XML, JSON and YAML contentdatabase.py: Functions for interacting with a database. These functions operate the same for all supported databaseshelper.py: Various helper functionshtml_to_markdown.py: Functions for converting HTML content to Markdownlfs.py: Functions for interacting with the local file system (LFS)logging.py: Logging configuration and utilitiesnetwork.py: Functions for network operationsstats.py: Statistical helper functionstimezone_lookup.py: Functions for timezone lookups based on locationxml_formatter.py: Functions for formatting XML content
The following additional modules are present and support the above, but are not directly exposed:
database_sqlite3.py: Any database-specific interactions are collected in a single file for that database
Project details
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 ruf_common-1.0.1.tar.gz.
File metadata
- Download URL: ruf_common-1.0.1.tar.gz
- Upload date:
- Size: 39.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e0aea460457c74651ff1508b629f3104e1ef7b1377d2b8bb32a50b8d878c07b
|
|
| MD5 |
ca30a228b1f67d7591ece27bb838c528
|
|
| BLAKE2b-256 |
21bf3b5123618608efe1fe61577ddd59b9288045aafeaa123b52d638a6734fc9
|
Provenance
The following attestation bundles were made for ruf_common-1.0.1.tar.gz:
Publisher:
publish.yml on brian-ruf/ruf-common-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ruf_common-1.0.1.tar.gz -
Subject digest:
6e0aea460457c74651ff1508b629f3104e1ef7b1377d2b8bb32a50b8d878c07b - Sigstore transparency entry: 1051458897
- Sigstore integration time:
-
Permalink:
brian-ruf/ruf-common-python@0186a2f6d021f1ba7bd91aed1da76d3e9610cc24 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/brian-ruf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0186a2f6d021f1ba7bd91aed1da76d3e9610cc24 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ruf_common-1.0.1-py3-none-any.whl.
File metadata
- Download URL: ruf_common-1.0.1-py3-none-any.whl
- Upload date:
- Size: 42.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdaf97b8b7f13f1bc77f02c77eb87c6ad01574eb855e97f58bcd011defc9d2b3
|
|
| MD5 |
cf0f80ce94d7f9c098bf788756aade85
|
|
| BLAKE2b-256 |
4d6a45db92f2260ca934495e9405f89e2df98b090424566b3249b3ef6310b85c
|
Provenance
The following attestation bundles were made for ruf_common-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on brian-ruf/ruf-common-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ruf_common-1.0.1-py3-none-any.whl -
Subject digest:
cdaf97b8b7f13f1bc77f02c77eb87c6ad01574eb855e97f58bcd011defc9d2b3 - Sigstore transparency entry: 1051458956
- Sigstore integration time:
-
Permalink:
brian-ruf/ruf-common-python@0186a2f6d021f1ba7bd91aed1da76d3e9610cc24 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/brian-ruf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0186a2f6d021f1ba7bd91aed1da76d3e9610cc24 -
Trigger Event:
release
-
Statement type: