newold


Namenewold JSON
Version 0.0.2 PyPI version JSON
download
home_pagehttps://gitlab.com/Zer1t0/newold
SummaryPrint only new values to stdout, or those that weren't seen in a while.
upload_time2023-11-15 18:22:53
maintainer
docs_urlNone
authorEloy Pérez González
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # newold

Print only new values to stdout, or those that weren't seen in a while.

## Usage

In order to allow old values, newold requires a database to store the values last seen time. You can specify the database file with `--db` parameter or `NEWOLD_DB` environment variable.

Here is an usage example:
```
$ cat /tmp/inputs.txt
one
two
three
$ # new values are printed
$ cat /tmp/inputs.txt | newold --db /tmp/in.db
one
two
three
$ # values are not printed
$ cat /tmp/inputs.txt | newold --db /tmp/in.db
$ sleep 5
$ # values older than 4 seconds are printed
$ cat /tmp/inputs.txt | newold --db /tmp/in.db --seconds 4
one
two
three
$ echo four >> /tmp/inputs.txt
$ # new values are printed
$ export NEWOLD_DB=/tmp/in.db
$ cat /tmp/inputs.txt | newold
four
```

Without a database only new values are printed to stdout. This behaves like an`uniq` command that doesn't require the lines to be ordered:
```
$ cat /tmp/inputs.txt
one
two
one
three
$ cat /tmp/inputs.txt | newold
one
two
three
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/Zer1t0/newold",
    "name": "newold",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Eloy P\u00e9rez Gonz\u00e1lez",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/7d/26/87f49af61bfd689cbfd5f987f6de6940a4ebe122537c7c48488f76261221/newold-0.0.2.tar.gz",
    "platform": null,
    "description": "# newold\n\nPrint only new values to stdout, or those that weren't seen in a while.\n\n## Usage\n\nIn order to allow old values, newold requires a database to store the values last seen time. You can specify the database file with `--db` parameter or `NEWOLD_DB` environment variable.\n\nHere is an usage example:\n```\n$ cat /tmp/inputs.txt\none\ntwo\nthree\n$ # new values are printed\n$ cat /tmp/inputs.txt | newold --db /tmp/in.db\none\ntwo\nthree\n$ # values are not printed\n$ cat /tmp/inputs.txt | newold --db /tmp/in.db\n$ sleep 5\n$ # values older than 4 seconds are printed\n$ cat /tmp/inputs.txt | newold --db /tmp/in.db --seconds 4\none\ntwo\nthree\n$ echo four >> /tmp/inputs.txt\n$ # new values are printed\n$ export NEWOLD_DB=/tmp/in.db\n$ cat /tmp/inputs.txt | newold\nfour\n```\n\nWithout a database only new values are printed to stdout. This behaves like an`uniq` command that doesn't require the lines to be ordered:\n```\n$ cat /tmp/inputs.txt\none\ntwo\none\nthree\n$ cat /tmp/inputs.txt | newold\none\ntwo\nthree\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Print only new values to stdout, or those that weren't seen in a while.",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://gitlab.com/Zer1t0/newold"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "46ae2cdd6126eca61c776c64ef188821f9a08e19de1ffe9fb85f9c4e98a7d383",
                "md5": "8e2e9fe3e5871e2f2f6d536eb75c0624",
                "sha256": "a9585a9ddd2361678800e66bf49c23b4a70a2bfecf28abd3e7db7986c1742949"
            },
            "downloads": -1,
            "filename": "newold-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8e2e9fe3e5871e2f2f6d536eb75c0624",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 16236,
            "upload_time": "2023-11-15T18:22:51",
            "upload_time_iso_8601": "2023-11-15T18:22:51.612695Z",
            "url": "https://files.pythonhosted.org/packages/46/ae/2cdd6126eca61c776c64ef188821f9a08e19de1ffe9fb85f9c4e98a7d383/newold-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7d2687f49af61bfd689cbfd5f987f6de6940a4ebe122537c7c48488f76261221",
                "md5": "820f5b9aad6ac57a10af52c681d9195d",
                "sha256": "19897a73a1f9b2e5e9f20eb73772f1592ca2191f447b3bcc582fe9a7665ffa51"
            },
            "downloads": -1,
            "filename": "newold-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "820f5b9aad6ac57a10af52c681d9195d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 15918,
            "upload_time": "2023-11-15T18:22:53",
            "upload_time_iso_8601": "2023-11-15T18:22:53.466345Z",
            "url": "https://files.pythonhosted.org/packages/7d/26/87f49af61bfd689cbfd5f987f6de6940a4ebe122537c7c48488f76261221/newold-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-15 18:22:53",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "Zer1t0",
    "gitlab_project": "newold",
    "lcname": "newold"
}
        
Elapsed time: 0.28870s