Skip to main content

A package for extracting dates!

Project description

Documentation Status ci-cd codecov

Date Extractor Python Package

This project provides a Python utility package to extract specific components (year, month, day, and time) from ISO 8601 date strings. The input can either be in a string format or a pandas series. These functions can be applied individually or integrated with data analysis workflows in Pandas, simplifying date manipulation and analysis.

Setup Instructions

1. Use Conda Environment

Make sure you have conda installed. If you don't have it, install it from here.

If needed, set up conda:

bash ${HOME}/Downloads/Miniforge3.sh -b -p "${HOME}/miniforge3"
source "${HOME}/miniforge3/etc/profile.d/conda.sh"
conda activate
conda init

Create and activate the conda environment:

conda env create -f environment.yml
conda activate date_extractor_env

2. Install Poetry

Poetry is the tool used to manage dependencies. You need to install Poetry globally.

Run the following command to install Poetry:

curl -sSL https://install.python-poetry.org | python3 -

Running Tests

1. Run Poetry Install

In the root of the folder, run in terminal:

poetry install

2. Run Tests

Run the follow commands sequentially to check that the tests pass, and to check test coverage:

poetry run pytest
poetry run pytest --cov=src/date_extractor_mds
poetry run pytest --cov-branch --cov=src/date_extractor_mds

Package Installation

$ pip install date_extractor_mds

Usage

  • extract_year: Extracts the year as a four-digit integer from an ISO 8601 date string.
  • extract_month: Retrieves the month as an integer (1-12) from the ISO 8601 date.
  • extract_day: Captures the day as an integer (1-31) from the ISO date.
  • extract_time: Returns the time component as a string in hh:mm:ss format.

Position in Python Ecosystem:

This package complements existing Python libraries like datetime and pandas by offering specialized, lightweight utilities focused solely on ISO 8601 string manipulation. While datetime provides similar functionality, this package simplifies usage by bypassing full date parsing for basic extraction tasks, increasing performance in large-scale data analysis.

Contributing

Interested in contributing? Check out the Contributing Guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

Contributors

Rashid Mammadov, Derek Rodgers, Yibin Long, Fazeeia Mohammed.

License

The Date Extractor Python Package was created by Rashid Mammadov, Derek Rodgers, Yibin Long, and Fazeeia Mohammed. It is licensed under the terms of the MIT license, linked here.

Credits

date_extractor_mds was created with cookiecutter and the py-pkgs-cookiecutter template.

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

date_extractor_mds-1.2.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

date_extractor_mds-1.2.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file date_extractor_mds-1.2.0.tar.gz.

File metadata

  • Download URL: date_extractor_mds-1.2.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for date_extractor_mds-1.2.0.tar.gz
Algorithm Hash digest
SHA256 4f8b90311c9f3ee7d0c45705384e08a9d83ead07cafcc0c676b85b156924624d
MD5 a3c00bcf5998972af360ae9074e211ad
BLAKE2b-256 92dca03a90965d18ca4ac7e4b23bc295834b363f1701408f068cb88e9cd25f7a

See more details on using hashes here.

File details

Details for the file date_extractor_mds-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for date_extractor_mds-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a4f2737545899eef724719523ee4eea46000ba098896237fe6278dfff5c4372
MD5 58693bd3aed8fd18db2c67fe688ed389
BLAKE2b-256 0d9abf609e6312b1badab0261e544e6a3ce908d8c0388f373bdb184547d8a304

See more details on using hashes here.

Supported by

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