Skip to content

Commit

Permalink
Merge branch 'master' of github.com:KenKundert/inform into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kalekundert committed Oct 30, 2020
2 parents c44a1de + 5ee7f59 commit e7e62c5
Show file tree
Hide file tree
Showing 16 changed files with 314 additions and 125 deletions.
4 changes: 2 additions & 2 deletions .bump.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
date_fmt = 'YYYY-MM-DD'
major = 1
minor = 20
patch = 5
minor = 23
patch = 1
date = [
'inform/__init__.py __released__',
'README.rst Released',
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ jobs:
- python: 3.8
- python: nightly
allow_failures:
- python: 3.5
- python: nightly
fast_finish: true
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Inform - Print & Logging Utilities


:Author: Ken Kundert
:Version: 1.20.5
:Released: 2020-05-26
:Version: 1.23.1
:Released: 2020-08-29

A light-weight package with few dependencies that provides specialized print
functions that are used when communicating with the user. It allows you to
Expand Down
2 changes: 1 addition & 1 deletion clean
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set nonomatch
rm -f *.pyc *.pyo .test*.sum expected result install.out
rm -rf build *.egg-info dist __pycache__ .coverage .coverage-html htmlcov .eggs
rm -f .*.log
rm -rf .eggs .pytest_cache .cache dist .build inform.egg.info
rm -rf .eggs .pytest_cache .cache dist .build inform.egg.info .hypothesis
rm -rf **/{__pycache__,*.pyc,*.pyo}
rm -rf tests/{htmlcov,.cache,.coverage,.pytest_cache}
rm -rf doc/.build
8 changes: 6 additions & 2 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,25 @@ User Utilities

.. autofunction:: inform.fmt

.. autofunction:: inform.format_range

.. autofunction:: inform.full_stop

.. autofunction:: inform.join

.. autofunction:: inform.parse_range

.. autofunction:: inform.format_range

.. autofunction:: inform.os_error

.. autoclass:: inform.plural
:members:

.. autofunction:: inform.render

.. autofunction:: inform.render_bar

.. autofunction:: inform.title_case


Debug Utilities
===============
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# built documents.
#
# The full version, including alpha/beta/rc tags.
release = '1.20.5'
release = '1.23.1'
# The short X.Y version.
version = '.'.join(release.split('.')[0:2])

Expand Down
4 changes: 2 additions & 2 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
Inform: Print & Logging Utilities
=================================

| Version: 1.20.5
| Released: 2020-05-26
| Version: 1.23.1
| Released: 2020-08-29
| Please post all bugs and suggestions at
`Inform Issues <https://github.com/KenKundert/inform/issues>`_
(or contact me directly at
Expand Down
13 changes: 11 additions & 2 deletions doc/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@ Releases
========

**Latest development release**:
| Version: 1.20.5
| Released: 2020-05-26
| Version: 1.23.1
| Released: 2020-08-29
**1.23 (2020-08-26)**:
- Strip out empty culprits and codicils.

**1.22 (2020-08-24)**:
- Added *clone* argument to :class:`inform.InformantFactory`.

**1.21 (2020-07-20)**:
- Allow :class:`inform.ProgressBar` output to be suppressed.
- Allow ``/`` to be overridden in :class:`inform.plural`
- Various enhancements to :func:`inform.conjoin` and :func:`inform.full_stop`.
- Added :func:`inform.parse_range` and :func:`inform.format_range` functions.
- Added :func:`inform.title_case` function.

**1.20 (2020-01-08)**:
- Add *format* method to :class:`inform.plural`.
Expand Down
53 changes: 37 additions & 16 deletions doc/user.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,23 @@ argument list because if *fmt* does not find a named argument in its argument
list, it will look for a variable of the same name in the local scope.


.. _format_range desc:

format_range
""""""""""""

.. py:function:: format_range(items)
func:`inform.format_range` can be used to create a succinct, readable string
representing a set of numbers.

.. code-block:: python
>>> from inform import format_range
>>> format_range({1, 2, 3, 5})
'1-3,5'
.. _full_stop desc:

full_stop
Expand Down Expand Up @@ -1400,21 +1417,6 @@ user-inputted strings.
>>> parse_range('1-3,5')
{1, 2, 3, 5}
.. _format_range desc:

format_range
""""""""""""

.. py:function:: format_range(items)
func:`inform.format_range` can be used to create a succinct, readable string
representing a set of numbers.

.. code-block:: python
>>> from inform import format_range
>>> format_range({1, 2, 3, 5})
'1-3,5'
.. _progressbar desc:

Expand Down Expand Up @@ -1446,7 +1448,6 @@ example:
>>> display('Processed:', conjoin(processed), end='.\n')
Processed: i1, i2, i3, i4, i5, i6, i7, i8, i9 and i10.
The second is similar to the first, except you just give an integer to indicate
how many iterations you wish:

Expand Down Expand Up @@ -1757,6 +1758,26 @@ the line in characters.
0.002: ▏
.. _title_case desc:

title_case
""""""""""

.. py:function:: title_case(string, exceptions=(...))
:func:`inform.title_case` converts the initial letters in the words of a string
to upper case while maintaining any letters that are already upper case, such as
acronyms. Common 'small' words are excepted and words within quotes are handled
properly.

.. code-block:: python
>>> from inform import title_case
>>> headline = 'CDC warns about "aggressive" rats as coronavirus shuts down restaurants'
>>> display(title_case(headline))
CDC Warns About "Aggressive" Rats as Coronavirus Shuts Down Restaurants
Debugging Functions
-------------------

Expand Down
4 changes: 4 additions & 0 deletions examples/run
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env python3
# This is a utility function that simply runs a shell command and raises Error
# if there was a problem. It demonstrates the ability to use the extra arguments
# of Error to stuff it with useful information that can be used later in error
# reporting.

from inform import Error, narrate, os_error
from subprocess import Popen, PIPE
Expand Down
8 changes: 4 additions & 4 deletions inform/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
__version__ = '1.20.5'
__released__ = '2020-05-26'
__version__ = '1.23.1'
__released__ = '2020-08-29'

from .inform import (
# inform utility functions and classes
cull, indent, is_collection, is_iterable, is_mapping, is_str, join,
Color, Info,

# user utility functions and classes
columns, conjoin, did_you_mean, parse_range, format_range, fmt, full_stop,
os_error, plural, ProgressBar, render, render_bar,
columns, conjoin, did_you_mean, fmt, format_range, full_stop, os_error,
parse_range, plural, ProgressBar, render, render_bar, title_case,

# debug functions
aaa, ppp, ddd, vvv, sss,
Expand Down
Loading

0 comments on commit e7e62c5

Please sign in to comment.