Skip to main content

Helper functions to handle banking holidays in Brazil

Project description

Anbima Calendar 🏦 📆

anbima-calendar

Introduction

Anbima Calendar is a Python library designed to simplify handling banking holidays specific to Brazil. ANBIMA (Associação Brasileira das Entidades dos Mercados Financeiro e de Capitais), the Brazilian Financial and Capital Markets Association, plays a crucial role in the development of financial markets in Brazil. This library provides a robust set of tools for determining business days, calculating due dates, and identifying holidays based on the official holiday calendar published by ANBIMA.

The holiday data used in Anbima Calendar is sourced directly from ANBIMA's official website: https://www.anbima.com.br/feriados/feriados.asp. This ensures that the library stays up-to-date with the most accurate and relevant holiday information, making it an invaluable resource for financial applications, scheduling systems, and any software dealing with date calculations in the Brazilian context.

Whether you're developing a finance-related application, a scheduling tool, or simply need to be aware of Brazilian banking holidays, Anbima Calendar offers a straightforward and efficient solution to navigate through the complexities of holiday scheduling in Brazil's financial markets.

Features

  • Identify Business Days: Quickly determine if a specific date is a business day in Brazil.
  • Calculate Due Dates: Accurately calculate due dates taking into account weekends and holidays.
  • Discover Holidays: Retrieve information about specific Brazilian holidays.
  • Add Business Days: Add a specified number of business days to a given date.

Installation

Install Anbima Calendar using pip:

pip install anbima_calendar

Quickstart

Here's a quick example to get you started with Anbima Calendar:

from anbima_calendar import is_business_day, add_business_days, get_holiday

# Check if a date is a business day
print(is_business_day('2023-04-21'))  # False, as it's Tiradentes' Day

# Add business days to a date
new_date = add_business_days(5, '2023-04-18')
print(new_date)  # Returns the date after adding 5 business days

# Retrieve the holiday name
holiday = get_holiday('2023-04-21')
print(holiday)  # Tiradentes

Checking Business Days:

Determine if a given date is a business day in Brazil.

from anbima_calendar import is_business_day

print(is_business_day('2023-12-25'))  # False, Christmas Day is a holiday

Adding Business Days:

Add business days to a date, automatically skipping weekends and holidays.

from anbima_calendar import add_business_days

new_date = add_business_days(10, '2023-12-20')
print(new_date)  # Date 10 business days from December 20, 2023

Identifying Holidays

Find out if a date is a holiday and get its name.

from anbima_calendar import get_holiday

holiday_name = get_holiday('2023-05-01')
print(holiday_name)  # Dia do Trabalho (Labor Day)

Contributing

Contributions to Anbima Calendar are welcome! Whether it's bug reports, feature requests, or code contributions, your input is highly valued. Please refer to our Please refer to our contributing guidelines for more information.

License

Anbima Calendar is licensed under the MIT License. See the LICENSE file for more details.

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

anbima_calendar-0.1.1.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

anbima_calendar-0.1.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file anbima_calendar-0.1.1.tar.gz.

File metadata

  • Download URL: anbima_calendar-0.1.1.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.9.13 Darwin/22.3.0

File hashes

Hashes for anbima_calendar-0.1.1.tar.gz
Algorithm Hash digest
SHA256 633f13aaf8183db5a3839a43ff594498472279239608afbe2f418a26deaa121a
MD5 33b7d607230a800d6551ed554ff9f4c5
BLAKE2b-256 4c646d258ae072933db21afe98459ff1339fd4b2b834265145565c76729d5365

See more details on using hashes here.

File details

Details for the file anbima_calendar-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: anbima_calendar-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.9.13 Darwin/22.3.0

File hashes

Hashes for anbima_calendar-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f9e18e1d0ab96cceb90e1e0e69504ed68b4f5690ad646d04745bdda84f1292f0
MD5 15beed9e493f1e1996346f3e73a725c8
BLAKE2b-256 7392314b48ffabeff02fccceabaaf9c382397f315e4dc114b53a2a96246711da

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