Various utilities
Project description
allthethings
Various utilities augmenting the python standard library.
base_convert
base_convert(s, from_base: int, to_base: int, alphabet="0123456789abcdefghijklmnopqrstuvwxyz") -> str
class DateRange
...
at_end_of_month
at_end_of_month(d: date) -> date
Returns a date at the end of the month of the given date.
at_end_of_month(read_date('2022-02-03')) --> '2020-02-28'
at_end_of_month(read_date('2020-02-03')) --> '2020-02-29'
read_date
read_date(value: Union[date, str]) -> date
make_dsn
make_dsn(protocol: str, *, host: str, port: int, database: str, username: str, password: str) -> str
make_postgres_dsn
make_postgres_dsn(*, host: str, database: str, username: str, password: str, port: int = 5432) -> str
grouper
grouper(iterable: Iterable[U], n) -> Iterator[List[U]]
groupby
groupby(f: Callable[[U], R], xs: Iterable[U]) -> Dict[R, List[U]]
like Scala's groupby, unlike Haskell's/Python's groupby
dedup
dedup(xs: Iterable[U], on=lambda x: x) -> Iterator[U]
range_incl
range_incl(lower: E, upper: E, step: Optional[Union[Callable[[E], E], Number]] = None) -> Iterator[E]
with E = TypeVar('E', Number, date, covariant=True)
range_excl
range_excl(lower: E, upper: E, step: Optional[Union[Callable[[E], E], Number]] = None) -> Iterator[E]
with E = TypeVar('E', Number, date, covariant=True)
class Stopwatch
...
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
allthethings-0.5.0.tar.gz
(9.7 kB
view details)
Built Distribution
File details
Details for the file allthethings-0.5.0.tar.gz
.
File metadata
- Download URL: allthethings-0.5.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d5e584682cc9e541c32e1e1a9ceb1edb3d468642879a43190e49487e978a5f4 |
|
MD5 | 1d07ba2e9ba8081cb1ab5b8f39da9e4a |
|
BLAKE2b-256 | 6966127f37914b69d2ebfa6c35b02f512e0e7b269c2cf3fad0e67969494a4abf |
File details
Details for the file allthethings-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: allthethings-0.5.0-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c36febd5e4a071158fc1adc0240b0c8191117689be8acf9ec213453dc28c8455 |
|
MD5 | 08990b7e279beb0e16e16d8fa75cc4ab |
|
BLAKE2b-256 | 377549e5e32bcf24e315698b1994b976fa33401c9776a2311e4183f326639581 |