# 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/00/2e/4be6936c53460ea307f07b95170cf1410499713bd2ee2c5056a23b25c36d/tlid-0.1.16.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.16",
"project_urls": {
"Homepage": "https://github.com/tlid/tlid/tree/master/src/python"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bab2c1371c02736c8e7a3eb8626c52e8a45a2ba59b1959ef8c934a001b7da47b",
"md5": "a939b41b04f0500c6d4060d7feec30c8",
"sha256": "a339ef78b896cc16d2296b014e9cf6173f59261343b7381cc2c3e3fa339f6127"
},
"downloads": -1,
"filename": "tlid-0.1.16-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a939b41b04f0500c6d4060d7feec30c8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=2.7",
"size": 3915,
"upload_time": "2024-09-11T23:07:09",
"upload_time_iso_8601": "2024-09-11T23:07:09.745747Z",
"url": "https://files.pythonhosted.org/packages/ba/b2/c1371c02736c8e7a3eb8626c52e8a45a2ba59b1959ef8c934a001b7da47b/tlid-0.1.16-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "002e4be6936c53460ea307f07b95170cf1410499713bd2ee2c5056a23b25c36d",
"md5": "ee2977f77a94647545a82418d8d7dfcd",
"sha256": "cd8756a51474c50960c8725f31e03a992046ef4c75dd4f00b6974241def4c586"
},
"downloads": -1,
"filename": "tlid-0.1.16.tar.gz",
"has_sig": false,
"md5_digest": "ee2977f77a94647545a82418d8d7dfcd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7",
"size": 3602,
"upload_time": "2024-09-11T23:07:10",
"upload_time_iso_8601": "2024-09-11T23:07:10.676625Z",
"url": "https://files.pythonhosted.org/packages/00/2e/4be6936c53460ea307f07b95170cf1410499713bd2ee2c5056a23b25c36d/tlid-0.1.16.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-11 23:07:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tlid",
"github_project": "tlid",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "tlid"
}