workadays


Nameworkadays JSON
Version 2023.12.30 PyPI version JSON
download
home_pagehttps://github.com/mfhorita
SummaryCalendário de dias úteis, dias corridos e dias 360 (30/360).
upload_time2023-12-30 23:30:38
maintainer
docs_urlNone
authorMarcelo Horita
requires_python
licenseMIT License
keywords workdays workadays feriados holidays diasuteis uteis dias360 days360 days
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Workadays:
#### <h3>Pacote para calcular dias úteis, dias corridos e dias na base 360 (30/360).</h3>
Há calendários de feriados do Brasil, Estados Unidos, Luxemburgo, Reino Unido e Argentina. <p>
Considera o novo feriado dos EUA, Juneteenth. Consulte: https://pt.wikipedia.org/wiki/Juneteenth <p>
Considera o novo feriado nacional de 20/Nov (Conciência Negra)<p>


### Calendário de dias úteis:

```
import datetime as dt
from workadays import workdays as wd
```

### Dias corridos
```
d1 = dt.date(2018, 1, 7)
d2 = dt.date(2020, 12, 31)
print(wd.days(d1, d2))                          # 1089
```

### Dias corridos, base 30U/360, método americano 
```
d1 = dt.date(2018, 1, 7)
d2 = dt.date(2020, 12, 31)
print(wd.days360(d1, d2, method_eu=False))     # 1074
```

### Dias corridos, base 30E/360, método europeu 
```
d1 = dt.date(2018, 1, 7)
d2 = dt.date(2020, 12, 31)
print(wd.days360(d1, d2, method_eu=True))     # 1073
```

### Diferença de dias úteis entre duas datas
```
d1 = dt.date(2018, 1, 7)
d2 = dt.date(2020, 12, 31)
print(wd.networkdays(d1, d2))                # 750
```

### Diferença de dias úteis entre duas datas sem calendário de feriados (considera apenas os finais de semana como dia não útil)
```
d1 = dt.date(2018, 1, 7)
d2 = dt.date(2020, 12, 31)
print(wd.networkdays(d1, d2, country=None))  # 779
```

### # Soma 252 dias úteis com calendário de feriados padrão do Brasil
```
d1 = dt.date(2018, 1, 7)
print(wd.workdays(d1, 252))                  # 09/01/2019
```

### Soma 252 dias úteis a data de referência utilizando o calendário Brasil e de SP
```
d1 = dt.date(2018, 1, 7)
print(wd.workdays(d1, 252, country=None))    # 25/12/2018
```

### Verifica se é feriado
```
d1 = dt.date(2018, 1, 7)
print('É feriado? ', wd.is_holiday(d1, country='BR', years=range(2020, 2021)))
```

### Verifica se é final de semana
```
d1 = dt.date(2018, 1, 7)
print('É final de semana? ', wd.is_weekend(d1))
```

### Verifica se é dia útil
```
d1 = dt.date(2018, 1, 7)
print('É dia útil? ', wd.is_workday(d1, country='BR', years=range(2020, 2021)))
```

### Verifica se é ano bissexto
```
print('É ano bissexto? ', wd.is_leap_year(2008))
```

### Exibe a lista de feriados do Brasil e de São Paulo
```
for date in wd.get_holidays(country='BR', state='SP', years=range(2020, 2022)):
    print(date)
```

### Exibe a lista de feriados da Inglaterra e das Libor's
```
for date in wd.get_holidays(country='England', years=range(2019, 2023)):
    print(date)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mfhorita",
    "name": "workadays",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "workdays workadays feriados holidays diasuteis uteis,dias360,days360,days",
    "author": "Marcelo Horita",
    "author_email": "mfhorita@gmail.com.br",
    "download_url": "https://files.pythonhosted.org/packages/c6/8a/046bad09b2f0f68731190f09f3c4d582e49feb07c1292b1f55d221f36ee4/workadays-2023.12.30.tar.gz",
    "platform": null,
    "description": "## Workadays:\r\n#### <h3>Pacote para calcular dias \u00fateis, dias corridos e dias na base 360 (30/360).</h3>\r\nH\u00e1 calend\u00e1rios de feriados do Brasil, Estados Unidos, Luxemburgo, Reino Unido e Argentina. <p>\r\nConsidera o novo feriado dos EUA, Juneteenth. Consulte: https://pt.wikipedia.org/wiki/Juneteenth <p>\r\nConsidera o novo feriado nacional de 20/Nov (Conci\u00eancia Negra)<p>\r\n\r\n\r\n### Calend\u00e1rio de dias \u00fateis:\r\n\r\n```\r\nimport datetime as dt\r\nfrom workadays import workdays as wd\r\n```\r\n\r\n### Dias corridos\r\n```\r\nd1 = dt.date(2018, 1, 7)\r\nd2 = dt.date(2020, 12, 31)\r\nprint(wd.days(d1, d2))                          # 1089\r\n```\r\n\r\n### Dias corridos, base 30U/360, m\u00e9todo americano \r\n```\r\nd1 = dt.date(2018, 1, 7)\r\nd2 = dt.date(2020, 12, 31)\r\nprint(wd.days360(d1, d2, method_eu=False))     # 1074\r\n```\r\n\r\n### Dias corridos, base 30E/360, m\u00e9todo europeu \r\n```\r\nd1 = dt.date(2018, 1, 7)\r\nd2 = dt.date(2020, 12, 31)\r\nprint(wd.days360(d1, d2, method_eu=True))     # 1073\r\n```\r\n\r\n### Diferen\u00e7a de dias \u00fateis entre duas datas\r\n```\r\nd1 = dt.date(2018, 1, 7)\r\nd2 = dt.date(2020, 12, 31)\r\nprint(wd.networkdays(d1, d2))                # 750\r\n```\r\n\r\n### Diferen\u00e7a de dias \u00fateis entre duas datas sem calend\u00e1rio de feriados (considera apenas os finais de semana como dia n\u00e3o \u00fatil)\r\n```\r\nd1 = dt.date(2018, 1, 7)\r\nd2 = dt.date(2020, 12, 31)\r\nprint(wd.networkdays(d1, d2, country=None))  # 779\r\n```\r\n\r\n### # Soma 252 dias \u00fateis com calend\u00e1rio de feriados padr\u00e3o do Brasil\r\n```\r\nd1 = dt.date(2018, 1, 7)\r\nprint(wd.workdays(d1, 252))                  # 09/01/2019\r\n```\r\n\r\n### Soma 252 dias \u00fateis a data de refer\u00eancia utilizando o calend\u00e1rio Brasil e de SP\r\n```\r\nd1 = dt.date(2018, 1, 7)\r\nprint(wd.workdays(d1, 252, country=None))    # 25/12/2018\r\n```\r\n\r\n### Verifica se \u00e9 feriado\r\n```\r\nd1 = dt.date(2018, 1, 7)\r\nprint('\u00c9 feriado? ', wd.is_holiday(d1, country='BR', years=range(2020, 2021)))\r\n```\r\n\r\n### Verifica se \u00e9 final de semana\r\n```\r\nd1 = dt.date(2018, 1, 7)\r\nprint('\u00c9 final de semana? ', wd.is_weekend(d1))\r\n```\r\n\r\n### Verifica se \u00e9 dia \u00fatil\r\n```\r\nd1 = dt.date(2018, 1, 7)\r\nprint('\u00c9 dia \u00fatil? ', wd.is_workday(d1, country='BR', years=range(2020, 2021)))\r\n```\r\n\r\n### Verifica se \u00e9 ano bissexto\r\n```\r\nprint('\u00c9 ano bissexto? ', wd.is_leap_year(2008))\r\n```\r\n\r\n### Exibe a lista de feriados do Brasil e de S\u00e3o Paulo\r\n```\r\nfor date in wd.get_holidays(country='BR', state='SP', years=range(2020, 2022)):\r\n    print(date)\r\n```\r\n\r\n### Exibe a lista de feriados da Inglaterra e das Libor's\r\n```\r\nfor date in wd.get_holidays(country='England', years=range(2019, 2023)):\r\n    print(date)\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Calend\u00e1rio de dias \u00fateis, dias corridos e dias 360 (30/360).",
    "version": "2023.12.30",
    "project_urls": {
        "Homepage": "https://github.com/mfhorita"
    },
    "split_keywords": [
        "workdays workadays feriados holidays diasuteis uteis",
        "dias360",
        "days360",
        "days"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "efe16260bb0358ce71a15494b1248eef9eece7bedf60241f94b0b9b2d1c3a14c",
                "md5": "151d9fdc5bd05333d76abacd639543b1",
                "sha256": "97cf5feb72982212aa74783d17a296434d1a9890885f6d08426096124fcf99b6"
            },
            "downloads": -1,
            "filename": "workadays-2023.12.30-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "151d9fdc5bd05333d76abacd639543b1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 21304,
            "upload_time": "2023-12-30T23:30:36",
            "upload_time_iso_8601": "2023-12-30T23:30:36.722633Z",
            "url": "https://files.pythonhosted.org/packages/ef/e1/6260bb0358ce71a15494b1248eef9eece7bedf60241f94b0b9b2d1c3a14c/workadays-2023.12.30-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c68a046bad09b2f0f68731190f09f3c4d582e49feb07c1292b1f55d221f36ee4",
                "md5": "65cafd086d364f98fdce79ce9bbce81b",
                "sha256": "32999c996f45e126bb85bb1a2b2cbc8f4043609132015efcc77af675fa133592"
            },
            "downloads": -1,
            "filename": "workadays-2023.12.30.tar.gz",
            "has_sig": false,
            "md5_digest": "65cafd086d364f98fdce79ce9bbce81b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 36551,
            "upload_time": "2023-12-30T23:30:38",
            "upload_time_iso_8601": "2023-12-30T23:30:38.686244Z",
            "url": "https://files.pythonhosted.org/packages/c6/8a/046bad09b2f0f68731190f09f3c4d582e49feb07c1292b1f55d221f36ee4/workadays-2023.12.30.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-30 23:30:38",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "workadays"
}
        
Elapsed time: 3.52305s