Metadata-Version: 2.1
Name: more-ds
Version: 0.0.5
Summary: More Data Structures
Home-page: https://github.com/gkoller/more-ds
Author: Guido Kollerie
Author-email: guido@kollerie.com
License: Apache-2.0
Project-URL: Changelog, https://github.com/gkoller/more-ds/blob/main/CHANGELOG.rst
Project-URL: Documentation, https://more-ds.readthedocs.io/en/latest/
Project-URL: Source Code, https://github.com/gkoller/more-ds
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=3.8
License-File: LICENSE
License-File: licenses/LICENSE-nwa-stdlib
Provides-Extra: dev
Requires-Dist: black ; extra == 'dev'
Requires-Dist: flake8 ; extra == 'dev'
Requires-Dist: flake8-colors ; extra == 'dev'
Requires-Dist: flake8-raise ; extra == 'dev'
Requires-Dist: flake8-bandit ; extra == 'dev'
Requires-Dist: flake8-bugbear ; extra == 'dev'
Requires-Dist: flake8-builtins ; extra == 'dev'
Requires-Dist: flake8-comprehensions ; extra == 'dev'
Requires-Dist: flake8-docstrings ; extra == 'dev'
Requires-Dist: flake8-implicit-str-concat ; extra == 'dev'
Requires-Dist: flake8-print ; extra == 'dev'
Requires-Dist: flake8-rst ; extra == 'dev'
Requires-Dist: flake8-string-format ; extra == 'dev'
Requires-Dist: flake8-logging-format ; extra == 'dev'
Requires-Dist: isort ; extra == 'dev'
Requires-Dist: mypy ; extra == 'dev'
Requires-Dist: pre-commit ; extra == 'dev'
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: pytest-cov ; extra == 'dev'
Requires-Dist: pytest-xdist ; extra == 'dev'
Requires-Dist: build ; extra == 'dev'
Requires-Dist: tbump (==6.3.1) ; extra == 'dev'
Requires-Dist: twine ; extra == 'dev'
Provides-Extra: docs
Requires-Dist: sphinx ; extra == 'docs'
Requires-Dist: sphinx-rtd-theme ; extra == 'docs'

More Data Structures
====================

More Data Structures
or ``more-ds`` for short,
provides simple and convenient Python data structures.


Data Structures
===============

network
-------

``URL``
    Class for easy (unvalidated) URL construction.

time
----

``Timer``
    Context manager for timing a block of code.

Getting Started
===============

.. code-block:: console

    % pip install more-ds

.. code-block:: python

    >>> from more_ds.network import URL
    >>> base_url = URL("http://example.org/")
    >>> api_url = base_url / "api"
    >>> url = api_url / "ip" / "address" // dict(version=4)
    >>> print(url)
    http://example.org/api/ip/address?version=4

Or

.. code-block:: python

    from time import sleep

    from more_ds.time import Timer
    with Timer() as t:
        # sleep for half a second
        sleep(.5)

    print(t.elapsed)  # -> 0:00:00.501864


Origin
======

The projected started
with the need to extract the simplest of classes
from an existing open source library, `nwa-stdlib`_.
That library primarily contained code
that was rather specific to the organization that created the library.
However, the ``URL`` class was a tiny convenience data structure,
with broader applicability,
that took the chore out of programmatically creating URLs.
By extracting that class into a separate project,
one that is specifically focussed on convenient data structures,
it hopefully attracts a broader set of users
that would otherwise don't feel comfortable including `nwa-stdlib`_ as a whole.

The project's name was inspired by the wonderful `More Itertools`_ library.

.. _nwa-stdlib: https://github.com/workfloworchestrator/nwa-stdlib
.. _More Itertools: https://more-itertools.readthedocs.io/en/stable/index.html


