tlid


Nametlid JSON
Version 0.1.17 PyPI version JSON
download
home_pagehttps://github.com/tlid/tlid/tree/master/src/python
SummaryA utility for creating datetime-based strings for file naming in timeline.
upload_time2024-11-24 16:09:43
maintainerNone
docs_urlNone
authorGUillaume Isabelle
requires_python>=2.7
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # tlid

## Installation

```sh
pip install tlid
```

## Usage:
```python

import tlid

# Get TLID
tlid_str = tlid.get_tlid()
print(tlid_str)  # Outputs: YYMMDDHHMMSS

# Get TLID with milliseconds
tlid_milli = tlid.get_milliseconds()
print(tlid_milli)  # Outputs: YYMMDDHHMMSSmmm

# Get TLID for different time granularities
print(tlid.get_seconds())  # Outputs: YYMMDDHHMMSS
print(tlid.get_minutes())  # Outputs: YYMMDDHHMM
print(tlid.get_hour())     # Outputs: YYMMDDHH
print(tlid.get_day())      # Outputs: YYMMDD
print(tlid.get_month())    # Outputs: YYMM
print(tlid.get_year())     # Outputs: YY

# Check if a string has a TLID
print(tlid.has_tlid('Hello 210101010101 World'))  # Outputs: True

# Extract TLID from a string
print(tlid.extract_tlid('Hello 210101010101 World'))  # Outputs: 210101010101

# Clean a string from its TLID
print(tlid.clean_tlid('Hello 210101010101 World'))  # Outputs: Hello World

# Convert a TLID string to a datetime object
print(tlid.to_date('210101010101'))  # Outputs: 2021-01-01 01:01:01

```



```markdown
# pytlid

`pytlid` is a command-line interface for generating time-based identifiers using the `tlid` Python package.



## Usage

To use `pytlid`, simply run the command followed by the desired time unit. The default time unit is minutes if no argument is provided.

```sh
pytlid [unit]
```

Here are the available units and their corresponding outputs:

- `h`: Current hour in YYMMDDHH format
- `s`: Current seconds in YYMMDDHHMMSS format
- `ms`: Current milliseconds in YYMMDDHHMMSSmmm format
- `m`: Current month in YYMM format
- `M`: Current month in YYMM format (same as `m`)
- `y`: Current year in YY format
- `d`: Current day in YYMMDD format

### Examples

To get the current time in minutes:

```sh
pytlid
```

To get the current time in hours:

```sh
pytlid h
```

To get the current time in seconds:

```sh
pytlid s
```

For help:

```sh
pytlid --help
```

This will display the help message for the `pytlid` command.
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/tlid/tlid/tree/master/src/python",
    "name": "tlid",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=2.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "GUillaume Isabelle",
    "author_email": "jgi@jgwill.com",
    "download_url": "https://files.pythonhosted.org/packages/46/d4/802c6d7a2b2c8e80c541fc0add65a4490ab279b13dfac924358495ea3bac/tlid-0.1.17.tar.gz",
    "platform": null,
    "description": "# tlid\n\n## Installation\n\n```sh\npip install tlid\n```\n\n## Usage:\n```python\n\nimport tlid\n\n# Get TLID\ntlid_str = tlid.get_tlid()\nprint(tlid_str)  # Outputs: YYMMDDHHMMSS\n\n# Get TLID with milliseconds\ntlid_milli = tlid.get_milliseconds()\nprint(tlid_milli)  # Outputs: YYMMDDHHMMSSmmm\n\n# Get TLID for different time granularities\nprint(tlid.get_seconds())  # Outputs: YYMMDDHHMMSS\nprint(tlid.get_minutes())  # Outputs: YYMMDDHHMM\nprint(tlid.get_hour())     # Outputs: YYMMDDHH\nprint(tlid.get_day())      # Outputs: YYMMDD\nprint(tlid.get_month())    # Outputs: YYMM\nprint(tlid.get_year())     # Outputs: YY\n\n# Check if a string has a TLID\nprint(tlid.has_tlid('Hello 210101010101 World'))  # Outputs: True\n\n# Extract TLID from a string\nprint(tlid.extract_tlid('Hello 210101010101 World'))  # Outputs: 210101010101\n\n# Clean a string from its TLID\nprint(tlid.clean_tlid('Hello 210101010101 World'))  # Outputs: Hello World\n\n# Convert a TLID string to a datetime object\nprint(tlid.to_date('210101010101'))  # Outputs: 2021-01-01 01:01:01\n\n```\n\n\n\n```markdown\n# pytlid\n\n`pytlid` is a command-line interface for generating time-based identifiers using the `tlid` Python package.\n\n\n\n## Usage\n\nTo use `pytlid`, simply run the command followed by the desired time unit. The default time unit is minutes if no argument is provided.\n\n```sh\npytlid [unit]\n```\n\nHere are the available units and their corresponding outputs:\n\n- `h`: Current hour in YYMMDDHH format\n- `s`: Current seconds in YYMMDDHHMMSS format\n- `ms`: Current milliseconds in YYMMDDHHMMSSmmm format\n- `m`: Current month in YYMM format\n- `M`: Current month in YYMM format (same as `m`)\n- `y`: Current year in YY format\n- `d`: Current day in YYMMDD format\n\n### Examples\n\nTo get the current time in minutes:\n\n```sh\npytlid\n```\n\nTo get the current time in hours:\n\n```sh\npytlid h\n```\n\nTo get the current time in seconds:\n\n```sh\npytlid s\n```\n\nFor help:\n\n```sh\npytlid --help\n```\n\nThis will display the help message for the `pytlid` command.\n```\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A utility for creating datetime-based strings for file naming in timeline.",
    "version": "0.1.17",
    "project_urls": {
        "Homepage": "https://github.com/tlid/tlid/tree/master/src/python"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ffb50d07b4057d4e62c001a164d8eb274dff98aa4d1d0fd37b6d1087f704e5bb",
                "md5": "b47f55e4278738992b64ea7ab5969266",
                "sha256": "fc48c4fbe63889f1fcd01f4e7891cbd147c26d038b876390466aa71d8fd03259"
            },
            "downloads": -1,
            "filename": "tlid-0.1.17-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b47f55e4278738992b64ea7ab5969266",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=2.7",
            "size": 3923,
            "upload_time": "2024-11-24T16:09:42",
            "upload_time_iso_8601": "2024-11-24T16:09:42.369407Z",
            "url": "https://files.pythonhosted.org/packages/ff/b5/0d07b4057d4e62c001a164d8eb274dff98aa4d1d0fd37b6d1087f704e5bb/tlid-0.1.17-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "46d4802c6d7a2b2c8e80c541fc0add65a4490ab279b13dfac924358495ea3bac",
                "md5": "15d9e122f1ffba842cc1e9a1c7c0edda",
                "sha256": "0fc707eecef99d6eb5872ce9e3afffd684beacba4bd260bb73450e5efb8e6dfd"
            },
            "downloads": -1,
            "filename": "tlid-0.1.17.tar.gz",
            "has_sig": false,
            "md5_digest": "15d9e122f1ffba842cc1e9a1c7c0edda",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.7",
            "size": 3641,
            "upload_time": "2024-11-24T16:09:43",
            "upload_time_iso_8601": "2024-11-24T16:09:43.979090Z",
            "url": "https://files.pythonhosted.org/packages/46/d4/802c6d7a2b2c8e80c541fc0add65a4490ab279b13dfac924358495ea3bac/tlid-0.1.17.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-24 16:09:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tlid",
    "github_project": "tlid",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "tlid"
}
        
Elapsed time: 0.59227s