CommonPy<img width="12%" align="right" src="https://github.com/caltechlibrary/commonpy/raw/main/.graphics/commonpy-icon.png">
===============================================
This is a collection of common utility functions and classes that we at the Caltech Library have found useful in our other Python projects.
[![Latest release](https://img.shields.io/github/v/release/caltechlibrary/commonpy.svg?style=flat-square&color=b44e88&label=Latest%20release)](https://github.com/caltechlibrary/commonpy/releases)
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg?style=flat-square)](https://choosealicense.com/licenses/bsd-3-clause)
[![Python](https://img.shields.io/badge/Python-3.6+-brightgreen.svg?style=flat-square)](http://shields.io)
[![PyPI](https://img.shields.io/pypi/v/commonpy.svg?style=flat-square&color=orange&label=PyPI)](https://pypi.org/project/commonpy/)
Table of contents
-----------------
* [Introduction](#introduction)
* [Installation](#installation)
* [Usage](#usage)
* [Getting help](#getting-help)
* [Contributing](#contributing)
* [License](#license)
* [Authors and history](#authors-and-history)
* [Acknowledgments](#authors-and-acknowledgments)
Introduction
------------
This repository does not constitute a single program; instead, it contains a collection of modules with utility functions and classes that we have found ourselves using repeatedly in other Python projects.
Installation
------------
The instructions below assume you have a Python interpreter installed on your computer; if that's not the case, please first [install Python version 3](INSTALL-Python3.md) and familiarize yourself with running Python programs on your system.
On **Linux**, **macOS**, and **Windows** operating systems, you should be able to install `commonpy` with [`pip`](https://pip.pypa.io/en/stable/installing/). To install `commonpy` from the [Python package repository (PyPI)](https://pypi.org), run the following command:
```
python3 -m pip install commonpy
```
As an alternative to getting it from [PyPI](https://pypi.org), you can use `pip` to install `commonpy` directly from GitHub, like this:
```sh
python3 -m pip install git+https://github.com/caltechlibrary/commonpy.git
```
Usage
-----
The basic approach to using this package is to import the modules and functions you need. For example:
```python
from commonpy.file_utils import readable
if readable('/path/to/some/file'):
# do something
```
The following subsections describe the different modules available.
### Data structures
The `data_structures` module provides miscellaneous data classes.
| Class | Purpose |
|----------------|---------|
| `CaseFoldDict` | A version of `dict` that compares keys in a case-insensitive manner |
| `CaseFoldSet` | A version of `set` that compares keys in a case-insensitive manner |
### Data utilities
The `data_utils` module provides a number of miscellaneous simple functions for some common operations on data of various kinds.
| Function | Purpose |
|--------------------|---------|
| `expanded_range(string)` | Given a string of the form "X-Y", returns the list of integers it represents |
| `flattened(thing)` | Takes a list or dictionary and returns a recursively flattened version |
| `ordinal(integer)` | Returns a string with the number followed by "st", "nd, "rd", or "th" |
| `parsed_datetime(string)` | Returns a date object representing the given date string |
| `pluralized(word, n, include_num)` | Returns a plural version of `word` if `n > 1` |
| `sliced(list, n)` | Yields `n` number of slices from the `list` |
| `timestamp()` | Returns a string for an easily-readable form of the current time and date |
| `unique(list)` | Takes a list and return a version without duplicates |
### File utilities
The `file_utils` module provides a number of miscellaneous simple functions for some common operations on files and directories.
| Function | Purpose |
|--------------------|---------|
| `alt_extension(file, ext)` | Returns `file` with the extension replaced by `ext` |
| `copy_file(src, dst)` | Copies file from `src` to `dst` |
| `delete_existing(file)` | Deletes the given `file` |
| `filename_basename(file)` | Returns `file` without any extensions |
| `filename_extension(file)` | Returns the extension of filename `file` |
| `files_in_directory(dir, ext, recursive)` | |
| `filtered_by_extensions(list, endings)` | |
| `nonempty(file)` | Returns `True` if file `file` is not empty |
| `open_file(file)` | Opens the `file` by calling the equivalent of "open" on this system |
| `open_url(url)` | Opens the `url` in the user's default web browser |
| `readable(dest)` | Returns `True` if file or directory `dest` is accessible and readable |
| `relative(file)` | Returns a path string for `file` relative to the current directory |
| `rename_existing(file)` | Renames `file` to `file.bak` |
| `writable(dest)` | Returns `True` if file or directory `dest` can be written |
### Interruptible wait and interruption handling utilities
The `interrupt` module includes `wait(...)`, a replacement for `sleep(...)` that is interruptible and works with multiple threads. It also provides methods to cause an interruption (including doing it by issuing a <kbd>^C</kbd> to the program), check whether an interruption occurred, and other related operations.
| Function | Purpose |
|--------------------------|---------|
| `config_interrupt(callback, raise_ex, signal)` | Sets up a callback function |
| `interrupt()` | Interrupts any `wait` in progress |
| `interrupted() ` | Returns `True` if an interruption has been called |
| `raise_for_interrupts()` | Raises an exception if `interrupt()` has been invoked |
| `reset_interrupts()` | Resets the interruption flag |
| `wait(duration)` | Waits for `duration` in an interruptible fashion |
### Module utilities
The `module_utils` collection of functions is useful for working with paths related to a running module, for example to find internal data files that might be needed for normal operation.
| Function | Purpose |
|--------------------|---------|
| `config_path(module_name)` | Returns the path to local config data directory for the module |
| `datadir_path(module_name)` | Returns the path to the `/data` subdirectory of the module |
| `desktop_path()` | Returns the path to the user's Desktop directory on this system |
| `installation_path(module_name)` | Returns the path to module's installation directory |
| `module_path(module_name)` | Returns the path to the installed module |
Function `config_path(...)` is useful to use in conjunction with Python's [`configparser`](https://docs.python.org/3/library/configparser.html) module. It returns `~/.config/modulename/` on Unix-like systems.
### Network utilities
The `network_utils` module provides several functions that are useful when performing network operations.
| Function | Purpose |
| -------------------------------- | ------------------------------------------------------------------- |
| `download(url, local_dest)` | Download a file |
| `download_file(url, local_dest)` | Download a file without raising exceptions |
| `hostname(url)` | Returns the hostname portion of a URL |
| `net(...)` | See below |
| `netlock(url)` | Returns the hostname, port number (if any), and login info (if any) |
| `network_available()` | Returns `True` if external hosts are reacheable over the network |
| `on_localhost(url)` | Returns `True` if the address of `url` points to the local host |
| `scheme(url)` | Returns the protocol portion of the url; e.g., "https" |
#### _`net`_
The `net` function in the `network_utils` module implements a fairly high-level network operation interface that internally handles timeouts, rate limits, polling, HTTP/2, and more. The function signature is:
```python
net(method, url, client = None, handle_rate = True, polling = False, recursing = 0, **kwargs)
```
The `method` parameter should have a value such as `'get'`, `'post'`, `'head'`, or similar. The function returns a tuple of (response, exception), where the first element is the response from the get or post HTTP call, and the second element is an exception object if an exception occurred. If no exception occurred, the second element will be `None`. This allows the caller to inspect the response even in cases where exceptions are raised.
If keyword `client` is not `None`, it's assumed to be a [Python HTTPX Client](https://www.python-httpx.org) object to use for the network call. Settings such as timeouts should be done by the caller creating appropriately-configured [Client](https://www.python-httpx.org/api/#client) objects.
If keyword `handle_rate` is `True`, this function will automatically pause and retry if it receives an HTTP code 429 ("too many requests") from the server. If `False`, it will return the exception `CommonPy.RateLimitExceeded` instead.
If keyword `polling` is `True`, certain statuses like 404 are ignored and the response is returned; otherwise, they are considered errors. The behavior when `True` is useful in situations where a URL does not exist until something is ready at the server, and the caller is repeatedly checking the URL. It is up to the caller to implement the polling schedule and call this function (with `polling = True`) as needed.
This method always passes the argument `allow_redirects = True` to the underlying Python HTTPX library network calls.
#### _`download` and `download_file`_
The functions `download(url, local_destination)` and `download_file(url, local_destination)` download a file at the given `url`, writing it to the file specified by the parameter `local_destination`. The former version of the function will raise exceptions in case of problems; the latter version simply return `True` or `False` depending on the success of the download.
### String utilities
| Function | Purpose |
|--------------------|---------|
| `antiformat(s)` | Quote instances of `{` and `}` in `s` so it can be passed to format. |
| `print_boxed(msg)` | Print a message with a box around it using pure ASCII characters. |
### System utilities
| Function | Purpose |
|--------------------|---------|
| `system_profile()` | Returns a string describing the system running this Python program. |
### Exceptions
The CommonPy module defines a number of exceptions that it may return. (Most of the exceptions are potentially thrown by `net`, discussed above.)
| Exception | Meaning |
|--------------------------|---------|
| `CommonPyException` | Base class for CommonPy exceptions |
| | |
| `ArgumentError` | The function call was given invalid or unexpected arguments |
| `AuthenticationFailure` | Problem obtaining or using authentication credentials |
| `InternalError` | Unrecoverable problem involving CommonPy itself |
| `Interrupted` | The user elected to cancel/quit the program |
| `NetworkFailure` | Unrecoverable problem involving net |
| `NoContent` | No content found at the given location |
| `RateLimitExceeded` | The service flagged reports that its rate limits have been exceeded |
| `ServiceFailure` | Unrecoverable problem involving a remote service |
Getting help
------------
If you find an issue, please submit it in [the GitHub issue tracker](https://github.com/caltechlibrary/commonpy/issues) for this repository.
Contributing
------------
We would be happy to receive your help and participation with enhancing CommonPy! Please visit the [guidelines for contributing](CONTRIBUTING.md) for some tips on getting started.
If you plan on doing any development on CommonPy, you may want to install the package dependencies listed in [`requirements-dev.txt`](requirements-dev.txt), e.g., using a command such as the following. This will install dependencies necessary to run `pytest`.
```
python3 -m pip install -r requirements-dev.txt
```
License
-------
Software produced by the Caltech Library is Copyright (C) 2020-2023, Caltech. This software is freely distributed under a BSD/MIT type license. Please see the [LICENSE](LICENSE) file for more information.
Authors and history
---------------------------
Mike Hucka started this collection of utilities sometime in 2018.
Acknowledgments
---------------
This work was funded by the California Institute of Technology Library.
The [vector artwork](https://thenounproject.com/term/toolbox/3030990/) of a toolbox, used as the icon for this repository, was created by [priyanka](https://thenounproject.com/term/toolbox/3030990) from the Noun Project. It is licensed under the Creative Commons [CC-BY 3.0](https://creativecommons.org/licenses/by/3.0/) license.
CommonPy makes use of numerous open-source packages, without which it would have been effectively impossible to develop CommonPy with the resources we had. I want to acknowledge this debt. In alphabetical order, the packages are:
* [boltons](https://github.com/mahmoud/boltons/) – package of miscellaneous Python utilities
* [dateparser](https://pypi.org/project/dateparser/) – parse dates in almost any string format
* [deprecation]() – a library to handle deprecation of code in your Python packages
* [h2](https://pypi.org/project/h2) – HTTP/2 support library used by [HTTPX](https://www.python-httpx.org)
* [httpx](https://www.python-httpx.org) – Python HTTP client library that supports HTTP/2
* [humanize](https://github.com/jmoiron/humanize) – make numbers more easily readable by humans
* [ipdb](https://github.com/gotcha/ipdb) – the IPython debugger
* [pytest](https://docs.pytest.org/en/stable/) – testing framework for Python
* [pytest-mock](https://pypi.org/project/pytest-mock/) – wrapper around the `mock` package for use with `pytest`
* [python_dateutil](https://pypi.org/project/python-dateutil) – date utilities
* [PyYAML](https://pyyaml.org) – Python YAML parser
* [pywin32](https://github.com/mhammond/pywin32) – Windows APIs for Python
* [sidetrack](https://github.com/caltechlibrary/sidetrack) – simple debug logging/tracing package
* [tldextract](https://github.com/john-kurkowski/tldextract) – module to parse domains from URLs
* [twine](https://twine.readthedocs.io) – package for publishing Python packages to PyPI
* [validator-collection](https://pypi.org/project/validator-collection/) – collection of Python functions for validating data
<div align="center">
<br>
<a href="https://www.caltech.edu">
<img width="100" height="100" src="https://raw.githubusercontent.com/caltechlibrary/commonpy/main/.graphics/caltech-round.png">
</a>
</div>
Raw data
{
"_id": null,
"home_page": "https://github.com/caltechlibrary/commonpy",
"name": "commonpy",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "Python,utilities",
"author": "Michael Hucka",
"author_email": "mhucka@caltech.edu",
"download_url": "https://files.pythonhosted.org/packages/6c/09/00e4602ffdf48ee267a700a5ab8a1716853ab98260dec42379af4adf9f00/commonpy-1.13.0.tar.gz",
"platform": null,
"description": "CommonPy<img width=\"12%\" align=\"right\" src=\"https://github.com/caltechlibrary/commonpy/raw/main/.graphics/commonpy-icon.png\">\n===============================================\n\nThis is a collection of common utility functions and classes that we at the Caltech Library have found useful in our other Python projects.\n\n[![Latest release](https://img.shields.io/github/v/release/caltechlibrary/commonpy.svg?style=flat-square&color=b44e88&label=Latest%20release)](https://github.com/caltechlibrary/commonpy/releases)\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg?style=flat-square)](https://choosealicense.com/licenses/bsd-3-clause)\n[![Python](https://img.shields.io/badge/Python-3.6+-brightgreen.svg?style=flat-square)](http://shields.io)\n[![PyPI](https://img.shields.io/pypi/v/commonpy.svg?style=flat-square&color=orange&label=PyPI)](https://pypi.org/project/commonpy/)\n\nTable of contents\n-----------------\n\n* [Introduction](#introduction)\n* [Installation](#installation)\n* [Usage](#usage)\n* [Getting help](#getting-help)\n* [Contributing](#contributing)\n* [License](#license)\n* [Authors and history](#authors-and-history)\n* [Acknowledgments](#authors-and-acknowledgments)\n\n\nIntroduction\n------------\n\nThis repository does not constitute a single program; instead, it contains a collection of modules with utility functions and classes that we have found ourselves using repeatedly in other Python projects.\n\n\nInstallation\n------------\n\nThe instructions below assume you have a Python interpreter installed on your computer; if that's not the case, please first [install Python version 3](INSTALL-Python3.md) and familiarize yourself with running Python programs on your system.\n\nOn **Linux**, **macOS**, and **Windows** operating systems, you should be able to install `commonpy` with [`pip`](https://pip.pypa.io/en/stable/installing/). To install `commonpy` from the [Python package repository (PyPI)](https://pypi.org), run the following command:\n```\npython3 -m pip install commonpy\n```\n\nAs an alternative to getting it from [PyPI](https://pypi.org), you can use `pip` to install `commonpy` directly from GitHub, like this:\n```sh\npython3 -m pip install git+https://github.com/caltechlibrary/commonpy.git\n```\n\n\nUsage\n-----\n\nThe basic approach to using this package is to import the modules and functions you need. For example:\n\n```python\nfrom commonpy.file_utils import readable\n\nif readable('/path/to/some/file'):\n # do something\n```\n\nThe following subsections describe the different modules available.\n\n\n### Data structures\n\nThe `data_structures` module provides miscellaneous data classes.\n\n| Class | Purpose |\n|----------------|---------|\n| `CaseFoldDict` | A version of `dict` that compares keys in a case-insensitive manner |\n| `CaseFoldSet` | A version of `set` that compares keys in a case-insensitive manner |\n\n\n### Data utilities\n\nThe `data_utils` module provides a number of miscellaneous simple functions for some common operations on data of various kinds.\n\n| Function | Purpose |\n|--------------------|---------|\n| `expanded_range(string)` | Given a string of the form \"X-Y\", returns the list of integers it represents |\n| `flattened(thing)` | Takes a list or dictionary and returns a recursively flattened version |\n| `ordinal(integer)` | Returns a string with the number followed by \"st\", \"nd, \"rd\", or \"th\" |\n| `parsed_datetime(string)` | Returns a date object representing the given date string |\n| `pluralized(word, n, include_num)` | Returns a plural version of `word` if `n > 1` |\n| `sliced(list, n)` | Yields `n` number of slices from the `list` |\n| `timestamp()` | Returns a string for an easily-readable form of the current time and date |\n| `unique(list)` | Takes a list and return a version without duplicates |\n\n\n### File utilities\n\nThe `file_utils` module provides a number of miscellaneous simple functions for some common operations on files and directories.\n\n| Function | Purpose |\n|--------------------|---------|\n| `alt_extension(file, ext)` | Returns `file` with the extension replaced by `ext` |\n| `copy_file(src, dst)` | Copies file from `src` to `dst` |\n| `delete_existing(file)` | Deletes the given `file` |\n| `filename_basename(file)` | Returns `file` without any extensions |\n| `filename_extension(file)` | Returns the extension of filename `file` |\n| `files_in_directory(dir, ext, recursive)` | |\n| `filtered_by_extensions(list, endings)` | |\n| `nonempty(file)` | Returns `True` if file `file` is not empty |\n| `open_file(file)` | Opens the `file` by calling the equivalent of \"open\" on this system |\n| `open_url(url)` | Opens the `url` in the user's default web browser |\n| `readable(dest)` | Returns `True` if file or directory `dest` is accessible and readable |\n| `relative(file)` | Returns a path string for `file` relative to the current directory |\n| `rename_existing(file)` | Renames `file` to `file.bak` |\n| `writable(dest)` | Returns `True` if file or directory `dest` can be written |\n\n\n### Interruptible wait and interruption handling utilities\n\nThe `interrupt` module includes `wait(...)`, a replacement for `sleep(...)` that is interruptible and works with multiple threads. It also provides methods to cause an interruption (including doing it by issuing a <kbd>^C</kbd> to the program), check whether an interruption occurred, and other related operations.\n\n| Function | Purpose |\n|--------------------------|---------|\n| `config_interrupt(callback, raise_ex, signal)` | Sets up a callback function |\n| `interrupt()` | Interrupts any `wait` in progress |\n| `interrupted() ` | Returns `True` if an interruption has been called |\n| `raise_for_interrupts()` | Raises an exception if `interrupt()` has been invoked |\n| `reset_interrupts()` | Resets the interruption flag |\n| `wait(duration)` | Waits for `duration` in an interruptible fashion |\n\n\n### Module utilities\n\nThe `module_utils` collection of functions is useful for working with paths related to a running module, for example to find internal data files that might be needed for normal operation.\n\n| Function | Purpose |\n|--------------------|---------|\n| `config_path(module_name)` | Returns the path to local config data directory for the module |\n| `datadir_path(module_name)` | Returns the path to the `/data` subdirectory of the module |\n| `desktop_path()` | Returns the path to the user's Desktop directory on this system |\n| `installation_path(module_name)` | Returns the path to module's installation directory |\n| `module_path(module_name)` | Returns the path to the installed module |\n\nFunction `config_path(...)` is useful to use in conjunction with Python's [`configparser`](https://docs.python.org/3/library/configparser.html) module. It returns `~/.config/modulename/` on Unix-like systems.\n\n\n### Network utilities\n\nThe `network_utils` module provides several functions that are useful when performing network operations.\n\n| Function | Purpose |\n| -------------------------------- | ------------------------------------------------------------------- |\n| `download(url, local_dest)` | Download a file |\n| `download_file(url, local_dest)` | Download a file without raising exceptions |\n| `hostname(url)` | Returns the hostname portion of a URL |\n| `net(...)` | See below |\n| `netlock(url)` | Returns the hostname, port number (if any), and login info (if any) |\n| `network_available()` | Returns `True` if external hosts are reacheable over the network |\n| `on_localhost(url)` | Returns `True` if the address of `url` points to the local host |\n| `scheme(url)` | Returns the protocol portion of the url; e.g., \"https\" |\n\n\n#### _`net`_\n\nThe `net` function in the `network_utils` module implements a fairly high-level network operation interface that internally handles timeouts, rate limits, polling, HTTP/2, and more. The function signature is:\n\n```python\nnet(method, url, client = None, handle_rate = True, polling = False, recursing = 0, **kwargs)\n```\n\nThe `method` parameter should have a value such as `'get'`, `'post'`, `'head'`, or similar. The function returns a tuple of (response, exception), where the first element is the response from the get or post HTTP call, and the second element is an exception object if an exception occurred. If no exception occurred, the second element will be `None`. This allows the caller to inspect the response even in cases where exceptions are raised.\n\nIf keyword `client` is not `None`, it's assumed to be a [Python HTTPX Client](https://www.python-httpx.org) object to use for the network call. Settings such as timeouts should be done by the caller creating appropriately-configured [Client](https://www.python-httpx.org/api/#client) objects.\n\nIf keyword `handle_rate` is `True`, this function will automatically pause and retry if it receives an HTTP code 429 (\"too many requests\") from the server. If `False`, it will return the exception `CommonPy.RateLimitExceeded` instead.\n\nIf keyword `polling` is `True`, certain statuses like 404 are ignored and the response is returned; otherwise, they are considered errors. The behavior when `True` is useful in situations where a URL does not exist until something is ready at the server, and the caller is repeatedly checking the URL. It is up to the caller to implement the polling schedule and call this function (with `polling = True`) as needed.\n\nThis method always passes the argument `allow_redirects = True` to the underlying Python HTTPX library network calls.\n\n\n#### _`download` and `download_file`_\n\nThe functions `download(url, local_destination)` and `download_file(url, local_destination)` download a file at the given `url`, writing it to the file specified by the parameter `local_destination`. The former version of the function will raise exceptions in case of problems; the latter version simply return `True` or `False` depending on the success of the download.\n\n\n### String utilities\n\n| Function | Purpose |\n|--------------------|---------|\n| `antiformat(s)` | Quote instances of `{` and `}` in `s` so it can be passed to format. |\n| `print_boxed(msg)` | Print a message with a box around it using pure ASCII characters. |\n\n\n### System utilities\n\n| Function | Purpose |\n|--------------------|---------|\n| `system_profile()` | Returns a string describing the system running this Python program. |\n\n\n### Exceptions\n\nThe CommonPy module defines a number of exceptions that it may return. (Most of the exceptions are potentially thrown by `net`, discussed above.)\n\n| Exception | Meaning |\n|--------------------------|---------|\n| `CommonPyException` | Base class for CommonPy exceptions |\n| | |\n| `ArgumentError` | The function call was given invalid or unexpected arguments |\n| `AuthenticationFailure` | Problem obtaining or using authentication credentials |\n| `InternalError` | Unrecoverable problem involving CommonPy itself |\n| `Interrupted` | The user elected to cancel/quit the program |\n| `NetworkFailure` | Unrecoverable problem involving net | \n| `NoContent` | No content found at the given location |\n| `RateLimitExceeded` | The service flagged reports that its rate limits have been exceeded |\n| `ServiceFailure` | Unrecoverable problem involving a remote service |\n\n\nGetting help\n------------\n\nIf you find an issue, please submit it in [the GitHub issue tracker](https://github.com/caltechlibrary/commonpy/issues) for this repository.\n\n\nContributing\n------------\n\nWe would be happy to receive your help and participation with enhancing CommonPy! Please visit the [guidelines for contributing](CONTRIBUTING.md) for some tips on getting started.\n\nIf you plan on doing any development on CommonPy, you may want to install the package dependencies listed in [`requirements-dev.txt`](requirements-dev.txt), e.g., using a command such as the following. This will install dependencies necessary to run `pytest`.\n```\npython3 -m pip install -r requirements-dev.txt\n```\n\n\nLicense\n-------\n\nSoftware produced by the Caltech Library is Copyright (C) 2020-2023, Caltech. This software is freely distributed under a BSD/MIT type license. Please see the [LICENSE](LICENSE) file for more information.\n\n\nAuthors and history\n---------------------------\n\nMike Hucka started this collection of utilities sometime in 2018.\n\n\nAcknowledgments\n---------------\n\nThis work was funded by the California Institute of Technology Library.\n\nThe [vector artwork](https://thenounproject.com/term/toolbox/3030990/) of a toolbox, used as the icon for this repository, was created by [priyanka](https://thenounproject.com/term/toolbox/3030990) from the Noun Project. It is licensed under the Creative Commons [CC-BY 3.0](https://creativecommons.org/licenses/by/3.0/) license.\n\nCommonPy makes use of numerous open-source packages, without which it would have been effectively impossible to develop CommonPy with the resources we had. I want to acknowledge this debt. In alphabetical order, the packages are:\n\n* [boltons](https://github.com/mahmoud/boltons/) – package of miscellaneous Python utilities\n* [dateparser](https://pypi.org/project/dateparser/) – parse dates in almost any string format\n* [deprecation]() – a library to handle deprecation of code in your Python packages\n* [h2](https://pypi.org/project/h2) – HTTP/2 support library used by [HTTPX](https://www.python-httpx.org)\n* [httpx](https://www.python-httpx.org) – Python HTTP client library that supports HTTP/2\n* [humanize](https://github.com/jmoiron/humanize) – make numbers more easily readable by humans\n* [ipdb](https://github.com/gotcha/ipdb) – the IPython debugger\n* [pytest](https://docs.pytest.org/en/stable/) – testing framework for Python\n* [pytest-mock](https://pypi.org/project/pytest-mock/) – wrapper around the `mock` package for use with `pytest`\n* [python_dateutil](https://pypi.org/project/python-dateutil) – date utilities\n* [PyYAML](https://pyyaml.org) – Python YAML parser\n* [pywin32](https://github.com/mhammond/pywin32) – Windows APIs for Python\n* [sidetrack](https://github.com/caltechlibrary/sidetrack) – simple debug logging/tracing package\n* [tldextract](https://github.com/john-kurkowski/tldextract) – module to parse domains from URLs\n* [twine](https://twine.readthedocs.io) – package for publishing Python packages to PyPI\n* [validator-collection](https://pypi.org/project/validator-collection/) – collection of Python functions for validating data\n\n<div align=\"center\">\n <br>\n <a href=\"https://www.caltech.edu\">\n <img width=\"100\" height=\"100\" src=\"https://raw.githubusercontent.com/caltechlibrary/commonpy/main/.graphics/caltech-round.png\">\n </a>\n</div>\n",
"bugtrack_url": null,
"license": "BSD 3-clause",
"summary": "Assortment of Python helper functions and utility classes",
"version": "1.13.0",
"project_urls": {
"Bug Tracker": "https://github.com/caltechlibrary/commonpy/issues",
"Homepage": "https://github.com/caltechlibrary/commonpy",
"Source Code": "https://github.com/caltechlibrary/commonpy"
},
"split_keywords": [
"python",
"utilities"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "454790996752738c6d8ff3c2609782c4fbe4c5b94ea2551c2885b2132cb1413e",
"md5": "7ae8e12f31e2e69ed5e3c42b2cbe6684",
"sha256": "073f62aa1de4dcca44a2eef364182b2e90831562c3531b66c15fc145415cc609"
},
"downloads": -1,
"filename": "commonpy-1.13.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7ae8e12f31e2e69ed5e3c42b2cbe6684",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 27022,
"upload_time": "2023-05-02T23:22:38",
"upload_time_iso_8601": "2023-05-02T23:22:38.143232Z",
"url": "https://files.pythonhosted.org/packages/45/47/90996752738c6d8ff3c2609782c4fbe4c5b94ea2551c2885b2132cb1413e/commonpy-1.13.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6c0900e4602ffdf48ee267a700a5ab8a1716853ab98260dec42379af4adf9f00",
"md5": "8bfabc68fffbc51af6c4dee3ec43b3ee",
"sha256": "8d91983586efc7b7055d4f7bbf34413918a068c8e296913de241c67aa94c105e"
},
"downloads": -1,
"filename": "commonpy-1.13.0.tar.gz",
"has_sig": false,
"md5_digest": "8bfabc68fffbc51af6c4dee3ec43b3ee",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 33566,
"upload_time": "2023-05-02T23:22:41",
"upload_time_iso_8601": "2023-05-02T23:22:41.039248Z",
"url": "https://files.pythonhosted.org/packages/6c/09/00e4602ffdf48ee267a700a5ab8a1716853ab98260dec42379af4adf9f00/commonpy-1.13.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-02 23:22:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "caltechlibrary",
"github_project": "commonpy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "commonpy"
}