Skip to main content

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

codecov

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hieroskopia-0.1.30.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

hieroskopia-0.1.30-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file hieroskopia-0.1.30.tar.gz.

File metadata

  • Download URL: hieroskopia-0.1.30.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for hieroskopia-0.1.30.tar.gz
Algorithm Hash digest
SHA256 be8de95c43cb5d0e13c7836ef1f302ad1eb2cf20a853dfe6d775221a0b346945
MD5 a91f257ca96076e938c78b7f470fd26d
BLAKE2b-256 3298f924dab337fdd02614b2279be9f5367180ac88ec0283c3d51ebb3bc73fac

See more details on using hashes here.

File details

Details for the file hieroskopia-0.1.30-py3-none-any.whl.

File metadata

  • Download URL: hieroskopia-0.1.30-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for hieroskopia-0.1.30-py3-none-any.whl
Algorithm Hash digest
SHA256 2b5564a337e245a4b51b2e875313fdb0a4d0e9d36f48de57f5dd5551cd803f16
MD5 959cd26a15cdd1d2ddd53de80d172e5d
BLAKE2b-256 e162d7863967918d20ea49dd37449f28628dab6e7175df604a63d4e5121d4522

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page