Skip to main content

A lightweight Python library for python utilities for holidays, dates, options and other tools

Project description

chameli

chameli is a lightweight Python library providing utilities for working with holidays, dates, options, and other trading-related tools. It is designed to simplify common tasks in quantitative finance and trading workflows.


Features

  • Date Utilities: Simplify date and time operations.
  • Options Pricing: Tools for European options calculations.
  • External Interactions: Functions for assisting web scraping, reading and writing R files.
  • Config Management: Centralized configuration management using YAML files.

Installation

Install the package using pip:

pip install chameli

Functions Overview

Below is a list of available functions in each module. For detailed usage, use the help(function_name) command in Python.

dateutils Module

  • load_holidays_by_exchange()
  • valid_datetime(sdatetime, out_pattern=None)
  • is_business_day(date, exchange="NSE")
  • business_days_between(start_date, end_date, include_first=False, include_last=False, exchange="NSE")
  • calc_fractional_business_days(start_datetime, end_datetime, exchange="NSE")
  • advance_by_biz_days(datetime_, days, adjustment="fbd", exchange="NSE")
  • get_last_day_of_month(year, month)
  • get_expiry(date, weekly=0, day_of_week=4, exchange="NSE")
  • is_aware(datetime_)
  • get_aware_dt(datetime_, tz="Asia/Kolkata")
  • get_naive_dt(datetime_)
  • is_time_between(begin_time, end_time, check_time)

europeanoptions Module

  • BlackScholesPrice(S, X, r, sigma, T, OptionType)
  • BlackScholesDelta(S, X, r, sigma, T, OptionType)
  • BlackScholesGamma(S, X, r, sigma, T)
  • BlackScholesVega(S, X, r, sigma, T)
  • BlackScholesTheta(S, X, r, sigma, T, OptionType, daysInYear=252)
  • BlackScholesIV(S, X, r, T, OptionType, OptionPrice, seed=0.2)
  • calc_delta(long_symbol, opt_price, underlying, time, days_in_year=252, risk_free_rate=0, exchange="NSE")
  • get_option_price(long_symbol, S, sigma, calc_time, r=0, days_in_year=252, exchange="NSE")
  • calc_greeks(long_symbol, opt_price, underlying, calc_time, greeks, days_in_year=252, risk_free_rate=0, exchange="NSE")
  • generate_opt_simulation(symbols, quantities, target_date, vol_shift, start_range, end_range, increment, market_data, exchange="NSE")
  • find_x_intercepts(price, value)

interactions Module

  • readRDS(filename)
  • saveRDS(pd_file, path)
  • send_mail(send_from, send_to, password, subject, text, files=None, is_html=False)
  • get_session_or_driver(url_to_test, get_session=True, headless=False, desktop_session=4, proxy_source=None, api_key=None, proxy_user=None, proxy_password=None, country_code=None, webdriver_path=None)

miscutils Module

  • convert_to_dot_dict(dictionary)
  • np_ffill(arr, axis=0)

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

chameli-0.1.4.tar.gz (28.3 kB view details)

Uploaded Source

Built Distribution

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

chameli-0.1.4-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

Details for the file chameli-0.1.4.tar.gz.

File metadata

  • Download URL: chameli-0.1.4.tar.gz
  • Upload date:
  • Size: 28.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.16

File hashes

Hashes for chameli-0.1.4.tar.gz
Algorithm Hash digest
SHA256 e7fc70364d272cba71df391b211f4878652b54dc13f48752ace37c2a565e26d8
MD5 8a02d92209fe1f70b53b7be19104d1ed
BLAKE2b-256 8b285d202bfdec8c3a9d24ff8ef7bc8d8b38142b0e9d2bfc2aacdb89e57bfa7a

See more details on using hashes here.

File details

Details for the file chameli-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: chameli-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 28.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.16

File hashes

Hashes for chameli-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c53ebe237c0b6010568d75959d6a5b681f7831a93e94761d57dc2c6c89bde927
MD5 4397f543bc7a9c2fb10c1ba31fcfafef
BLAKE2b-256 10e183f53d7581e85d82cb83e2203a69bac6389e09e93c7587fd7825177b3c06

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