Metadata-Version: 2.1
Name: alphabetic_timestamp
Version: 1.1.0
Summary: This is small Python package which encode standard timestamp to shorted form by using alphabetic symbols.
Home-page: https://github.com/ShadowCodeCz/alphabetic_timestamp
Author: ShadowCodeCz
Author-email: shadow.code.cz@gmail.com
License: GNU Affero General Public License v3 or later (AGPLv3+)
Project-URL: Source, https://github.com/ShadowCodeCz/alphabetic_timestamp
Project-URL: Tracker, https://github.com/ShadowCodeCz/alphabetic_timestamp/issues
Description: # Alphabetic Timestamp
        
        [![PyPI-Status](https://img.shields.io/pypi/v/alphabetic-timestamp.svg)](https://pypi.org/project/alphabetic-timestamp/)
        [![PyPI-Versions](https://img.shields.io/pypi/pyversions/alphabetic-timestamp.svg)](https://pypi.org/project/alphabetic-timestamp/)
        [![GitHub issues](https://img.shields.io/github/issues/ShadowCodeCz/alphabetic_timestamp)](https://github.com/ShadowCodeCz/alphabetic_timestamp/issues)
        [![Build Status](https://travis-ci.com/ShadowCodeCz/alphabetic_timestamp.svg?branch=master)](https://travis-ci.com/ShadowCodeCz/alphabetic_timestamp)
        [![GitHub license](https://img.shields.io/github/license/ShadowCodeCz/alphabetic_timestamp)](https://github.com/ShadowCodeCz/alphabetic_timestamp/blob/master/LICENSE)
        
        This is small Python package which encode standard timestamp to shorted form by using alphabetic symbols. 
        
        ## Installation 
        
        ```python
        pip install alphabetic_timestamp 
        ``` 
        
        ## Description
        
        User can use two base for coding. It other words two different lists of symbols for encoding.
         * Base36
         
         * Base62
        
        ### Example of coding 
        This example show coding of datetime 2020-01-01 20:20:20.002000. It means timestamp 1577906420.002.
        
        
        | Time Units     | Base36       | Base62   |
        | -------------- |:------------:|:--------:|
        | seconds        |  q3g0dw      | 1IMJxy   |
        | deciseconds    |  78yg3uw     | hdRlpu   |
        | centiseconds   |  20hkh2kw    | 2MeBs6Q  |
        | milliseconds   |  k4voqpsy    | rMm2x6q  |
        
        
         ### Symbols of Base 36
        ```python
        import alphabetic_timestamp as ats
        
        print(ats.base36.symbols)
        
        >>> 0123456789abcdefghijklmnopqrstuvwxyz
        ``` 
         
        ### Symbols of Base 62
        ```python
        import alphabetic_timestamp as ats
        
        print(ats.base62.symbols)
        
        >>> 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
        ``` 
        
        ## Interface
        ```python
        import datetime
        import alphabetic_timestamp as ats
        
        dt = datetime.datetime.now()
        ts = dt.timestamp()
        
        ats.base36.now(time_unit=ats.TimeUnit.seconds)
        ats.base36.from_datetime(dt, time_unit=ats.TimeUnit.seconds)
        ats.base36.from_timestamp(ts, time_unit=ats.TimeUnit.seconds)
        
        ats.base36.to_datetime("q67vhw", time_unit=ats.TimeUnit.seconds, time_zone=None)
        ats.base36.to_timestamp("q67vhw", time_unit=ats.TimeUnit.seconds)
        ``` 
        
        Note: The string "q67vhw" is only example of encoded timestamp.
        
        ## Examples
        
        ### Encode & Print
        ```python
        import alphabetic_timestamp as ats
        
        print(ats.base36.now())
        
        # Current DT: 2020-02-24 18:34:44.349162
        >>> q67vhw
        ``` 
        
        ### Encoded & Decode
        ```python
        import datetime
        import alphabetic_timestamp as ats
        
        
        # DATETIME -> ALPHABETIC_TIMESTAMP -> DATETIME
        dt = datetime.datetime.now()
        
        alphabetic_ts_36 = ats.base36.from_datetime(dt)
        decoded_ts_36 = ats.base36.to_datetime(alphabetic_ts_36)
        
        alphabetic_ts_62 = ats.base62.from_datetime(dt)
        decoded_ts_62 = ats.base62.to_datetime(alphabetic_ts_62) 
        
        
        # TIMESTAMP -> ALPHABETIC_TIMESTAMP -> TIMESTAMP 
        ts = dt.timestamp()
        
        alphabetic_ts_36 = ats.base36.from_timestamp(ts)
        decoded_ts_36 = ats.base36.to_timestamp(alphabetic_ts_36)
        
        alphabetic_ts_62 = ats.base62.from_timestamp(ts)
        decoded_ts_62 = ats.base62.to_timestamp(alphabetic_ts_62)
        ``` 
        
        ### Time units
        ```python
        import datetime
        import alphabetic_timestamp as ats
        
        dt = datetime.datetime.now()
        
        
        # Set time unit for current timestamp
        
        now36_ts = ats.base36.now() # default: ats.TimeUnit.seconds
        now36_ts = ats.base36.now(time_unit=ats.TimeUnit.seconds)
        
        
        # Set time unit for specific datetime and timestamp
        
        alphabetic_ts_36 = ats.base36.from_datetime(dt, time_unit=ats.TimeUnit.seconds)
        alphabetic_ts_36 = ats.base36.from_timestamp(dt.timestamp(), time_unit=ats.TimeUnit.seconds)
        
        
        # Examples of available time units
        
        now36_ts = ats.base36.now(time_unit=ats.TimeUnit.deciseconds)
        now36_ts = ats.base36.now(time_unit=ats.TimeUnit.centiseconds)
        now36_ts = ats.base36.now(time_unit=ats.TimeUnit.milliseconds)
        ``` 
        
        ## Possible Issue
        There is a possible issue caused by [bug in standard datetime module](https://bugs.python.org/issue37527).
        
          
          
        
Keywords: timestamp alphabetic
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
