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 (Default) , Snowflake Standard or Java Simple 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 or date
>>> from hieroskopia import InferDatetime
>>> InferDatetime.infer(pd.Series(["2019-11-27",
"2019/11/28",
"2018-11-08"]))
>>> {'formats': ['%Y-%m-%d', '%Y/%m/%d'], 'type':'date'}
Using return_format
parameter
>>> from hieroskopia import InferDatetime
>>> InferDatetime.infer(pd.Series(["2019-11-27",
"2019/11/28",
"2018-11-08"]), return_format='snowflake')
>>> {'formats': ['yyyy-mm-dd', 'yyyy/mm/dd'], 'type':'date'}
>>> from hieroskopia import InferDatetime
>>> InferDatetime.infer(pd.Series(["2019-11-27",
"2019/11/28",
"2018-11-08"]), return_format='java')
>>> {'formats': ['yyyy-MM-dd', 'yyyy/MM/dd'], 'type':'date'}
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
, Snowflake Date format
, Java Simple Date Format
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': '.', 'type':'float'}
The above method will try to detect and return certain properties in a object type series
like datatype
, three_digit_separator
or decimal_separator
character that will cover
the majority of the samples.
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
File details
Details for the file hieroskopia-0.1.28.tar.gz
.
File metadata
- Download URL: hieroskopia-0.1.28.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8da3a16fa482a6d690e6fc27020c717ca89d4f8585e10f741b609dc48c2b80ee |
|
MD5 | 656442076551a199ab5942fc8b80b855 |
|
BLAKE2b-256 | c80acda469c262db0f00ed3fed96f31447d5176d6a7999048fbf8c0308eebc83 |
File details
Details for the file hieroskopia-0.1.28-py3-none-any.whl
.
File metadata
- Download URL: hieroskopia-0.1.28-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f52f1adc21f117a4137bbbaa35ee7e1794338558e6206c82206e2d3c94789916 |
|
MD5 | 2ba5cf8ab5383e17f7acafbb398ac44e |
|
BLAKE2b-256 | b51b0f2c2f644fb3311337b5985c558e1da7439adb393b1ec9f275c80c619e65 |