The hiereskopia package is a library to infer properties like date formats or numeric separators in pandas series of type object or string.
Project description
Hieroskopia
The hiereskopia package is a library to infer properties like date formats or numeric separators in pandas series of type object or string.
Support
Date-times:
- Support to dates and datetime format
- This library receive a series as input and try to return a dictionary with the format found in the series Based on the 1989 C Standard date time format code
Numeric:
- This library receive a series as input and try to return a dictionary with the three digit and decimal character separator
Usage
Infer datetime
>>> from hieroskopia import InferDatetime
>>> InferNumeric.infer(pd.Series(["2019-11-27",
"2019/11/28",
"2018-11-08"]))
>>> {'formats': ['%Y-%m-%d', '%Y/%m/%d']}
The above method works with a best guess approach to detect a format in a object type series and try
to return a datetime.strftime
/strptime
format that will cover or parse the majority
of the samples.
Infer numeric
>>> from hieroskopia import InferNumeric
>>> InferNumeric.infer(pd.Series(['767313628196.2', '76731362819.546', '767313628196']))
>>> {'three_digit_separator': '', 'decimal_separator': '.' }
The above method will try to detect and return certain properties in a object type series
like three_digit_separator
or decimal_separator
character that will cover
the majority of the samples.
To do:
- Specify another output standard format to support java date format, snowflake date characters definition etc.
- Feed more regular expressions
- Add Time format
- Develop multiple algorithms to get a better precision.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for hieroskopia-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d63cbb11f34ca0cd936cf3bba2f33d5ce2cdb93830067a9c384f9b999975d177 |
|
MD5 | f8a322bcb64c6729866e661880a981a4 |
|
BLAKE2b-256 | ad9ddd5a0be4a6ff9203ca03cd8520fa8c98a48c74071bdfad335e953fa87ffe |