semvec/pypi-packages huggingface dataset:
datefind 0.2.1
A python module for locating dates within text.
Requires Python: <=3.13,>=3.11

[![Tests](https://github.com/natelandau/datefind/actions/workflows/test.yml/badge.svg)](https://github.com/natelandau/datefind/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/natelandau/datefind/graph/badge.svg?token=CXstf6zblD)](https://codecov.io/gh/natelandau/datefind)

# datefind

A python module for locating dates within text. Use this package to search for dates and convert them to datetime objects.

Finds dates in many different formats.

-   All numeric - `2024-01-01`, `01/01/2024`, `01012024`
-   Natural language - `January 1st, 2024`, `March nineteenth, 2024`, `twenty fifth of January`
-   Fuzzy dates - `today`, `yesterday`, `tomorrow`, `last week`, `next week`

> [!NOTE]\
> datefind is designed to be used with year, month, and day only. It does not support hours, minutes, seconds, or microseconds.

## Installation

Requires Python 3.11 or higher.

```bash
pip install datefind
```

## Usage

```python
from datefind import find_dates

string = "2024-01-01 and 2024-01-02"

for date in find_dates(string, tz="America/New_York"):
    print(date)

>>> Date(
    date=datetime.datetime(2024, 1, 1, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='America/New_York')),
    match='2024-01-01',
    span=(0, 10)
    )
>>> Date(
    date=datetime.datetime(2024, 1, 2, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='America/New_York')),
    match='2024-01-02',
    span=(15, 25)
    )
```

### find_dates

The `find_dates()` function is the main entry point for the datefind package. It takes a string of text and returns a generator of Date objects.

**Arguments**

-   `text` - The text to search for dates.
-   `first` - The first number to find in ambiguous dates. (one of `month`, `day`, `year`) Default is `month`
-   `tz` - The timezone to use. Defaults to the local timezone.

For each date found, a Date object is returned. The Date object has the following properties:

-   `date` - The datetime object.
-   `match` - The matched portion of the text.
-   `span` - The span of the matched text in the original text.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
Xarsed 0.0.0
Computational modules of the Xarsed project, functions to describe the conditions of nature
Requires Python: >=3.13
Keywords: nature, energy, production, consumption, radiation, photovoltaics, zenith, azimuth, electricity, battery

The Xarsed package is the beating heart of the Xarsed web app. This package contains all of the Xarsed computational modules. This has two benefits: it makes it easier to develop the web app and package in a centralized and separate manner, and it makes the capabilities of Xarsed available to everyone. Currently, you can perform various functions, including calculations of solar zenith and azimuth angles, calculations of photovoltaic module power, calculations of solar radiation on the surface of tilted and tracker panels, and ... with the help of the Xarsed package.
sr-agreement 0.0.12
This is a python implementation of https://github.com/tagteam/SuperRanker, based on Ekstrøm et al (2019) 'Sequential rank agreement methods for comparison of ranked lists'.
Requires Python: <4.0,>=3.11
Keywords: python

This is a Python implementation of R's SuperRanker package (https://github.com/tagteam/SuperRanker), based on Ekstrøm et al (2019) "Sequential rank agreement methods for comparison of ranked lists".