tslist


Nametslist JSON
Version 0.3.2 PyPI version JSON
download
home_pagehttps://github.com/sonntagsgesicht/tslist
Summarytimestamp with a list (created by auxilium)
upload_time2025-01-06 11:15:32
maintainerNone
docs_urlNone
authorsonntagsgesicht
requires_pythonNone
licenseApache License 2.0
keywords
VCS
bugtrack_url
requirements auxilium python-dateutil setuptools
Travis-CI No Travis.
coveralls test coverage No coveralls.
            

.. image:: logo.png


Python Project *tslist*
-----------------------------------------------------------------------

.. image:: https://github.com/sonntagsgesicht/tslist/actions/workflows/python-package.yml/badge.svg
    :target: https://github.com/sonntagsgesicht/tslist/actions/workflows/python-package.yml
    :alt: GitHubWorkflow

.. image:: https://img.shields.io/readthedocs/tslist
   :target: http://tslist.readthedocs.io
   :alt: Read the Docs

.. image:: https://img.shields.io/github/license/sonntagsgesicht/tslist
   :target: https://github.com/sonntagsgesicht/tslist/raw/master/LICENSE
   :alt: GitHub

.. image:: https://img.shields.io/github/release/sonntagsgesicht/tslist?label=github
   :target: https://github.com/sonntagsgesicht/tslist/releases
   :alt: GitHub release

.. image:: https://img.shields.io/pypi/v/tslist
   :target: https://pypi.org/project/tslist/
   :alt: PyPI Version

.. image:: https://img.shields.io/pypi/pyversions/tslist
   :target: https://pypi.org/project/tslist/
   :alt: PyPI - Python Version

.. image:: https://pepy.tech/badge/tslist
   :target: https://pypi.org/project/tslist/
   :alt: PyPI Downloads


Introduction
------------

To import the project simply type

.. code-block:: python

    >>> import tslist

after installation.

The TS filtered list enhances the standard
`list <https://docs.python.org/3/library/stdtypes.html#list>`_
by filtering the list by
`slices <https://docs.python.org/3/library/stdtypes.html#list>`_
of types **T** differing from **int**
in which (before comparision) any item **x**
is converted to type **T** by calling **T(x)**

    >>> from tslist import TSList

    >>> l = 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9
    >>> tsl = TSList(l)
    >>> tsl
    TSList([1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9])

    >>> tsl[1.0:1.3]  # filter all items between 1.0 (included) and 1.3 (excluded)
    TSList([1.0, 1.1, 1.2])

    >>> tsl[1.0:1.31]
    TSList([1.0, 1.1, 1.2, 1.3])

    >>> tsl[1.1]  # filter all items at 1.1
    TSList([1.1])

    >>> tsl.append(1.1)
    >>> tsl[1.1]
    TSList([1.1, 1.1])

This becomes even more handy if list items admit conversions.

    >>> from datetime import timedelta, datetime
    >>> from tslist import TS

    >>> class Timedelta(timedelta):
    ...     def __float__(self):
    ...         return self.total_seconds()
    ...
    ...     def __ts__(self):
    ...         # used for conversion using tslist.TS
    ...         return datetime(2000, 1, 1) + self

    >>> l = [Timedelta(d) for d in range(10, 15)]
    >>> tsl = TSList(l)
    >>> tsl
    TSList(
    [ Timedelta(days=10),
      Timedelta(days=11),
      Timedelta(days=12),
      Timedelta(days=13),
      Timedelta(days=14)]
    )

    >>> list(map(float, tsl))
    [864000.0, 950400.0, 1036800.0, 1123200.0, 1209600.0]

    >>> tsl[950400.:1209600.:2]
    TSList([Timedelta(days=11), Timedelta(days=13)])

    >>> list(map(TS, tsl))
    [TS(20000111), TS(20000112), TS(20000113), TS(20000114), TS(20000115)]

    >>> tsl[TS(20000112):TS(20000114)]
    TSList([Timedelta(days=11), Timedelta(days=12)])

See TS() for more detail on timestamp and datetime conversion.



Documentation
-------------

More docs can be found on `https://tslist.readthedocs.io <https://tslist.readthedocs.io>`_


Install
-------

The latest stable version can always be installed or updated via pip:

.. code-block:: bash

    $ pip install tslist


License
-------

Code and documentation are available according to the license
(see LICENSE file in repository).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sonntagsgesicht/tslist",
    "name": "tslist",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "sonntagsgesicht",
    "author_email": "sonntagsgesicht@icloud.com",
    "download_url": "https://files.pythonhosted.org/packages/69/1e/9fc739eb828c66e35a826e78fbc8b286b954ddd58edbaed640e70a2b6e12/tslist-0.3.2.zip",
    "platform": "any",
    "description": "\n\n.. image:: logo.png\n\n\nPython Project *tslist*\n-----------------------------------------------------------------------\n\n.. image:: https://github.com/sonntagsgesicht/tslist/actions/workflows/python-package.yml/badge.svg\n    :target: https://github.com/sonntagsgesicht/tslist/actions/workflows/python-package.yml\n    :alt: GitHubWorkflow\n\n.. image:: https://img.shields.io/readthedocs/tslist\n   :target: http://tslist.readthedocs.io\n   :alt: Read the Docs\n\n.. image:: https://img.shields.io/github/license/sonntagsgesicht/tslist\n   :target: https://github.com/sonntagsgesicht/tslist/raw/master/LICENSE\n   :alt: GitHub\n\n.. image:: https://img.shields.io/github/release/sonntagsgesicht/tslist?label=github\n   :target: https://github.com/sonntagsgesicht/tslist/releases\n   :alt: GitHub release\n\n.. image:: https://img.shields.io/pypi/v/tslist\n   :target: https://pypi.org/project/tslist/\n   :alt: PyPI Version\n\n.. image:: https://img.shields.io/pypi/pyversions/tslist\n   :target: https://pypi.org/project/tslist/\n   :alt: PyPI - Python Version\n\n.. image:: https://pepy.tech/badge/tslist\n   :target: https://pypi.org/project/tslist/\n   :alt: PyPI Downloads\n\n\nIntroduction\n------------\n\nTo import the project simply type\n\n.. code-block:: python\n\n    >>> import tslist\n\nafter installation.\n\nThe TS filtered list enhances the standard\n`list <https://docs.python.org/3/library/stdtypes.html#list>`_\nby filtering the list by\n`slices <https://docs.python.org/3/library/stdtypes.html#list>`_\nof types **T** differing from **int**\nin which (before comparision) any item **x**\nis converted to type **T** by calling **T(x)**\n\n    >>> from tslist import TSList\n\n    >>> l = 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9\n    >>> tsl = TSList(l)\n    >>> tsl\n    TSList([1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9])\n\n    >>> tsl[1.0:1.3]  # filter all items between 1.0 (included) and 1.3 (excluded)\n    TSList([1.0, 1.1, 1.2])\n\n    >>> tsl[1.0:1.31]\n    TSList([1.0, 1.1, 1.2, 1.3])\n\n    >>> tsl[1.1]  # filter all items at 1.1\n    TSList([1.1])\n\n    >>> tsl.append(1.1)\n    >>> tsl[1.1]\n    TSList([1.1, 1.1])\n\nThis becomes even more handy if list items admit conversions.\n\n    >>> from datetime import timedelta, datetime\n    >>> from tslist import TS\n\n    >>> class Timedelta(timedelta):\n    ...     def __float__(self):\n    ...         return self.total_seconds()\n    ...\n    ...     def __ts__(self):\n    ...         # used for conversion using tslist.TS\n    ...         return datetime(2000, 1, 1) + self\n\n    >>> l = [Timedelta(d) for d in range(10, 15)]\n    >>> tsl = TSList(l)\n    >>> tsl\n    TSList(\n    [ Timedelta(days=10),\n      Timedelta(days=11),\n      Timedelta(days=12),\n      Timedelta(days=13),\n      Timedelta(days=14)]\n    )\n\n    >>> list(map(float, tsl))\n    [864000.0, 950400.0, 1036800.0, 1123200.0, 1209600.0]\n\n    >>> tsl[950400.:1209600.:2]\n    TSList([Timedelta(days=11), Timedelta(days=13)])\n\n    >>> list(map(TS, tsl))\n    [TS(20000111), TS(20000112), TS(20000113), TS(20000114), TS(20000115)]\n\n    >>> tsl[TS(20000112):TS(20000114)]\n    TSList([Timedelta(days=11), Timedelta(days=12)])\n\nSee TS() for more detail on timestamp and datetime conversion.\n\n\n\nDocumentation\n-------------\n\nMore docs can be found on `https://tslist.readthedocs.io <https://tslist.readthedocs.io>`_\n\n\nInstall\n-------\n\nThe latest stable version can always be installed or updated via pip:\n\n.. code-block:: bash\n\n    $ pip install tslist\n\n\nLicense\n-------\n\nCode and documentation are available according to the license\n(see LICENSE file in repository).\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "timestamp with a list (created by auxilium)",
    "version": "0.3.2",
    "project_urls": {
        "Homepage": "https://github.com/sonntagsgesicht/tslist"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "691e9fc739eb828c66e35a826e78fbc8b286b954ddd58edbaed640e70a2b6e12",
                "md5": "965434f18bae176d67e7e5c442a79f17",
                "sha256": "7f4f9e6cccf3998ed584247f352483edee72a10814d91740533f0818d57dcec8"
            },
            "downloads": -1,
            "filename": "tslist-0.3.2.zip",
            "has_sig": false,
            "md5_digest": "965434f18bae176d67e7e5c442a79f17",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 24639,
            "upload_time": "2025-01-06T11:15:32",
            "upload_time_iso_8601": "2025-01-06T11:15:32.158494Z",
            "url": "https://files.pythonhosted.org/packages/69/1e/9fc739eb828c66e35a826e78fbc8b286b954ddd58edbaed640e70a2b6e12/tslist-0.3.2.zip",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-06 11:15:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sonntagsgesicht",
    "github_project": "tslist",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "auxilium",
            "specs": []
        },
        {
            "name": "python-dateutil",
            "specs": []
        },
        {
            "name": "setuptools",
            "specs": []
        }
    ],
    "lcname": "tslist"
}
        
Elapsed time: 0.43669s