tlid
Installation
pip install tlid
Usage:
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
# 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 formats: Current seconds in YYMMDDHHMMSS formatms: Current milliseconds in YYMMDDHHMMSSmmm formatm: Current month in YYMM formatM: Current month in YYMM format (same asm)y: Current year in YY formatd: Current day in YYMMDD format
Examples
To get the current time in minutes:
pytlid
To get the current time in hours:
pytlid h
To get the current time in seconds:
pytlid s
For help:
pytlid --help
This will display the help message for the pytlid command.
Metadata
Release files for tlid 0.1.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tlid-0.1.17.tar.gz | 3.6 kB | Without provenance | Details for tlid-0.1.17.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tlid-0.1.17-py3-none-any.whl | Python 3 | none | any | Details for tlid-0.1.17-py3-none-any.whl |
Total release size: 7.6 kB
Release files / tlid-0.1.17.tar.gz
| Download URL | tlid-0.1.17.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0fc707eecef99d6eb5872ce9e3afffd684beacba4bd260bb73450e5efb8e6dfd
|
|
BLAKE2b-256 checksum How to use checksums |
46d4802c6d7a2b2c8e80c541fc0add65a4490ab279b13dfac924358495ea3bac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.14
|
Release files / tlid-0.1.17-py3-none-any.whl
| Download URL | tlid-0.1.17-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc48c4fbe63889f1fcd01f4e7891cbd147c26d038b876390466aa71d8fd03259
|
|
BLAKE2b-256 checksum How to use checksums |
ffb50d07b4057d4e62c001a164d8eb274dff98aa4d1d0fd37b6d1087f704e5bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.14
|
Security for tlid 0.1.17
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.