Full Code of twelvedata/twelvedata-python for AI

master 717b47a53578 cached
38 files
711.3 KB
163.6k tokens
803 symbols
1 requests
Download .txt
Showing preview only (735K chars total). Download the full file or copy to clipboard to get everything.
Repository: twelvedata/twelvedata-python
Branch: master
Commit: 717b47a53578
Files: 38
Total size: 711.3 KB

Directory structure:
gitextract_6rx84ncj/

├── .coveragerc
├── .github/
│   ├── CONTRIBUTING.md
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   ├── feature_request.md
│   │   └── question.md
│   └── dependabot.yml
├── .gitignore
├── .travis.yml
├── AUTHORS.rst
├── CHANGELOG.rst
├── CODE_OF_CONDUCT.md
├── LICENSE.txt
├── Pipfile
├── README.md
├── docs/
│   ├── Makefile
│   ├── _static/
│   │   └── .gitignore
│   ├── authors.rst
│   ├── changelog.rst
│   ├── conf.py
│   ├── index.rst
│   └── license.rst
├── pyproject.toml
├── requirements.txt
├── setup.cfg
├── setup.py
├── src/
│   └── twelvedata/
│       ├── __init__.py
│       ├── client.py
│       ├── context.py
│       ├── endpoints.py
│       ├── exceptions.py
│       ├── http_client.py
│       ├── mixins.py
│       ├── renders.py
│       ├── time_series.py
│       ├── utils.py
│       └── websocket.py
└── tests/
    ├── conftest.py
    └── test_client.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .coveragerc
================================================
# .coveragerc to control coverage.py
[run]
branch = True
source = tdclient
# omit = bad_file.py

[paths]
source =
    src/
    */site-packages/

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
    # Have to re-enable the standard pragma
    pragma: no cover

    # Don't complain about missing debug-only code:
    def __repr__
    if self\.debug

    # Don't complain if tests don't hit defensive assertion code:
    raise AssertionError
    raise NotImplementedError

    # Don't complain if non-runnable code isn't run:
    if 0:
    if __name__ == .__main__.:


================================================
FILE: .github/CONTRIBUTING.md
================================================
# Contributing

This document describes how you can contribute to Twelve Data API. Please read it carefully.

**Table of Contents**

* [What contributions are accepted](#what-contributions-are-accepted)
* [Pull upstream changes into your fork regularly](#pull-upstream-changes-into-your-fork-regularly)
* [How to get your pull request accepted](#how-to-get-your-pull-request-accepted)
  * [Keep your pull requests limited to a single issue](#keep-your-pull-requests-limited-to-a-single-issue)
    * [Squash your commits to a single commit](#squash-your-commits-to-a-single-commit)
  * [Don't mix code changes with whitespace cleanup](#dont-mix-code-changes-with-whitespace-cleanup)
  * [Keep your code simple!](#keep-your-code-simple)
  * [Test your changes!](#test-your-changes)
  * [Write a good commit message](#write-a-good-commit-message)

## What contributions are accepted

We highly appreciate your contributions in the matter of fixing bugs, optimizing and new feature implementations for the Twelve Data API source code and its documentation. In case of fixing the existing user experience please push to your fork and [submit a pull request][pr].

Wait for us. We try to review your pull requests as fast as possible.
If we find issues with your pull request, we may suggest some changes and improvements.

## Pull upstream changes into your fork regularly

Twelve Data API is advancing quickly. It is therefore critical that you pull upstream changes into your fork on a regular basis. Nothing is worse than putting in a days of hard work into a pull request only to have it rejected because it has diverged too far from upstream.

To pull in upstream changes:

    git remote add upstream https://github.com/twelvedata/twelvedata-python.git
    git fetch upstream master

Check the log to be sure that you actually want the changes, before merging:

    git log upstream/master

Then rebase your changes on the latest commits in the `master` branch:

    git rebase upstream/master

After that, you have to force push your commits:

    git push --force

For more info, see [GitHub Help][help_fork_repo].

## How to get your pull request accepted

We want to improve Twelve Data API with your contributions. But we also want to provide a stable experience for our users and the community. Follow these rules and you should succeed without a problem!

### Keep your pull requests limited to a single issue

Pull requests should be as small/atomic as possible. Some examples:

* If you are making spelling corrections in the docs, don't modify other files.
* If you are adding new functions don't '*cleanup*' unrelated functions. That cleanup belongs in another pull request.

#### Squash your commits to a single commit

To keep the history of the project clean, you should make one commit per pull request.
If you already have multiple commits, you can add the commits together (squash them) with the following commands in Git Bash:

1. Open `Git Bash` (or `Git Shell`)
2. Enter following command to squash the recent {N} commits: `git reset --soft HEAD~{N} && git commit` (replace `{N}` with the number of commits you want to squash)
3. Press <kbd>i</kbd> to get into Insert-mode
4. Enter the commit message of the new commit
5. After adding the message, press <kbd>ESC</kbd> to get out of the Insert-mode
6. Write `:wq` and press <kbd>Enter</kbd> to save the new message or write `:q!` to discard your changes
7. Enter `git push --force` to push the new commit to the remote repository

For example, if you want to squash the last 5 commits, use `git reset --soft HEAD~5 && git commit`

### Don't mix code changes with whitespace cleanup

If you change two lines of code and correct 200 lines of whitespace issues in a file the diff on that pull request is functionally unreadable and will be **rejected**. Whitespace cleanups need to be in their own pull request.

### Keep your code simple!

Please keep your code as clean and straightforward as possible.
Furthermore, the pixel shortage is over. We want to see:

* `opacity` instead of `o`
* `placeholder` instead of `ph`
* `myFunctionThatDoesThings()` instead of `mftdt()`

### Test your changes!

Before you submit a pull request, please test your changes. Verify that Twelve Data API still works and your changes don't cause other issue or crashes.

### Write a good commit message

* Explain why you make the changes. [More infos about a good commit message.][commit_message]

* If you fix an issue with your commit, please close the issue by [adding one of the keywords and the issue number][closing-issues-via-commit-messages] to your commit message.

  For example: `Fix #545`

[//]: # (LINKS)
[help_fork_repo]: https://help.github.com/articles/fork-a-repo/
[commit_message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[pr]: https://github.com/twelvedata/twelvedata-python/compare
[closing-issues-via-commit-messages]: https://help.github.com/articles/closing-issues-via-commit-messages/


================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Report errors or unexpected behavior.
title: "[Bug]"
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
 - OS: [e.g. iOS]
 - Browser [e.g. chrome, safari]
 - Version [e.g. 22]

**Smartphone (please complete the following information):**
 - Device: [e.g. iPhone6]
 - OS: [e.g. iOS8.1]
 - Browser [e.g. stock browser, safari]
 - Version [e.g. 22]

**Additional context**
Add any other context about the problem here.


================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea.
title: "[Feature Request]"
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.


================================================
FILE: .github/ISSUE_TEMPLATE/question.md
================================================
---
name: Question
about: Ask a question.
title: "[Question]"
labels: ''
assignees: ''

---




================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
- package-ecosystem: pip
  directory: "/"
  schedule:
    interval: daily
  open-pull-requests-limit: 10
  ignore:
  - dependency-name: bleach
    versions:
    - 3.3.0


================================================
FILE: .gitignore
================================================
# Temporary and binary files
*~
*.py[cod]
*.so
*.cfg
!.isort.cfg
!setup.cfg
*.orig
*.log
*.pot
__pycache__/*
.cache/*
.*.swp
*/.ipynb_checkpoints/*

# Project files
.ropeproject
.project
.pydevproject
.settings
.idea
.vscode
tags
src/twelvedata/_version.py

# Package files
*.egg
*.eggs/
.installed.cfg
*.egg-info

# Unittest and coverage
htmlcov/*
.coverage
.tox
junit.xml
coverage.xml
.pytest_cache/
self_test/

# Build and docs folder/files
build/*
dist/*
sdist/*
docs/api/*
docs/_rst/*
docs/_build/*
cover/*
MANIFEST

# Per-project virtualenvs
.venv*/


================================================
FILE: .travis.yml
================================================
dist: xenial
language: python
cache: pip
python:
  - "3.6"
  - "3.7"
install:
  - pip install pipenv
  - pipenv install
  - pip install pytest-cov
script:
  - pytest


================================================
FILE: AUTHORS.rst
================================================
============
Contributors
============


================================================
FILE: CHANGELOG.rst
================================================
=========
Changelog
=========

Version 0.1
===========

- Initial commit


================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
 advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
 address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
 professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at info@twelvedata.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq


================================================
FILE: LICENSE.txt
================================================
The MIT License (MIT)

Copyright (c) 2019 twelvedata

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: Pipfile
================================================
[packages]
twelvedata = {path = "./",extras = ["pandas", "matplotlib", "plotly", "websocket-client", "mplfinance"],editable = true}

[dev-packages]
jupyter = "*"
twine = "*"

[pipenv]
allow_prereleases = true


================================================
FILE: README.md
================================================
<p align="center"><img src="https://res.cloudinary.com/dnz8pwg9r/image/upload/v1579110518/logo-python_pgvee0.png" width="400"></p>

<p align="center">
<a href="https://travis-ci.org/twelvedata/twelvedata-python"><img src="https://travis-ci.org/twelvedata/twelvedata-python.svg?branch=master" alt="Build Status"></a>
<a href="https://github.com/twelvedata/twelvedata-python/issues"><img src="https://img.shields.io/github/issues/twelvedata/twelvedata-python" alt="Open Issues"></a>
<a href="https://github.com/twelvedata/twelvedata-python/releases"><img src="https://badge.fury.io/py/twelvedata.svg" alt="Latest Stable Version"></a>
<a href="https://github.com/twelvedata/twelvedata-python/blob/master/LICENSE.txt"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License"></a>
</p>

# Twelve Data Python Client for financial API & WebSocket

Official python library for [Twelve Data](https://twelvedata.com). This package supports all main features of the service:

* Get stock, forex, cryptocurrency, ETF, and index OHLC time series.
* Companies' profiles, financials, and much more fundamentals data.
* Get over 100+ technical indicators.
* Output data as: `json`, `csv`, `pandas`
* Full support for static and dynamic charts.
* Real-time WebSocket data stream.

**API key** is required. If you don't have it yet, get it by signing up [here](https://twelvedata.com/pricing).

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install Twelve Data API library (without optional dependencies):

```bash
pip install twelvedata
```

Or install with pandas support:

```bash
pip install twelvedata[pandas]
```

Or install with pandas, matplotlib, plotly, and websocket support:

```
pip install twelvedata[pandas,matplotlib,plotly,websocket-client]
```

## Usage

* [Core data](#Time-series)
* [Fundamentals](#Fundamentals)
* [Technical indicators](#Technical-indicators)
* [Batch requests](#Batch-requests)
* [Charts](#Charts)
* [WebSocket](#Websocket)
* [Advanced](#Advanced)

##### Supported parameters

| Parameter  | Description                                                  | Type   | Required |
| ---------- | :----------------------------------------------------------- | ------ | -------- |
| symbol     | stock ticker (e.g. AAPL, MSFT); <br />physical currency pair (e.g. EUR/USD, CNY/JPY);<br />digital currency pair (BTC/USD, XRP/ETH) | string | yes      |
| interval   | time frame: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 8h, 1day, 1week, 1month | string | yes      |
| apikey     | your personal API Key, if you don't have one - get it [here](https://twelvedata.com/pricing) | string | yes      |
| exchange   | if symbol is traded in multiple exchanges specify the desired one, valid for both stocks and cryptocurrencies | string | no       |
| mic_code   | Market Identifier Code (MIC) under ISO 10383 standard, valid for stocks | string | no       |
| country    | if symbol is traded in multiple countries specify the desired one, valid for stocks | string | no       |
| outputsize | number of data points to retrieve                            | int    | no       |
| timezone   | timezone at which output datetime will be displayed, supports: `UTC`, `Exchange` or according to IANA Time Zone Database | string | no       |
| start_date | start date and time of sampling period, accepts `yyyy-MM-dd` or `yyyy-MM-dd hh:mm:ss` format | string | no       |
| end_date   | end date and time of sampling period, accepts `yyyy-MM-dd` or `yyyy-MM-dd hh:mm:ss` format | string | no       |
| order      | sorting order of the time series output, supports `desc` or `asc`  | string | no       |
| date       | Could be the exact date, e.g. `2021-10-27`, or in human language `today` or `yesterday` | string | no       |

The basis for all methods is the `TDClient` object that takes the required `apikey` parameter.

### Time series

* `TDClient.time_series()` accepts all common parameters. Time series may be converted to several formats:
  * `ts.as_json()` - will return JSON array
  * `ts.as_csv()` - will return CSV with header
  * `ts.as_pandas()` - will return pandas.DataFrame
  * `ts.as_url()` - will return list of URLs used

```python
from twelvedata import TDClient

# Initialize client - apikey parameter is requiered
td = TDClient(apikey="YOUR_API_KEY_HERE")

# Construct the necessary time series
ts = td.time_series(
    symbol="AAPL",
    interval="1min",
    outputsize=10,
    timezone="America/New_York",
)

# Returns pandas.DataFrame
ts.as_pandas()
```

Other core data endpoints:
* Exchange rate - `TDClient.exchange_rate(symbol)`
* Currency conversion - `TDClient.currency_conversion(symbol, amount)`
* Quote - `TDClient.quote()` takes parameters as `.time_series()`
* Real-time price - `TDClient.price()` takes parameters as `.time_series()`
* End of day price - `TDClient.eod()` takes parameters as `.time_series()`

### Fundamentals

All fundamentals are supported across global markets. Refer to API documentation [here](https://twelvedata.com/docs#fundamentals) and find out which countries support which fundamentals by visiting [this](https://support.twelvedata.com/en/articles/5621131-fundamentals-coverage) page.

* `.get_logo(symbol, exchange, country, type)`
* `.get_profile(symbol, exchange, country, type)`
* `.get_dividends(symbol, exchange, country, type)`
* `.get_splits(symbol, exchange, country, type)`
* `.get_earnings(symbol, exchange, country, type, period, outputsize, start_date, end_date)`
* `.get_earnings_calendar(symbol, exchange, country, period, start_date, end_date)`
* `.get_ipo_calendar(symbol, exchange, country, start_date, end_date)`
* `.get_statistics(symbol, exchange, country, type)`
* `.get_insider_transactions(symbol, exchange, country, type)`
* `.get_income_statement(symbol, exchange, country, type, period, start_date, end_date)`
* `.get_balance_sheet(symbol, exchange, country, type, period, start_date, end_date)`
* `.get_cash_flow(symbol, exchange, country, type, period, start_date, end_date)`
* `.get_key_executives(symbol, exchange, country, type)`
* `.get_institutional_holders(symbol, exchange, country, type)`
* `.get_fund_holders(symbol, exchange, country, type)`

Only JSON format is supported accessible via `.as_json()`

```python
from twelvedata import TDClient

td = TDClient(apikey="YOUR_API_KEY_HERE")

# Get last dividends for AAPL
dividends = td.get_dividends(
    symbol="AAPL",
).as_json()
```

### Technical indicators

This Python library supports all indicators implemented by Twelve Data. Full list of 100+ technical indicators   may be found in [API documentation](https://twelvedata.com/docs).

* Technical indicators are part of `TDClient.time_series()` object.
* It shares the universal format `TDClient.time_series().with_{Technical Indicator Name}`, e.g. `.with_bbands()`, `.with_percent_b()`, `.with_macd()`
* Indicator object accepts all parameters according to its specification in [API documentation](https://twelvedata.com/docs), e.g. `.with_bbands()` accepts: `series_type`, `time_period`, `sd`, `ma_type`. If parameter is not provided it will be set to default value.
* Indicators may be used in arbitrary order and conjugated, e.g. `TDClient.time_series().with_aroon().with_adx().with_ema()`
* By default, technical indicator will output with OHLC values. If you do not need OHLC, specify `TDClient.time_series().without_ohlc()`

```python
from twelvedata import TDClient

td = TDClient(apikey="YOUR_API_KEY_HERE")
ts = td.time_series(
    symbol="ETH/BTC",
    exchange="Huobi",
    interval="5min",
    outputsize=22,
    timezone="America/New_York",
)

# Returns: OHLC, BBANDS(close, 20, 2, EMA), PLUS_DI(9), WMA(20), WMA(40)
ts.with_bbands(ma_type="EMA").with_plus_di().with_wma(time_period=20).with_wma(time_period=40).as_pandas()

# Returns: STOCH(14, 1, 3, SMA, SMA), TSF(close, 9)
ts.without_ohlc().with_stoch().with_tsf().as_json()
```

### Batch requests

With batch requests up to 120 symbols might be returned per single API call. There are two options on how to do this:

```python
# 1. Pass instruments symbols as a string delimited by comma (,)
ts = td.time_series(
    symbol="V, RY, AUD/CAD, BTC/USD:Huobi"
)

# 2. Pass as a list of symbols 
ts = td.time_series(
    symbol=["V", "RY", "AUD/CAD", "BTC/USD:Huobi"]
)
```

**Important.** Batch requests are only supported with `.as_json()` and `.as_pandas()` formats.

With `.as_json()` the output will be a dictionary with passed symbols as keys. The value will be a tuple with quotes, just the same as with a single request.
```python
ts = td.time_series(symbol='AAPL,MSFT', interval="1min", outputsize=3)
df = ts.with_macd().with_macd(fast_period=10).with_stoch().as_json()

{
    "AAPL": ({'datetime': '2020-04-23 15:59:00', 'open': '275.23001', 'high': '275.25000', 'low': '274.92999', 'close': '275.01001', 'volume': '393317', 'macd_1': '-0.33538', 'macd_signal_1': '-0.24294', 'macd_hist_1': '-0.09244', 'macd_2': '-0.40894', 'macd_signal_2': '-0.29719', 'macd_hist_2': '-0.11175', 'slow_k': '4.52069', 'slow_d': '7.92871'}, {'datetime': '2020-04-23 15:58:00', 'open': '275.07001', 'high': '275.26999', 'low': '275.00000', 'close': '275.25000', 'volume': '177685', 'macd_1': '-0.31486', 'macd_signal_1': '-0.21983', 'macd_hist_1': '-0.09503', 'macd_2': '-0.38598', 'macd_signal_2': '-0.26925', 'macd_hist_2': '-0.11672', 'slow_k': '14.70578', 'slow_d': '6.82079'}, {'datetime': '2020-04-23 15:57:00', 'open': '275.07001', 'high': '275.16000', 'low': '275.00000', 'close': '275.07751', 'volume': '151169', 'macd_1': '-0.30852', 'macd_signal_1': '-0.19607', 'macd_hist_1': '-0.11245', 'macd_2': '-0.38293', 'macd_signal_2': '-0.24007', 'macd_hist_2': '-0.14286', 'slow_k': '4.55965', 'slow_d': '2.75237'}),
    "MSFT": ({'datetime': '2020-04-23 15:59:00', 'open': '171.59000', 'high': '171.64000', 'low': '171.22000', 'close': '171.42000', 'volume': '477631', 'macd_1': '-0.12756', 'macd_signal_1': '-0.10878', 'macd_hist_1': '-0.01878', 'macd_2': '-0.15109', 'macd_signal_2': '-0.12915', 'macd_hist_2': '-0.02193', 'slow_k': '20.95244', 'slow_d': '26.34919'}, {'datetime': '2020-04-23 15:58:00', 'open': '171.41000', 'high': '171.61000', 'low': '171.33501', 'close': '171.61000', 'volume': '209594', 'macd_1': '-0.12440', 'macd_signal_1': '-0.10408', 'macd_hist_1': '-0.02032', 'macd_2': '-0.14786', 'macd_signal_2': '-0.12367', 'macd_hist_2': '-0.02419', 'slow_k': '39.04785', 'slow_d': '23.80945'}, {'datetime': '2020-04-23 15:57:00', 'open': '171.34500', 'high': '171.48000', 'low': '171.25999', 'close': '171.39999', 'volume': '142450', 'macd_1': '-0.13791', 'macd_signal_1': '-0.09900', 'macd_hist_1': '-0.03891', 'macd_2': '-0.16800', 'macd_signal_2': '-0.11762', 'macd_hist_2': '-0.05037', 'slow_k': '19.04727', 'slow_d': '14.92063'})
}

```

With `.as_pandas()` the output will be a 3D DataFrame with MultiIndex for (symbol, datetime).
```python
ts = td.time_series(symbol='AAPL,MSFT', interval="1min", outputsize=3)
df = ts.with_macd().with_macd(fast_period=10).with_stoch().as_pandas()

#                                open       high  ...    slow_k    slow_d
# AAPL 2020-04-23 15:59:00  275.23001  275.25000  ...   4.52069   7.92871
#      2020-04-23 15:58:00  275.07001  275.26999  ...  14.70578   6.82079
#      2020-04-23 15:57:00  275.07001  275.16000  ...   4.55965   2.75237
# MSFT 2020-04-23 15:59:00  171.59000  171.64000  ...  20.95244  26.34919
#      2020-04-23 15:58:00  171.41000  171.61000  ...  39.04785  23.80945
#      2020-04-23 15:57:00  171.34500  171.48000  ...  19.04727  14.92063
# 
# [6 rows x 13 columns]

df.loc['AAPL']

#                           open       high  ...    slow_k   slow_d
# 2020-04-23 15:59:00  275.23001  275.25000  ...   4.52069  7.92871
# 2020-04-23 15:58:00  275.07001  275.26999  ...  14.70578  6.82079
# 2020-04-23 15:57:00  275.07001  275.16000  ...   4.55965  2.75237
# 
# [3 rows x 13 columns]

df.columns

# Index(['open', 'high', 'low', 'close', 'volume', 'macd1', 'macd_signal1',
#        'macd_hist1', 'macd2', 'macd_signal2', 'macd_hist2', 'slow_k',
#        'slow_d'],
#       dtype='object')
```


### Charts

* [Static](#Static)
* [Interactive](#Interactive)

Charts support OHLC, technical indicators and custom bars.

#### Static

Static charts are based on `matplotlib` library and require `mplfinance` package to be installed.

![static chart example](https://res.cloudinary.com/dnz8pwg9r/image/upload/v1601394338/matplotlib_chart.png)

* Use `.as_pyplot_figure()`

```python
from twelvedata import TDClient

td = TDClient(apikey="YOUR_API_KEY_HERE")
ts = td.time_series(
    symbol="MSFT",
    outputsize=75,
    interval="1day",
)

# 1. Returns OHLCV chart
ts.as_pyplot_figure()

# 2. Returns OHLCV + BBANDS(close, 20, 2, SMA) + %B(close, 20, 2 SMA) + STOCH(14, 3, 3, SMA, SMA)
ts.with_bbands().with_percent_b().with_stoch(slow_k_period=3).as_pyplot_figure()
```

#### Interactive

Interactive charts are built on top of `plotly` library.

![interactive chart example](https://res.cloudinary.com/dnz8pwg9r/image/upload/v1599349681/plotly-chart.gif)

* Use `.as_plotly_figure().show()`

```python
from twelvedata import TDClient

td = TDClient(apikey="YOUR_API_KEY_HERE")
ts = td.time_series(
    symbol="DNR",
    outputsize=50,
    interval="1week",
)

# 1. Returns OHLCV chart
ts.as_plotly_figure()

# 2. Returns OHLCV + EMA(close, 7) + MAMA(close, 0.5, 0.05) + MOM(close, 9) + MACD(close, 12, 26, 9)
ts.with_ema(time_period=7).with_mama().with_mom().with_macd().as_plotly_figure().show()
```

### WebSocket

With the WebSocket, a duplex communication channel with the server is established.

Make sure to have `websocket_client` package [installed](https://pypi.org/project/websocket_client/).

![websocket example](https://res.cloudinary.com/dnz8pwg9r/image/upload/v1599349899/ws-example.gif)

#### Features
* Real-time low latency stream of financial quotes.
* You might subscribe to stocks, forex, and crypto.

#### Example
```python
import time
from twelvedata import TDClient


messages_history = []


def on_event(e):
    # do whatever is needed with data
    print(e)
    messages_history.append(e)


td = TDClient(apikey="YOUR_API_KEY_HERE")
ws = td.websocket(symbols="BTC/USD", on_event=on_event)
ws.subscribe(['ETH/BTC', 'AAPL'])
ws.connect()
while True:
    print('messages received: ', len(messages_history))
    ws.heartbeat()
    time.sleep(10)
```

Parameters accepted by the `.websocket()` object:
* **symbols** list of symbols to subscribe
* **on_event** function that invokes when event from server is received
* **logger** instance of logger, otherwise set to default
* **max_queue_size** maximum size of queue, default `12000`
* **log_level** accepts `debug` or `info`, otherwise not set

Applicable methods on `.websocket()` object:
* `ws.subscribe([list of symbols])`: get data from the symbols passed
* `ws.unsubscribe([list of symbols])`: stop receiving data from the symbols passed
* `ws.reset()`: unsubscribe from all symbols
* `ws.connect()`: establish connection with WebSocket server
* `ws.disconnect()`: close connection with WebSocket server
* `ws.heartbeat()`: send heartbeat to server

**Important**. Do not forget that WebSockets are only available for Twelve Data users on the [Pro plan](https://twelvedata.com/pricing) and above. Checkout the trial [here](https://support.twelvedata.com/en/articles/5335783-trial).

### Advanced

#### Custom endpoint
This method is used to request unrepresented endpoints on this package, but which are available at Twelve Data.

```python
endpoint = td.custom_endpoint(
    name="quote",
    symbol="AAPL",
)
endpoint.as_json()
```

The only required parameter is `name` which should be identical to the endpoint used at Twelve Data. All others can be custom and will vary according to the method.

#### Debugging
When the method doesn't return the desired data or throws an error, it might be helpful to understand and analyze the API query behind it.
Add `.as_url()` to any method or chain of methods, and it will return the list of used URLs.

```python
ts = td.time_series(
    symbol="AAPL",
    interval="1min",
    outputsize=10,
    timezone="America/New_York",
).with_bbands().with_ema()

ts.as_url()
# ['https://api.twelvedata.com/time_series?symbol=AAPL&interval=1min&outputsize=10&dp=5&timezone=America/New_York&order=desc&prepost=false&format=JSON&apikey=demo', 
# 'https://api.twelvedata.com/bbands?symbol=AAPL&interval=1min&series_type=close&time_period=20&sd=2&ma_type=SMA&outputsize=10&dp=5&timezone=America/New_York&order=desc&prepost=false&format=JSON&apikey=demo', 
# 'https://api.twelvedata.com/ema?symbol=AAPL&interval=1min&series_type=close&time_period=9&outputsize=10&dp=5&timezone=America/New_York&order=desc&prepost=false&format=JSON&apikey=demo']

```

#### API usage
This method gives an overview of the current API credits consumption.

```python
api = td.api_usage()
```

## Support

Visit our official website [contact page](https://twelvedata.com/contact) or [support center](https://support.twelvedata.com/).

## Announcements

Follow us for announcements and updates about this library.
* [Twitter](https://twitter.com/TwelveData)
* [Telegram](https://t.me/twelvedata)

## Roadmap

- [x] Fundamentals 
- [x] WebSocket
- [x] Batch requests
- [x] Custom plots coloring
- [x] Interactive charts (plotly)
- [x] Static charts (matplotlib)
- [x] Pandas support

## Contributing

1. Clone repo and create a new branch: `$ git checkout https://github.com/twelvedata/twelvedata -b name_for_new_branch`.
2. Make changes and test.
3. Submit Pull Request with comprehensive description of changes.

## License

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).


================================================
FILE: docs/Makefile
================================================
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS    =
SPHINXBUILD   = sphinx-build
PAPER         =
BUILDDIR      = _build
AUTODOCDIR    = api
AUTODOCBUILD  = sphinx-apidoc
PROJECT       = twelvedata
MODULEDIR     = ../src/twelvedata

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif

# Internal variables.
PAPEROPT_a4     = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext doc-requirements

help:
	@echo "Please use \`make <target>' where <target> is one of"
	@echo "  html       to make standalone HTML files"
	@echo "  dirhtml    to make HTML files named index.html in directories"
	@echo "  singlehtml to make a single large HTML file"
	@echo "  pickle     to make pickle files"
	@echo "  json       to make JSON files"
	@echo "  htmlhelp   to make HTML files and a HTML help project"
	@echo "  qthelp     to make HTML files and a qthelp project"
	@echo "  devhelp    to make HTML files and a Devhelp project"
	@echo "  epub       to make an epub"
	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
	@echo "  latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
	@echo "  text       to make text files"
	@echo "  man        to make manual pages"
	@echo "  texinfo    to make Texinfo files"
	@echo "  info       to make Texinfo files and run them through makeinfo"
	@echo "  gettext    to make PO message catalogs"
	@echo "  changes    to make an overview of all changed/added/deprecated items"
	@echo "  xml        to make Docutils-native XML files"
	@echo "  pseudoxml  to make pseudoxml-XML files for display purposes"
	@echo "  linkcheck  to check all external links for integrity"
	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"

clean:
	rm -rf $(BUILDDIR)/* $(AUTODOCDIR)

$(AUTODOCDIR): $(MODULEDIR)
	mkdir -p $@
	$(AUTODOCBUILD) -f -o $@ $^

doc-requirements: $(AUTODOCDIR)

html: doc-requirements
	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
	@echo
	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml: doc-requirements
	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
	@echo
	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml: doc-requirements
	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
	@echo
	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle: doc-requirements
	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
	@echo
	@echo "Build finished; now you can process the pickle files."

json: doc-requirements
	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
	@echo
	@echo "Build finished; now you can process the JSON files."

htmlhelp: doc-requirements
	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
	@echo
	@echo "Build finished; now you can run HTML Help Workshop with the" \
	      ".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp: doc-requirements
	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
	@echo
	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/$(PROJECT).qhcp"
	@echo "To view the help file:"
	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/$(PROJECT).qhc"

devhelp: doc-requirements
	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
	@echo
	@echo "Build finished."
	@echo "To view the help file:"
	@echo "# mkdir -p $HOME/.local/share/devhelp/$(PROJECT)"
	@echo "# ln -s $(BUILDDIR)/devhelp $HOME/.local/share/devhelp/$(PROJEC)"
	@echo "# devhelp"

epub: doc-requirements
	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
	@echo
	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

patch-latex:
	find _build/latex -iname "*.tex" | xargs -- \
		sed -i'' 's~includegraphics{~includegraphics\[keepaspectratio,max size={\\textwidth}{\\textheight}\]{~g'

latex: doc-requirements
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	$(MAKE) patch-latex
	@echo
	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
	@echo "Run \`make' in that directory to run these through (pdf)latex" \
	      "(use \`make latexpdf' here to do that automatically)."

latexpdf: doc-requirements
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	$(MAKE) patch-latex
	@echo "Running LaTeX files through pdflatex..."
	$(MAKE) -C $(BUILDDIR)/latex all-pdf
	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

latexpdfja: doc-requirements
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	@echo "Running LaTeX files through platex and dvipdfmx..."
	$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text: doc-requirements
	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
	@echo
	@echo "Build finished. The text files are in $(BUILDDIR)/text."

man: doc-requirements
	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
	@echo
	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

texinfo: doc-requirements
	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
	@echo
	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
	@echo "Run \`make' in that directory to run these through makeinfo" \
	      "(use \`make info' here to do that automatically)."

info: doc-requirements
	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
	@echo "Running Texinfo files through makeinfo..."
	make -C $(BUILDDIR)/texinfo info
	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."

gettext: doc-requirements
	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
	@echo
	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."

changes: doc-requirements
	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
	@echo
	@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck: doc-requirements
	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
	@echo
	@echo "Link check complete; look for any errors in the above output " \
	      "or in $(BUILDDIR)/linkcheck/output.txt."

doctest: doc-requirements
	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
	@echo "Testing of doctests in the sources finished, look at the " \
	      "results in $(BUILDDIR)/doctest/output.txt."

xml: doc-requirements
	$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
	@echo
	@echo "Build finished. The XML files are in $(BUILDDIR)/xml."

pseudoxml: doc-requirements
	$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
	@echo
	@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."


================================================
FILE: docs/_static/.gitignore
================================================
# Empty directory


================================================
FILE: docs/authors.rst
================================================
.. _authors:
.. include:: ../AUTHORS.rst


================================================
FILE: docs/changelog.rst
================================================
.. _changes:
.. include:: ../CHANGELOG.rst


================================================
FILE: docs/conf.py
================================================
# -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

import os
import sys
import inspect
import shutil

__location__ = os.path.join(os.getcwd(), os.path.dirname(
    inspect.getfile(inspect.currentframe())))

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.join(__location__, '../src'))

# -- Run sphinx-apidoc ------------------------------------------------------
# This hack is necessary since RTD does not issue `sphinx-apidoc` before running
# `sphinx-build -b html . _build/html`. See Issue:
# https://github.com/rtfd/readthedocs.org/issues/1139
# DON'T FORGET: Check the box "Install your project inside a virtualenv using
# setup.py install" in the RTD Advanced Settings.
# Additionally it helps us to avoid running apidoc manually

try:  # for Sphinx >= 1.7
    from sphinx.ext import apidoc
except ImportError:
    from sphinx import apidoc

output_dir = os.path.join(__location__, "api")
module_dir = os.path.join(__location__, "../src/twelvedata")
try:
    shutil.rmtree(output_dir)
except FileNotFoundError:
    pass

try:
    import sphinx
    from pkg_resources import parse_version

    cmd_line_template = "sphinx-apidoc -f -o {outputdir} {moduledir}"
    cmd_line = cmd_line_template.format(outputdir=output_dir, moduledir=module_dir)

    args = cmd_line.split(" ")
    if parse_version(sphinx.__version__) >= parse_version('1.7'):
        args = args[1:]

    apidoc.main(args)
except Exception as e:
    print("Running `sphinx-apidoc` failed!\n{}".format(e))

# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo',
              'sphinx.ext.autosummary', 'sphinx.ext.viewcode', 'sphinx.ext.coverage',
              'sphinx.ext.doctest', 'sphinx.ext.ifconfig', 'sphinx.ext.mathjax',
              'sphinx.ext.napoleon']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix of source filenames.
source_suffix = '.rst'

# The encoding of source files.
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'twelvedata'
copyright = u'2019, twelvedata'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = ''  # Is set by calling `setup.py docs`
# The full version, including alpha/beta/rc tags.
release = ''  # Is set by calling `setup.py docs`

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']

# The reST default role (used for this markup: `text`) to use for all documents.
# default_role = None

# If true, '()' will be appended to :func: etc. cross-reference text.
# add_function_parentheses = True

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
# add_module_names = True

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
# show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []

# If true, keep warnings as "system message" paragraphs in the built documents.
# keep_warnings = False


# -- Options for HTML output ---------------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
html_theme = 'alabaster'

# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
html_theme_options = {
    'sidebar_width': '300px',
    'page_width': '1200px'
}

# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []

# The name for this set of Sphinx documents.  If None, it defaults to
# "<project> v<release> documentation".
try:
    from twelvedata import __version__ as version
except ImportError:
    pass
else:
    release = version

# A shorter title for the navigation bar.  Default is the same as html_title.
# html_short_title = None

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
# html_logo = ""

# The name of an image file (within the static path) to use as favicon of the
# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
# html_favicon = None

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
# html_last_updated_fmt = '%b %d, %Y'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
# html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
# html_sidebars = {}

# Additional templates that should be rendered to pages, maps page names to
# template names.
# html_additional_pages = {}

# If false, no module index is generated.
# html_domain_indices = True

# If false, no index is generated.
# html_use_index = True

# If true, the index is split into individual pages for each letter.
# html_split_index = False

# If true, links to the reST sources are added to the pages.
# html_show_sourcelink = True

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
# html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
# html_show_copyright = True

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it.  The value of this option must be the
# base URL from which the finished HTML is served.
# html_use_opensearch = ''

# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'twelvedata-doc'


# -- Options for LaTeX output --------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
# 'preamble': '',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
  ('index', 'user_guide.tex', u'twelvedata Documentation',
   u'gtors', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
# latex_logo = ""

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
# latex_use_parts = False

# If true, show page references after internal links.
# latex_show_pagerefs = False

# If true, show URL addresses after external links.
# latex_show_urls = False

# Documents to append as an appendix to all manuals.
# latex_appendices = []

# If false, no module index is generated.
# latex_domain_indices = True

# -- External mapping ------------------------------------------------------------
python_version = '.'.join(map(str, sys.version_info[0:2]))
intersphinx_mapping = {
    'sphinx': ('http://www.sphinx-doc.org/en/stable', None),
    'python': ('https://docs.python.org/' + python_version, None),
    'matplotlib': ('https://matplotlib.org', None),
    'numpy': ('https://docs.scipy.org/doc/numpy', None),
    'sklearn': ('http://scikit-learn.org/stable', None),
    'pandas': ('http://pandas.pydata.org/pandas-docs/stable', None),
    'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
}


================================================
FILE: docs/index.rst
================================================
.. include:: ../README.rst


Contents
========

.. toctree::
   :maxdepth: 2

   License <license>
   Authors <authors>
   Changelog <changelog>
   Module Reference <api/modules>


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


================================================
FILE: docs/license.rst
================================================
.. _license:

=======
License
=======

.. include:: ../LICENSE.txt


================================================
FILE: pyproject.toml
================================================
[build-system]
requires = ["setuptools>=45,<75", "wheel", "setuptools-scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "src/twelvedata/_version.py"


================================================
FILE: requirements.txt
================================================
pytimeparse
requests
setuptools

================================================
FILE: setup.cfg
================================================
# This file is used to configure your project.
# Read more about the various options under:
# http://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files

[metadata]
name = twelvedata
description = Python client for Twelve Data
author = Twelve Data
author_email = info@twelvedata.com
license = MIT
url = https://github.com/twelvedata/twelvedata-python
long_description = file: README.md
long_description_content_type = text/markdown

platforms = any
classifiers =
    Development Status :: 4 - Beta
    Programming Language :: Python

[options]
zip_safe = False
packages = find:
include_package_data = True
package_dir =
    =src
install_requires =
    pytimeparse>=1.1,<2
    requests>=2.22,<3
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*

[options.packages.find]
where = src
exclude =
    tests

[options.extras_require]
pandas =
    pandas>=0.24,<0.25;python_version<"3"
    pandas>=0.24;python_version>="3"
matplotlib =
    matplotlib>=2.2,<3;python_version<"3"
    matplotlib>=2.2;python_version>="3"
plotly =
    plotly>=4.2.1
websocket =
    websocket-client>=1.2.1
mplfinance =
    mplfinance>=0.12


testing =
    pytest
    pytest-cov

[options.entry_points]
# Add here console scripts like:
# console_scripts =
#     script_name = twelvedata.module:function
# For example:
# console_scripts =
#     fibonacci = twelvedata.skeleton:run
# And any other entry points, for example:
# pyscaffold.cli =
#     awesome = pyscaffoldext.awesome.extension:AwesomeExtension

[test]
# py.test options when running `python setup.py test`
# addopts = --verbose
extras = True

[tool:pytest]
# Options for py.test:
# Specify command line options as you would do when invoking py.test directly.
# e.g. --cov-report html (or xml) for html/xml output or --junitxml junit.xml
# in order to write a coverage file that can be read by Jenkins.
addopts =
    --cov twelvedata --cov-report term-missing
    --verbose
norecursedirs =
    dist
    build
    .tox
testpaths = tests

[aliases]
build = bdist_wheel
release = build upload

[bdist_wheel]

[build_sphinx]
source_dir = docs
build_dir = docs/_build

[devpi:upload]
# Options for the devpi: PyPI server and packaging tool
# VCS export must be deactivated since we are using setuptools-scm
no-vcs = 1
formats = bdist_wheel

[flake8]
# Some sane defaults for the code style checker flake8
exclude =
    .tox
    build
    dist
    .eggs
    docs/conf.py


================================================
FILE: setup.py
================================================
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
    Setup file for twelvedata.
    Use setup.cfg to configure your project.
"""
from setuptools import setup

if __name__ == "__main__":
    setup()


================================================
FILE: src/twelvedata/__init__.py
================================================
# -*- coding: utf-8 -*-
from .client import TDClient

try:
    from ._version import version as __version__
except ImportError:
    try:
        import importlib.metadata
        __version__ = importlib.metadata.version(__name__)
    except Exception:
        __version__ = "unknown"


================================================
FILE: src/twelvedata/client.py
================================================
from .context import Context
from .endpoints import (
    CustomEndpoint,
    StocksListEndpoint,
    StockExchangesListEndpoint,
    ForexPairsListEndpoint,
    ETFListEndpoint,
    IndicesListEndpoint,
    FundsListEndpoint,
    BondsListEndpoint,
    CommoditiesListEndpoint,
    ExchangesListEndpoint,
    CryptocurrenciesListEndpoint,
    CryptocurrencyExchangesListEndpoint,
    TechnicalIndicatorsListEndpoint,
    SymbolSearchEndpoint,
    EarliestTimestampEndpoint,
    ExchangeRateEndpoint,
    CurrencyConversionEndpoint,
    QuoteEndpoint,
    PriceEndpoint,
    EODEndpoint,
    LogoEndpoint,
    ProfileEndpoint,
    DividendsEndpoint,
    DividendsCalendarEndpoint,
    SplitsEndpoint,
    SplitsCalendarEndpoint,
    EarningsEndpoint,
    EarningsCalendarEndpoint,
    IPOCalendarEndpoint,
    StatisticsEndpoint,
    InsiderTransactionsEndpoint,
    IncomeStatementEndpoint,
    BalanceSheetEndpoint,
    CashFlowEndpoint,
    OptionsExpirationEndpoint,
    OptionsChainEndpoint,
    KeyExecutivesEndpoint,
    InstitutionalHoldersEndpoint,
    FundHoldersEndpoint,
    APIUsageEndpoint,
    MarketStateEndpoint,
)
from .http_client import DefaultHttpClient
from .time_series import TimeSeries
from .utils import patch_endpoints_meta
from .websocket import TDWebSocket


class TDClient:
    def __init__(self, apikey, http_client=None, base_url=None, self_heal_time_s=None, **defaults):
        self.ctx = Context()
        self.ctx.apikey = apikey
        self.ctx.self_heal_time_s = self_heal_time_s
        self.ctx.base_url = base_url or "https://api.twelvedata.com"
        self.ctx.http_client = http_client or DefaultHttpClient(self.ctx.base_url)
        self.ctx.defaults = defaults

        patch_endpoints_meta(self.ctx)

    def websocket(self, **defaults):
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return TDWebSocket(ctx)

    def custom_endpoint(self, **defaults):
        """
        Creates request builder for custom endpoint

        This method can request any GET endpoint available at Twelve Data
        with a custom set of parameters

        :returns: request builder instance
        :rtype: CustomEndpointRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return CustomEndpoint(ctx, **ctx.defaults)

    def get_stocks_list(self, **defaults):
        """
        Creates request builder for Stocks List

        This API call return array of symbols available at twelvedata API.
        This list is daily updated.

        :returns: request builder instance
        :rtype: StocksListRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return StocksListEndpoint(ctx, **ctx.defaults)

    def get_stock_exchanges_list(self):
        """
        Creates request builder for Stock Exchanges List

        This API call return array of stock exchanges available at twelvedata
        API. This list is daily updated.

        :returns: request builder instance
        :rtype: StockExchangesListRequestBuilder
        """
        return StockExchangesListEndpoint(ctx=self.ctx)

    def get_forex_pairs_list(self, **defaults):
        """
        Creates request builder for Forex Pairs List

        This API call return array of forex pairs available at twelvedata API.
        This list is daily updated.

        :returns: request builder instance
        :rtype: ForexPairsListRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return ForexPairsListEndpoint(ctx, **ctx.defaults)

    def get_cryptocurrencies_list(self, **defaults):
        """
        Creates request builder for Cryptocurrencies List

        This API call return array of cryptocurrency pairs available at
        twelvedata API. This list is daily updated.

        :returns: request builder instance
        :rtype: CryptocurrenciesListRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return CryptocurrenciesListEndpoint(ctx, **ctx.defaults)

    def get_etf_list(self, **defaults):
        """
        Creates request builder for ETF List

        This API call return array of ETFs available at Twelve Data API. This list is daily updated.

        :returns: request builder instance
        :rtype: ETFListRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return ETFListEndpoint(ctx, **ctx.defaults)

    def get_indices_list(self, **defaults):
        """
        Creates request builder for Indices List

        This API call return array of indices available at Twelve Data API. This list is daily updated.

        :returns: request builder instance
        :rtype: IndicesListRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return IndicesListEndpoint(ctx, **ctx.defaults)

    def get_funds_list(self, **defaults):
        """
        Creates request builder for Funds List

        This API call return array of funds available at Twelve Data API. This list is daily updated.

        :returns: request builder instance
        :rtype: FundsListRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return FundsListEndpoint(ctx, **ctx.defaults)

    def get_bonds_list(self, **defaults):
        """
        Creates request builder for Bonds List

        This API call return array of bonds available at Twelve Data API. This list is daily updated.

        :returns: request builder instance
        :rtype: BondsListRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return BondsListEndpoint(ctx, **ctx.defaults)
    
    def get_commodities_list(self, **defaults):
        """
        Creates request builder for Commodities List

        This API call return array of commodities available at Twelve Data API. This list is daily updated.

        :returns: request builder instance
        :rtype: CommoditiesListRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return CommoditiesListEndpoint(ctx, **ctx.defaults)

    def get_exchanges_list(self, **defaults):
        """
        Creates request builder for Exchanges List

        This API call return array of stock, ETF or index exchanges available at Twelve Data API.
        This list is daily updated.

        :returns: request builder instance
        :rtype: ExchangesListRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return ExchangesListEndpoint(ctx, **ctx.defaults)

    def get_cryptocurrency_exchanges_list(self, **defaults):
        """
        Creates request builder for Cryptocurrency Exchanges List

        This API call return array of cryptocurrency exchanges available at
        twelvedata API. This list is daily updated.

        :returns: request builder instance
        :rtype: CryptocurrencyExchangesListRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return CryptocurrencyExchangesListEndpoint(ctx, **ctx.defaults)

    def get_technical_indicators_list(self):
        """
        Creates request builder for Technical Indicators List

        This API call return array of objects with available technical indicators. This endpoint might be used to build
        an abstract interface to make more convenient API calls from the application.

        :returns: request builder instance
        :rtype: TechnicalIndicatorsListRequestBuilder
        """
        return TechnicalIndicatorsListEndpoint(ctx=self.ctx)

    def symbol_search(self, **defaults):
        """
        Creates request builder for Symbol Search

        This method helps to find the best matching symbol. It can be used as the base for custom lookups.
        The response is returned in descending order, with the most relevant instrument at the beginning.

        :returns: request builder instance
        :rtype: SymbolSearchRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return SymbolSearchEndpoint(ctx, **ctx.defaults)

    def get_earliest_timestamp(self, **defaults):
        """
        Creates request builder for Earliest Timestamp

        This method returns the first available DateTime for a given instrument at the specific interval.

        :returns: request builder instance
        :rtype: EarliestTimestampRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return EarliestTimestampEndpoint(ctx, **ctx.defaults)

    def get_market_state(self, **defaults):
        """
        Creates request builder for Market State

        Check the state of all available exchanges, time to open, and time to close. Returns all available stock exchanges by default.

        :returns: request builder instance
        :rtype: MarketStateRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return MarketStateEndpoint(ctx, **ctx.defaults)

    def time_series(self, **defaults):
        """
        Creates factory for time series requests.

        :returns: request factory instance
        :rtype: TimeSeries
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return TimeSeries(ctx)

    def exchange_rate(self, **defaults):
        """
        Creates factory for exchange rate requests.

        :returns: request factory instance
        :rtype: ExchangeRate
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return ExchangeRateEndpoint(ctx, **ctx.defaults)

    def currency_conversion(self, **defaults):
        """
        Creates factory for exchange rate requests.

        :returns: request factory instance
        :rtype: CurrencyConversion
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return CurrencyConversionEndpoint(ctx, **ctx.defaults)

    def quote(self, **defaults):
        """
        Creates factory for exchange rate requests.

        :returns: request factory instance
        :rtype: Quote
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return QuoteEndpoint(ctx, **ctx.defaults)

    def price(self, **defaults):
        """
        Creates factory for exchange rate requests.

        :returns: request factory instance
        :rtype: Price
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return PriceEndpoint(ctx, **ctx.defaults)

    def eod(self, **defaults):
        """
        Creates factory for exchange rate requests.

        :returns: request factory instance
        :rtype: EOD
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return EODEndpoint(ctx, **ctx.defaults)

    def get_logo(self, **defaults):
        """
        Creates request builder for Logo

        Returns logo of the company.

        :returns: request builder instance
        :rtype: LogoRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return LogoEndpoint(ctx, **ctx.defaults)

    def get_profile(self, **defaults):
        """
        Creates request builder for Profile

        Returns general information about the company.

        :returns: request builder instance
        :rtype: ProfileRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return ProfileEndpoint(ctx, **ctx.defaults)

    def get_dividends(self, **defaults):
        """
        Creates request builder for Dividends

        Returns the amount of dividends paid out for the last 10+ years.

        :returns: request builder instance
        :rtype: DividendsRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return DividendsEndpoint(ctx, **ctx.defaults)

    def get_dividends_calendar(self, **defaults):
        """
        Creates request builder for Dividends Calendar

        Returns the dividend data as a calendar for a given date range. To call custom period, use start_date and end_date parameters.

        :returns: request builder instance
        :rtype: DividendsCalendarRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return DividendsCalendarEndpoint(ctx, **ctx.defaults)

    def get_splits(self, **defaults):
        """
        Creates request builder for Splits

        Returns the date and the split factor of shares of the company for the last 10+ years.

        :returns: request builder instance
        :rtype: SplitsRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return SplitsEndpoint(ctx, **ctx.defaults)

    def get_splits_calendar(self, **defaults):
        """
        Creates request builder for Splits Calendar

        Returns split data as a calendar for a given date range. To call custom period, use start_date and end_date parameters.

        :returns: request builder instance
        :rtype: SplitsCalendarRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return SplitsCalendarEndpoint(ctx, **ctx.defaults)

    def get_earnings(self, **defaults):
        """
        Creates request builder for Earnings

        This API call returns earnings data for a given company, including EPS estimate and EPS actual.
        Earnings are available for complete company history.

        :returns: request builder instance
        :rtype: EarningsRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return EarningsEndpoint(ctx, **ctx.defaults)

    def get_earnings_calendar(self, **defaults):
        """
        Creates request builder for Earnings Calendar

        This API method returns earning data as a calendar for a given date range. By default today's earning is returned.
        To call custom period, use start_date and end_date parameters.

        :returns: request builder instance
        :rtype: EarningsCalendarRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return EarningsCalendarEndpoint(ctx, **ctx.defaults)

    def get_ipo_calendar(self, **defaults):
        """
        Creates request builder for IPO Calendar

        This endpoint returns past, today, or upcoming IPOs.

        :returns: request builder instance
        :rtype: IPOCalendarRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return IPOCalendarEndpoint(ctx, **ctx.defaults)

    def get_statistics(self, **defaults):
        """
        Creates request builder for Statistics

        Returns current overview of company’s main statistics including valuation metrics and financials.

        :returns: request builder instance
        :rtype: StatisticsRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return StatisticsEndpoint(ctx, **ctx.defaults)

    def get_insider_transactions(self, **defaults):
        """
        Creates request builder for Insider Transactions

        Returns trading information performed by insiders.

        :returns: request builder instance
        :rtype: InsiderTransactionsRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return InsiderTransactionsEndpoint(ctx, **ctx.defaults)

    def get_income_statement(self, **defaults):
        """
        Creates request builder for Income Statement

        Returns complete income statement of a company and shows the company’s revenues and expenses
        during a period (annual or quarter).

        :returns: request builder instance
        :rtype: IncomeStatementRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return IncomeStatementEndpoint(ctx, **ctx.defaults)

    def get_balance_sheet(self, **defaults):
        """
        Creates request builder for Balance Sheet

        Returns complete balance sheet of a company showing the summary of assets, liabilities, and
        shareholders’ equity.

        :returns: request builder instance
        :rtype: BalanceSheetRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return BalanceSheetEndpoint(ctx, **ctx.defaults)

    def get_cash_flow(self, **defaults):
        """
        Creates request builder for Cash Flow

        Returns complete cash flow of a company showing net the amount of cash and cash equivalents
        being transferred into and out of a business.

        :returns: request builder instance
        :rtype: CashFlowRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return CashFlowEndpoint(ctx, **ctx.defaults)

    def get_options_expiration(self, **defaults):
        """
        Creates request builder for Options Expiration

        Return the expiration dates of an option contract.

        :returns: request builder instance
        :rtype: OptionsExpirationRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return OptionsExpirationEndpoint(ctx, **ctx.defaults)

    def get_options_chain(self, **defaults):
        """
        Creates request builder for Options Chain

        Returns a listing of all available options contracts for given security. It shows all listed puts,
        calls, their expiration, strike prices, and pricing information for a single underlying asset
        within a given maturity period.

        :returns: request builder instance
        :rtype: OptionsChainRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return OptionsChainEndpoint(ctx, **ctx.defaults)

    def get_key_executives(self, **defaults):
        """
        Creates request builder for Key Executives

        Returns individuals at the highest level of management of an organization.

        :returns: request builder instance
        :rtype: KeyExecutivesRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return KeyExecutivesEndpoint(ctx, **ctx.defaults)

    def get_institutional_holders(self, **defaults):
        """
        Creates request builder for Institutional Holders

        Returns the amount of the company’s available stock owned by institutions (pension funds,
        insurance companies, investment firms, private foundations, endowments, or other large
        entities that manage funds on behalf of others).

        :returns: request builder instance
        :rtype: InstitutionalHoldersRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return InstitutionalHoldersEndpoint(ctx, **ctx.defaults)

    def get_fund_holders(self, **defaults):
        """
        Creates request builder for Fund Holders

        Returns the amount of the company’s available stock owned by mutual fund holders.

        :returns: request builder instance
        :rtype: FundHoldersRequestBuilder
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return FundHoldersEndpoint(ctx, **ctx.defaults)

    def api_usage(self, **defaults):
        """
        Creates request builder for API usage

        This endpoint will provide information on the current usage of Twelve Data API.

        :returns: request builder instance
        :rtype: APIUsage
        """
        ctx = Context.from_context(self.ctx)
        ctx.defaults.update(defaults)
        return APIUsageEndpoint(ctx, **ctx.defaults)


================================================
FILE: src/twelvedata/context.py
================================================
# coding: utf-8


class Context:
    """
    Context which used by all request builders

    :ivar http_client: Default HTTP client
    :ivar apikey: API key for access to the Twelvedata API
    :ivar base_url: Base URL for Twelvedata API
    :ivar defaults: Default parameters that will be used by request builders.
    :ivar self_heal_time_s: time in seconds for retrying
    """

    http_client = None
    apikey = None
    base_url = None
    defaults = None
    self_heal_time_s = None

    @classmethod
    def from_context(cls, ctx):
        """
        Creates copy of specified Context
        """
        instance = cls()
        instance.http_client = ctx.http_client
        instance.apikey = ctx.apikey
        instance.base_url = ctx.base_url
        instance.self_heal_time_s = ctx.self_heal_time_s
        instance.defaults = dict(ctx.defaults or {})
        return instance


================================================
FILE: src/twelvedata/endpoints.py
================================================
import itertools
from .mixins import AsMixin


__all__ = (
    "ADOSCEndpoint",
    "ADEndpoint",
    "ADXREndpoint",
    "ADXEndpoint",
    "APIUsageEndpoint",
    "APOEndpoint",
    "AROONOSCEndpoint",
    "AROONEndpoint",
    "ATREndpoint",
    "AVGPRICEEndpoint",
    "BBANDSEndpoint",
    "BETAEndpoint",
    "BOPEndpoint",
    "BondsListEndpoint",
    "CCIEndpoint",
    "CEILEndpoint",
    "CMOEndpoint",
    "COPPOCKEndpoint",
    "CommoditiesListEndpoint",
    "CryptocurrenciesListEndpoint",
    "CryptocurrencyExchangesListEndpoint",
    "CurrencyConversionEndpoint",
    "DEMAEndpoint",
    "DividendsCalendarEndpoint",
    "DXEndpoint",
    "EarliestTimestampEndpoint",
    "EarningsCalendarEndpoint",
    "EarningsEndpoint",
    "EMAEndpoint",
    "EODEndpoint",
    "ETFListEndpoint",
    "ExchangeRateEndpoint",
    "ExchangesListEndpoint",
    "EXPEndpoint",
    "FLOOREndpoint",
    "ForexPairsListEndpoint",
    "FundsListEndpoint",
    "HEIKINASHICANDLESEndpoint",
    "HLC3Endpoint",
    "HT_DCPERIODEndpoint",
    "HT_DCPHASEEndpoint",
    "HT_PHASOREndpoint",
    "HT_SINEEndpoint",
    "HT_TRENDLINEEndpoint",
    "HT_TRENDMODEEndpoint",
    "ICHIMOKUEndpoint",
    "IndicesListEndpoint",
    "KAMAEndpoint",
    "KELTNEREndpoint",
    "KSTEndpoint",
    "LINEARREGANGLEEndpoint",
    "LINEARREGINTERCEPTEndpoint",
    "LINEARREGEndpoint",
    "LINEARREGSLOPEEndpoint",
    "LNEndpoint",
    "LOG10Endpoint",
    "MACDEndpoint",
    "MACDSlopeEndpoint",
    "MACDEXTEndpoint",
    "MAMAEndpoint",
    "MAEndpoint",
    "MAXINDEXEndpoint",
    "MAXEndpoint",
    "MarketStateEndpoint",
    "McGinleyDynamicEndpoint",
    "MEDPRICEEndpoint",
    "MFIEndpoint",
    "MIDPOINTEndpoint",
    "MIDPRICEEndpoint",
    "MININDEXEndpoint",
    "MINMAXINDEXEndpoint",
    "MINMAXEndpoint",
    "MINEndpoint",
    "MINUS_DIEndpoint",
    "MINUS_DMEndpoint",
    "MOMEndpoint",
    "NATREndpoint",
    "OBVEndpoint",
    "PLUS_DIEndpoint",
    "PLUS_DMEndpoint",
    "PPOEndpoint",
    "PercentBEndpoint",
    "PivotPointsHLEndpoint",
    "PriceEndpoint",
    "QuoteEndpoint",
    "ROCPEndpoint",
    "ROCR100Endpoint",
    "ROCREndpoint",
    "ROCEndpoint",
    "RSIEndpoint",
    "RVOLEndpoint",
    "SAREndpoint",
    "SMAEndpoint",
    "SQRTEndpoint",
    "STDDEVEndpoint",
    "STOCHFEndpoint",
    "STOCHRSIEndpoint",
    "STOCHEndpoint",
    "SplitsCalendarEndpoint",
    "SymbolSearchEndpoint",
    "StockExchangesListEndpoint",
    "StocksListEndpoint",
    "SuperTrendEndpoint",
    "T3MAEndpoint",
    "TEMAEndpoint",
    "TRANGEEndpoint",
    "TRIMAEndpoint",
    "TSFEndpoint",
    "TYPPRICEEndpoint",
    "TechIndicatorsMetaEndpoint",
    "TimeSeriesEndpoint",
    "ULTOSCEndpoint",
    "VAREndpoint",
    "VWAPEndpoint",
    "WCLPRICEEndpoint",
    "WILLREndpoint",
    "WMAEndpoint",
)


def purify_symbol(symbol):
    return "".join(symbol.split()).strip(',')


def get_symbol(symbol) -> (str, bool):
    if isinstance(symbol, str):
        purified_symbol = purify_symbol(symbol)
        if ',' in symbol and len(purified_symbol.split(',')) > 1:
            return purified_symbol, True
        return purified_symbol, False
    elif isinstance(symbol, list) or isinstance(symbol, tuple):
        if len(symbol) == 1:
            return symbol[0], False
        elif len(symbol) > 1:
            return ','.join(symbol), True
    else:
        raise TypeError('The type of argument "symbol" can be only: str, list, tuple')


def build_url(base, endpoint, params):
    query_params = '&'.join(['{}={}'.format(k, v) for k, v in params.items()])
    return '{}{}?{}'.format(base, endpoint, query_params)


class Endpoint(object):
    # This flag indicates that the current endpoint is a price chart
    is_price = False

    # This flag indicates that the current endpoint is a technical indicator
    is_indicator = False

    # This flag indicates that the chart should be drawn on the price chart
    is_overlay = False

    # This flag indicates that the current request is a batch request
    is_batch = False

    # Colors for chart
    colormap = {}

    # The fill between lines
    fill_area = {}

    def render_matplotlib(self, **kwargs):
        import matplotlib.dates as mdates
        from .renders import RENDERS_MAPPING, RenderContext

        df = kwargs.pop('df', None)
        if df is None:
            df = self.as_pandas()
        df = df.iloc[::-1]
        df.reset_index(level=0, inplace=True)
        df.set_index("datetime", inplace=True)

        ctx = RenderContext()
        ctx.colormap = self.colormap
        ctx.fill_area = self.fill_area
        ctx.interval_minutes = kwargs.pop("interval_minutes", 1)
        ctx.postfix = kwargs.pop("postfix", "")

        for render in RENDERS_MAPPING[self.__class__]:
            render.render_matplotlib(ctx, df, **kwargs)

    def render_plotly(self, **kwargs):
        from .renders import RENDERS_MAPPING, RenderContext

        ctx = RenderContext()
        ctx.colormap = self.colormap
        ctx.fill_area = self.fill_area
        ctx.fig = kwargs.pop("fig", None)
        ctx.interval_minutes = kwargs.pop("interval_minutes", 1)
        ctx.postfix = kwargs.pop("postfix", "")

        df = kwargs.pop('df', None)
        if df is None:
            df = self.as_pandas()
        return tuple(
            itertools.chain(
                *(
                    render.render_plotly(ctx, df, **kwargs)
                    for render in RENDERS_MAPPING[self.__class__]
                )
            )
        )


class CustomEndpoint(AsMixin, Endpoint):
    _name = "custom_endpoint"

    def __init__(
            self,
            ctx,
            name,
            **kwargs
    ):
        self.ctx = ctx
        self.name = name
        self.params = kwargs

    def execute(self, format="JSON", debug=False):
        self.params["format"] = format
        self.params["apikey"] = self.ctx.apikey
        endpoint = "/" + self.name

        if debug:
            return build_url(self.ctx.base_url, endpoint, self.params)
        return self.ctx.http_client.get(endpoint, params=self.params)


class TimeSeriesEndpoint(AsMixin, Endpoint):
    _name = "time_series"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        date=None,
        mic_code=None,
        previous_close=None,
        adjust=None,
    ):
        self.is_price = True
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.date = date
        self.mic_code = mic_code
        self.previous_close = previous_close
        self.adjust = adjust

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code
        if self.date is not None:
            params["date"] = self.date
        if self.previous_close is not None:
            params["previous_close"] = self.previous_close
        if self.adjust is not None:
            params["adjust"] = self.adjust

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/time_series"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class ExchangeRateEndpoint(AsMixin, Endpoint):
    _name = "exchange_rate"

    def __init__(self,
                 ctx,
                 symbol,
                 date=None,
                 dp=None,
                 timezone=None
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.date = date
        self.dp = dp
        self.timezone = timezone

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.date is not None:
            params["date"] = self.date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/exchange_rate"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class CurrencyConversionEndpoint(AsMixin, Endpoint):
    _name = "currency_conversion"

    def __init__(self,
                 ctx,
                 symbol,
                 amount=None,
                 date=None,
                 dp=None,
                 timezone=None
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.amount = amount
        self.date = date
        self.dp = dp
        self.timezone = timezone

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.amount is not None:
            params["amount"] = self.amount
        if self.date is not None:
            params["date"] = self.date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/currency_conversion"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class QuoteEndpoint(AsMixin, Endpoint):
    _name = "quote"

    def __init__(self,
                 ctx,
                 symbol,
                 interval="1day",
                 exchange=None,
                 country=None,
                 volume_time_period=None,
                 type=None,
                 dp=5,
                 timezone="Exchange",
                 prepost="false",
                 mic_code=None,
                 eod=None,
                 rolling_period=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.volume_time_period = volume_time_period
        self.type = type
        self.dp = dp
        self.timezone = timezone
        self.prepost = prepost
        self.mic_code = mic_code
        self.eod = eod
        self.rolling_period = rolling_period

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
            # Batch mode is not supported for this endpoint
            self.is_batch = False
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.volume_time_period is not None:
            params["volume_time_period"] = self.volume_time_period
        if self.type is not None:
            params["type"] = self.type
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code
        if self.eod is not None:
            params["eod"] = self.eod
        if self.rolling_period is not None:
            params["rolling_period"] = self.rolling_period

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/quote"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class PriceEndpoint(AsMixin, Endpoint):
    _name = "price"

    def __init__(self,
                 ctx,
                 symbol,
                 exchange=None,
                 country=None,
                 type=None,
                 dp=5,
                 prepost="false",
                 mic_code=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.type = type
        self.dp = dp
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.dp is not None:
            params["dp"] = self.dp
        if self.prepost is not None:
            params["prepost"] = self.prepost

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/price"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class EODEndpoint(AsMixin, Endpoint):
    _name = "eod"

    def __init__(self,
                 ctx,
                 symbol,
                 exchange=None,
                 country=None,
                 type=None,
                 dp=5,
                 prepost="false",
                 mic_code=None,
                 date=None,
                 ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.type = type
        self.dp = dp
        self.prepost = prepost
        self.mic_code = mic_code
        self.date = date

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.dp is not None:
            params["dp"] = self.dp
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code
        if self.date is not None:
            params["date"] = self.date

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/eod"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class TechIndicatorsMetaEndpoint(AsMixin, Endpoint):
    _name = "technical_indicators"

    def __init__(self, ctx):
        self.ctx = ctx

    def execute(self, format="JSON", debug=False):
        params = {}
        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/technical_indicators"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class StocksListEndpoint(AsMixin, Endpoint):
    _name = "stocks"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 type=None,
                 mic_code=None,
                 show_plan=None,
                 include_delisted=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.type = type
        self.mic_code = mic_code
        self.show_plan = show_plan
        self.include_delisted = include_delisted

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code
        if self.show_plan is not None:
            params["show_plan"] = self.show_plan
        if self.include_delisted is not None:
            params["include_delisted"] = self.include_delisted

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/stocks"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class StockExchangesListEndpoint(AsMixin, Endpoint):
    _name = "stock_exchanges"

    def __init__(self, ctx):
        self.ctx = ctx

    def execute(self, format="JSON", debug=False):

        params = {}

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/stock_exchanges"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class ForexPairsListEndpoint(AsMixin, Endpoint):
    _name = "forex_pairs"

    def __init__(self,
                 ctx,
                 symbol=None,
                 currency_base=None,
                 currency_quote=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.currency_base = currency_base
        self.currency_quote = currency_quote

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.currency_base is not None:
            params["currency_base"] = self.currency_base
        if self.currency_quote is not None:
            params["currency_quote"] = self.currency_quote

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/forex_pairs"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class CryptocurrenciesListEndpoint(AsMixin, Endpoint):
    _name = "cryptocurrencies"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 currency_base=None,
                 currency_quote=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.currency_base = currency_base
        self.currency_quote = currency_quote

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.currency_base is not None:
            params["currency_base"] = self.currency_base
        if self.currency_quote is not None:
            params["currency_quote"] = self.currency_quote

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/cryptocurrencies"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class ETFListEndpoint(AsMixin, Endpoint):
    _name = "etf"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 mic_code=None,
                 show_plan=None,
                 include_delisted=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.mic_code = mic_code
        self.show_plan = show_plan
        self.include_delisted = include_delisted

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code
        if self.show_plan is not None:
            params["show_plan"] = self.show_plan
        if self.include_delisted is not None:
            params["include_delisted"] = self.include_delisted

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/etf"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class IndicesListEndpoint(AsMixin, Endpoint):
    _name = "indices"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 mic_code=None,
                 show_plan=None,
                 include_delisted=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.mic_code = mic_code
        self.show_plan = show_plan
        self.include_delisted = include_delisted

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code
        if self.show_plan is not None:
            params["show_plan"] = self.show_plan
        if self.include_delisted is not None:
            params["include_delisted"] = self.include_delisted

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/indices"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class FundsListEndpoint(AsMixin, Endpoint):
    _name = "funds"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 type=None,
                 show_plan=None,
                 include_delisted=None,
                 page=None,
                 outputsize=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.type = type
        self.show_plan = show_plan
        self.include_delisted = include_delisted
        self.page = page
        self.outputsize = outputsize

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.show_plan is not None:
            params["show_plan"] = self.show_plan
        if self.include_delisted is not None:
            params["include_delisted"] = self.include_delisted
        if self.page is not None:
            params["page"] = self.page
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/funds"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class BondsListEndpoint(AsMixin, Endpoint):
    _name = "bonds"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 type=None,
                 show_plan=None,
                 include_delisted=None,
                 page=None,
                 outputsize=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.type = type
        self.show_plan = show_plan
        self.include_delisted = include_delisted
        self.page = page
        self.outputsize = outputsize

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.show_plan is not None:
            params["show_plan"] = self.show_plan
        if self.include_delisted is not None:
            params["include_delisted"] = self.include_delisted
        if self.page is not None:
            params["page"] = self.page
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/bonds"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)

class CommoditiesListEndpoint(AsMixin, Endpoint):
    _name = "commodities"

    def __init__(self,
                 ctx,
                 symbol=None,
                 category=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.category = category

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.category is not None:
            params["category"] = self.category

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/commodities"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class ExchangesListEndpoint(AsMixin, Endpoint):
    _name = "exchanges"

    def __init__(self,
                 ctx,
                 name=None,
                 code=None,
                 country=None,
                 type=None,
                 show_plan=None,
    ):
        self.ctx = ctx
        self.name = name
        self.code = code
        self.country = country
        self.type = type
        self.show_plan = show_plan

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.name is not None:
            params["name"] = self.name
        if self.code is not None:
            params["code"] = self.code
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.show_plan is not None:
            params["show_plan"] = self.show_plan

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/exchanges"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class CryptocurrencyExchangesListEndpoint(AsMixin, Endpoint):
    _name = "cryptocurrency_exchanges"

    def __init__(self, ctx):
        self.ctx = ctx

    def execute(self, format="JSON", debug=False):

        params = {}

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/cryptocurrency_exchanges"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class TechnicalIndicatorsListEndpoint(AsMixin, Endpoint):
    _name = "technical_indicators"

    def __init__(self, ctx):
        self.ctx = ctx

    def execute(self, format="JSON", debug=False):

        params = {}

        params["apikey"] = self.ctx.apikey
        endpoint = "/technical_indicators"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class SymbolSearchEndpoint(AsMixin, Endpoint):
    _name = "symbol_search"

    def __init__(self,
                 ctx,
                 symbol=None,
                 outputsize=None,
                 show_plan=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.outputsize = outputsize
        self.show_plan = show_plan

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.show_plan is not None:
            params["show_plan"] = self.show_plan

        params["format"] = "JSON"
        params["apikey"] = self.ctx.apikey
        endpoint = "/symbol_search"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class EarliestTimestampEndpoint(AsMixin, Endpoint):
    _name = "earliest_timestamp"

    def __init__(self,
                 ctx,
                 symbol=None,
                 interval=None,
                 exchange=None,
                 mic_code=None,
                 timezone=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.mic_code = mic_code
        self.timezone = timezone

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code
        if self.timezone is not None:
            params["timezone"] = self.timezone

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/earliest_timestamp"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class MarketStateEndpoint(AsMixin, Endpoint):
    _name = "market_state"

    def __init__(self,
                 ctx,
                 exchange=None,
                 code=None,
                 country=None,
    ):
        self.ctx = ctx
        self.exchange = exchange
        self.code = code
        self.country = country

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.code is not None:
            params["code"] = self.code
        if self.country is not None:
            params["country"] = self.country

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/market_state"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class LogoEndpoint(AsMixin, Endpoint):
    _name = "logo"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 mic_code=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.mic_code = mic_code
        self.method = "logo"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/logo"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class ProfileEndpoint(AsMixin, Endpoint):
    _name = "profile"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 mic_code=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.mic_code = mic_code
        self.method = "profile"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/profile"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class DividendsEndpoint(AsMixin, Endpoint):
    _name = "dividends"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 range=None,
                 start_date=None,
                 end_date=None,
                 mic_code=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.range = range
        self.start_date = start_date
        self.end_date = end_date
        self.mic_code = mic_code
        self.method = "dividends"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.range is not None:
            params["range"] = self.range
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/dividends"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class DividendsCalendarEndpoint(AsMixin, Endpoint):
    _name = "dividends_calendar"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 start_date=None,
                 end_date=None,
                 mic_code=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.start_date = start_date
        self.end_date = end_date
        self.mic_code = mic_code
        self.method = "dividends_calendar"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/dividends_calendar"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class SplitsEndpoint(AsMixin, Endpoint):
    _name = "splits"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 range=None,
                 start_date=None,
                 end_date=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.range = range
        self.start_date = start_date
        self.end_date = end_date
        self.method = "splits"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.range is not None:
            params["range"] = self.range
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/splits"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class SplitsCalendarEndpoint(AsMixin, Endpoint):
    _name = "splits_calendar"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 start_date=None,
                 end_date=None,
                 mic_code=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.start_date = start_date
        self.end_date = end_date
        self.mic_code = mic_code
        self.method = "splits_calendar"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/splits_calendar"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class EarningsEndpoint(AsMixin, Endpoint):
    _name = "earnings"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 period=None,
                 outputsize=None,
                 start_date=None,
                 end_date=None,
                 mic_code=None,
                 dp=None,
                 type=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.period = period
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.mic_code = mic_code
        self.dp = dp
        self.type = type
        self.method = "earnings"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.period is not None:
            params["period"] = self.period
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code
        if self.dp is not None:
            params["dp"] = self.dp
        if self.type is not None:
            params["type"] = self.type

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/earnings"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class EarningsCalendarEndpoint(AsMixin, Endpoint):
    _name = "earnings_calendar"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 period=None,
                 start_date=None,
                 end_date=None,
                 mic_code=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.period = period
        self.start_date = start_date
        self.end_date = end_date
        self.mic_code = mic_code
        self.method = "earnings_calendar"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.period is not None:
            params["period"] = self.period
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/earnings_calendar"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class IPOCalendarEndpoint(AsMixin, Endpoint):
    _name = "ipo_calendar"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 start_date=None,
                 end_date=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.start_date = start_date
        self.end_date = end_date
        self.method = "ipo_calendar"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/ipo_calendar"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class StatisticsEndpoint(AsMixin, Endpoint):
    _name = "statistics"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 mic_code=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.mic_code = mic_code
        self.method = "statistics"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/statistics"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class InsiderTransactionsEndpoint(AsMixin, Endpoint):
    _name = "insider_transactions"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 mic_code=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.mic_code = mic_code
        self.method = "insider_transactions"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/insider_transactions"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class IncomeStatementEndpoint(AsMixin, Endpoint):
    _name = "income_statement"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 period=None,
                 start_date=None,
                 end_date=None,
                 mic_code=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.period = period
        self.start_date = start_date
        self.end_date = end_date
        self.mic_code = mic_code
        self.method = "income_statement"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.period is not None:
            params["period"] = self.period
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/income_statement"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class BalanceSheetEndpoint(AsMixin, Endpoint):
    _name = "balance_sheet"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 period=None,
                 start_date=None,
                 end_date=None,
                 mic_code=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.period = period
        self.start_date = start_date
        self.end_date = end_date
        self.mic_code = mic_code
        self.method = "balance_sheet"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.period is not None:
            params["period"] = self.period
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/balance_sheet"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class CashFlowEndpoint(AsMixin, Endpoint):
    _name = "cash_flow"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 period=None,
                 start_date=None,
                 end_date=None,
                 mic_code=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.period = period
        self.start_date = start_date
        self.end_date = end_date
        self.mic_code = mic_code
        self.method = "cash_flow"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.period is not None:
            params["period"] = self.period
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/cash_flow"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class OptionsExpirationEndpoint(AsMixin, Endpoint):
    _name = "options_expiration"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 mic_code=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.mic_code = mic_code
        self.method = "options_expiration"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/options/expiration"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class OptionsChainEndpoint(AsMixin, Endpoint):
    _name = "options_chain"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 expiration_date=None,
                 option_id=None,
                 side=None,
                 mic_code=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.expiration_date = expiration_date
        self.option_id = option_id
        self.side = side
        self.mic_code = mic_code
        self.method = "options_chain"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.expiration_date is not None:
            params["expiration_date"] = self.expiration_date
        if self.option_id is not None:
            params["option_id"] = self.option_id
        if self.side is not None:
            params["side"] = self.side
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/options/chain"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class KeyExecutivesEndpoint(AsMixin, Endpoint):
    _name = "key_executives"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 mic_code=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.mic_code = mic_code
        self.method = "key_executives"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/key_executives"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class InstitutionalHoldersEndpoint(AsMixin, Endpoint):
    _name = "institutional_holders"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 mic_code=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.mic_code = mic_code
        self.method = "institutional_holders"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/institutional_holders"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class FundHoldersEndpoint(AsMixin, Endpoint):
    _name = "fund_holders"

    def __init__(self,
                 ctx,
                 symbol=None,
                 exchange=None,
                 country=None,
                 mic_code=None,
    ):
        self.ctx = ctx
        self.symbol = symbol
        self.exchange = exchange
        self.country = country
        self.mic_code = mic_code
        self.method = "fund_holders"

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"] = self.symbol
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/fund_holders"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class APIUsageEndpoint(AsMixin, Endpoint):
    _name = "api_usage"

    def __init__(self, ctx):
        self.ctx = ctx

    def execute(self, format="JSON", debug=False):
        params = {}
        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/api_usage"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class ADEndpoint(AsMixin, Endpoint):
    _name = "ad"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "ad"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/ad"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class ADOSCEndpoint(AsMixin, Endpoint):
    _name = "adosc"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        fast_period=12,
        slow_period=26,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "adosc"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.fast_period = fast_period
        self.slow_period = slow_period
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.fast_period is not None:
            params["fast_period"] = self.fast_period
        if self.slow_period is not None:
            params["slow_period"] = self.slow_period
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/adosc"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class ADXEndpoint(AsMixin, Endpoint):
    _name = "adx"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        time_period=14,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "adx"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.time_period = time_period
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.time_period is not None:
            params["time_period"] = self.time_period
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/adx"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class ADXREndpoint(AsMixin, Endpoint):
    _name = "adxr"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        time_period=14,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "adxr"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.time_period = time_period
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.time_period is not None:
            params["time_period"] = self.time_period
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/adxr"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class APOEndpoint(AsMixin, Endpoint):
    _name = "apo"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        time_period=9,
        fast_period=12,
        slow_period=26,
        ma_type="SMA",
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "apo"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.time_period = time_period
        self.fast_period = fast_period
        self.slow_period = slow_period
        self.ma_type = ma_type
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.time_period is not None:
            params["time_period"] = self.time_period
        if self.fast_period is not None:
            params["fast_period"] = self.fast_period
        if self.slow_period is not None:
            params["slow_period"] = self.slow_period
        if self.ma_type is not None:
            params["ma_type"] = self.ma_type
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/apo"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class AROONEndpoint(AsMixin, Endpoint):
    _name = "aroon"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        time_period=14,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "aroon"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.time_period = time_period
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.time_period is not None:
            params["time_period"] = self.time_period
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/aroon"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class AROONOSCEndpoint(AsMixin, Endpoint):
    _name = "aroonosc"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        time_period=14,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "aroonosc"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.time_period = time_period
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.time_period is not None:
            params["time_period"] = self.time_period
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/aroonosc"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class ATREndpoint(AsMixin, Endpoint):
    _name = "atr"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        time_period=14,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "atr"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.time_period = time_period
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.time_period is not None:
            params["time_period"] = self.time_period
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/atr"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class AVGPRICEEndpoint(AsMixin, Endpoint):
    _name = "avgprice"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "avgprice"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/avgprice"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class BBANDSEndpoint(AsMixin, Endpoint):
    _name = "bbands"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        series_type="close",
        time_period=20,
        sd="2",
        ma_type="SMA",
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "bbands"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.series_type = series_type
        self.time_period = time_period
        self.sd = sd
        self.ma_type = ma_type
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.series_type is not None:
            params["series_type"] = self.series_type
        if self.time_period is not None:
            params["time_period"] = self.time_period
        if self.sd is not None:
            params["sd"] = self.sd
        if self.ma_type is not None:
            params["ma_type"] = self.ma_type
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/bbands"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class BETAEndpoint(AsMixin, Endpoint):
    _name = "beta"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        series_type_1="open",
        series_type_2="close",
        time_period=9,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "beta"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.series_type_1 = series_type_1
        self.series_type_2 = series_type_2
        self.time_period = time_period
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.series_type_1 is not None:
            params["series_type_1"] = self.series_type_1
        if self.series_type_2 is not None:
            params["series_type_2"] = self.series_type_2
        if self.time_period is not None:
            params["time_period"] = self.time_period
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/beta"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class PercentBEndpoint(AsMixin, Endpoint):
    _name = "percent_b"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        series_type="close",
        time_period=20,
        sd="2",
        ma_type="SMA",
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "percent_b"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.series_type = series_type
        self.time_period = time_period
        self.sd = sd
        self.ma_type = ma_type
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.series_type is not None:
            params["series_type"] = self.series_type
        if self.time_period is not None:
            params["time_period"] = self.time_period
        if self.sd is not None:
            params["sd"] = self.sd
        if self.ma_type is not None:
            params["ma_type"] = self.ma_type
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/percent_b"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class PivotPointsHLEndpoint(AsMixin, Endpoint):
    _name = "pivot_points_hl"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        time_period=10,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "pivot_points_hl"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.time_period = time_period
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.time_period is not None:
            params["time_period"] = self.time_period
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/pivot_points_hl"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class BOPEndpoint(AsMixin, Endpoint):
    _name = "bop"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "bop"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/bop"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class CCIEndpoint(AsMixin, Endpoint):
    _name = "cci"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        time_period=20,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "cci"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.time_period = time_period
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.time_period is not None:
            params["time_period"] = self.time_period
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/cci"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class CEILEndpoint(AsMixin, Endpoint):
    _name = "ceil"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        series_type="close",
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "ceil"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.series_type = series_type
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.series_type is not None:
            params["series_type"] = self.series_type
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/ceil"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class CMOEndpoint(AsMixin, Endpoint):
    _name = "cmo"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        series_type="close",
        time_period=9,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "cmo"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.series_type = series_type
        self.time_period = time_period
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.series_type is not None:
            params["series_type"] = self.series_type
        if self.time_period is not None:
            params["time_period"] = self.time_period
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/cmo"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class COPPOCKEndpoint(AsMixin, Endpoint):
    _name = "coppock"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        series_type="close",
        long_roc_period=14,
        short_roc_period=11,
        wma_period=0,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "cmo"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.series_type = series_type
        self.long_roc_period = long_roc_period
        self.short_roc_period = short_roc_period
        self.wma_period = wma_period
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.series_type is not None:
            params["series_type"] = self.series_type
        if self.long_roc_period is not None:
            params["long_roc_period"] = self.long_roc_period
        if self.short_roc_period is not None:
            params["short_roc_period"] = self.short_roc_period
        if self.wma_period is not None:
            params["wma_period"] = self.wma_period
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/coppock"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class CEILEndpoint(AsMixin, Endpoint):
    _name = "ceil"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        series_type="close",
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "ceil"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.series_type = series_type
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.series_type is not None:
            params["series_type"] = self.series_type
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/ceil"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class DEMAEndpoint(AsMixin, Endpoint):
    _name = "dema"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        series_type="close",
        time_period=9,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "dema"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.series_type = series_type
        self.time_period = time_period
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.series_type is not None:
            params["series_type"] = self.series_type
        if self.time_period is not None:
            params["time_period"] = self.time_period
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/dema"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class DXEndpoint(AsMixin, Endpoint):
    _name = "dx"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        time_period=14,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "dx"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.time_period = time_period
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.time_period is not None:
            params["time_period"] = self.time_period
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/dx"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class EMAEndpoint(AsMixin, Endpoint):
    _name = "ema"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        series_type="close",
        time_period=9,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "ema"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.series_type = series_type
        self.time_period = time_period
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.series_type is not None:
            params["series_type"] = self.series_type
        if self.time_period is not None:
            params["time_period"] = self.time_period
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/ema"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class EXPEndpoint(AsMixin, Endpoint):
    _name = "exp"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        series_type="close",
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "exp"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.series_type = series_type
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.series_type is not None:
            params["series_type"] = self.series_type
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/exp"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class FLOOREndpoint(AsMixin, Endpoint):
    _name = "floor"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        series_type="close",
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_indicator = True
        self.meta_name = "floor"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.series_type = series_type
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.series_type is not None:
            params["series_type"] = self.series_type
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/floor"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class HEIKINASHICANDLESEndpoint(AsMixin, Endpoint):
    _name = "heikinashicandles"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_price = True
        self.meta_name = "heikinashicandles"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = order
        self.prepost = prepost
        self.mic_code = mic_code

    def execute(self, format="JSON", debug=False):

        params = {}
        if self.symbol is not None:
            params["symbol"], self.is_batch = get_symbol(self.symbol)
        if self.interval is not None:
            params["interval"] = self.interval
        if self.exchange is not None:
            params["exchange"] = self.exchange
        if self.country is not None:
            params["country"] = self.country
        if self.type is not None:
            params["type"] = self.type
        if self.outputsize is not None:
            params["outputsize"] = self.outputsize
        if self.start_date is not None:
            params["start_date"] = self.start_date
        if self.end_date is not None:
            params["end_date"] = self.end_date
        if self.dp is not None:
            params["dp"] = self.dp
        if self.timezone is not None:
            params["timezone"] = self.timezone
        if self.order is not None:
            params["order"] = self.order
        if self.prepost is not None:
            params["prepost"] = self.prepost
        if self.mic_code is not None:
            params["mic_code"] = self.mic_code

        params["format"] = format
        params["apikey"] = self.ctx.apikey
        endpoint = "/heikinashicandles"

        if debug:
            return build_url(self.ctx.base_url, endpoint, params)
        return self.ctx.http_client.get(endpoint, params=params)


class HLC3Endpoint(AsMixin, Endpoint):
    _name = "hlc3"

    def __init__(
        self,
        ctx,
        symbol,
        interval,
        exchange=None,
        country=None,
        type=None,
        outputsize=30,
        start_date=None,
        end_date=None,
        dp=5,
        timezone="Exchange",
        order="desc",
        prepost="false",
        mic_code=None,
    ):
        self.is_price = True
        self.meta_name = "hlc3"
        self.ctx = ctx
        self.symbol = symbol
        self.interval = interval
        self.exchange = exchange
        self.country = country
        self.type = type
        self.outputsize = outputsize
        self.start_date = start_date
        self.end_date = end_date
        self.dp = dp
        self.timezone = timezone
        self.order = or
Download .txt
gitextract_6rx84ncj/

├── .coveragerc
├── .github/
│   ├── CONTRIBUTING.md
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   ├── feature_request.md
│   │   └── question.md
│   └── dependabot.yml
├── .gitignore
├── .travis.yml
├── AUTHORS.rst
├── CHANGELOG.rst
├── CODE_OF_CONDUCT.md
├── LICENSE.txt
├── Pipfile
├── README.md
├── docs/
│   ├── Makefile
│   ├── _static/
│   │   └── .gitignore
│   ├── authors.rst
│   ├── changelog.rst
│   ├── conf.py
│   ├── index.rst
│   └── license.rst
├── pyproject.toml
├── requirements.txt
├── setup.cfg
├── setup.py
├── src/
│   └── twelvedata/
│       ├── __init__.py
│       ├── client.py
│       ├── context.py
│       ├── endpoints.py
│       ├── exceptions.py
│       ├── http_client.py
│       ├── mixins.py
│       ├── renders.py
│       ├── time_series.py
│       ├── utils.py
│       └── websocket.py
└── tests/
    ├── conftest.py
    └── test_client.py
Download .txt
SYMBOL INDEX (803 symbols across 11 files)

FILE: src/twelvedata/client.py
  class TDClient (line 51) | class TDClient:
    method __init__ (line 52) | def __init__(self, apikey, http_client=None, base_url=None, self_heal_...
    method websocket (line 62) | def websocket(self, **defaults):
    method custom_endpoint (line 67) | def custom_endpoint(self, **defaults):
    method get_stocks_list (line 81) | def get_stocks_list(self, **defaults):
    method get_stock_exchanges_list (line 95) | def get_stock_exchanges_list(self):
    method get_forex_pairs_list (line 107) | def get_forex_pairs_list(self, **defaults):
    method get_cryptocurrencies_list (line 121) | def get_cryptocurrencies_list(self, **defaults):
    method get_etf_list (line 135) | def get_etf_list(self, **defaults):
    method get_indices_list (line 148) | def get_indices_list(self, **defaults):
    method get_funds_list (line 161) | def get_funds_list(self, **defaults):
    method get_bonds_list (line 174) | def get_bonds_list(self, **defaults):
    method get_commodities_list (line 187) | def get_commodities_list(self, **defaults):
    method get_exchanges_list (line 200) | def get_exchanges_list(self, **defaults):
    method get_cryptocurrency_exchanges_list (line 214) | def get_cryptocurrency_exchanges_list(self, **defaults):
    method get_technical_indicators_list (line 228) | def get_technical_indicators_list(self):
    method symbol_search (line 240) | def symbol_search(self, **defaults):
    method get_earliest_timestamp (line 254) | def get_earliest_timestamp(self, **defaults):
    method get_market_state (line 267) | def get_market_state(self, **defaults):
    method time_series (line 280) | def time_series(self, **defaults):
    method exchange_rate (line 291) | def exchange_rate(self, **defaults):
    method currency_conversion (line 302) | def currency_conversion(self, **defaults):
    method quote (line 313) | def quote(self, **defaults):
    method price (line 324) | def price(self, **defaults):
    method eod (line 335) | def eod(self, **defaults):
    method get_logo (line 346) | def get_logo(self, **defaults):
    method get_profile (line 359) | def get_profile(self, **defaults):
    method get_dividends (line 372) | def get_dividends(self, **defaults):
    method get_dividends_calendar (line 385) | def get_dividends_calendar(self, **defaults):
    method get_splits (line 398) | def get_splits(self, **defaults):
    method get_splits_calendar (line 411) | def get_splits_calendar(self, **defaults):
    method get_earnings (line 424) | def get_earnings(self, **defaults):
    method get_earnings_calendar (line 438) | def get_earnings_calendar(self, **defaults):
    method get_ipo_calendar (line 452) | def get_ipo_calendar(self, **defaults):
    method get_statistics (line 465) | def get_statistics(self, **defaults):
    method get_insider_transactions (line 478) | def get_insider_transactions(self, **defaults):
    method get_income_statement (line 491) | def get_income_statement(self, **defaults):
    method get_balance_sheet (line 505) | def get_balance_sheet(self, **defaults):
    method get_cash_flow (line 519) | def get_cash_flow(self, **defaults):
    method get_options_expiration (line 533) | def get_options_expiration(self, **defaults):
    method get_options_chain (line 546) | def get_options_chain(self, **defaults):
    method get_key_executives (line 561) | def get_key_executives(self, **defaults):
    method get_institutional_holders (line 574) | def get_institutional_holders(self, **defaults):
    method get_fund_holders (line 589) | def get_fund_holders(self, **defaults):
    method api_usage (line 602) | def api_usage(self, **defaults):

FILE: src/twelvedata/context.py
  class Context (line 4) | class Context:
    method from_context (line 22) | def from_context(cls, ctx):

FILE: src/twelvedata/endpoints.py
  function purify_symbol (line 126) | def purify_symbol(symbol):
  function get_symbol (line 130) | def get_symbol(symbol) -> (str, bool):
  function build_url (line 145) | def build_url(base, endpoint, params):
  class Endpoint (line 150) | class Endpoint(object):
    method render_matplotlib (line 169) | def render_matplotlib(self, **kwargs):
    method render_plotly (line 189) | def render_plotly(self, **kwargs):
  class CustomEndpoint (line 212) | class CustomEndpoint(AsMixin, Endpoint):
    method __init__ (line 215) | def __init__(
    method execute (line 225) | def execute(self, format="JSON", debug=False):
  class TimeSeriesEndpoint (line 235) | class TimeSeriesEndpoint(AsMixin, Endpoint):
    method __init__ (line 238) | def __init__(
    method execute (line 277) | def execute(self, format="JSON", debug=False):
  class ExchangeRateEndpoint (line 322) | class ExchangeRateEndpoint(AsMixin, Endpoint):
    method __init__ (line 325) | def __init__(self,
    method execute (line 338) | def execute(self, format="JSON", debug=False):
  class CurrencyConversionEndpoint (line 359) | class CurrencyConversionEndpoint(AsMixin, Endpoint):
    method __init__ (line 362) | def __init__(self,
    method execute (line 377) | def execute(self, format="JSON", debug=False):
  class QuoteEndpoint (line 400) | class QuoteEndpoint(AsMixin, Endpoint):
    method __init__ (line 403) | def __init__(self,
    method execute (line 432) | def execute(self, format="JSON", debug=False):
  class PriceEndpoint (line 471) | class PriceEndpoint(AsMixin, Endpoint):
    method __init__ (line 474) | def __init__(self,
    method execute (line 493) | def execute(self, format="JSON", debug=False):
  class EODEndpoint (line 518) | class EODEndpoint(AsMixin, Endpoint):
    method __init__ (line 521) | def __init__(self,
    method execute (line 542) | def execute(self, format="JSON", debug=False):
  class TechIndicatorsMetaEndpoint (line 571) | class TechIndicatorsMetaEndpoint(AsMixin, Endpoint):
    method __init__ (line 574) | def __init__(self, ctx):
    method execute (line 577) | def execute(self, format="JSON", debug=False):
  class StocksListEndpoint (line 588) | class StocksListEndpoint(AsMixin, Endpoint):
    method __init__ (line 591) | def __init__(self,
    method execute (line 610) | def execute(self, format="JSON", debug=False):
  class StockExchangesListEndpoint (line 637) | class StockExchangesListEndpoint(AsMixin, Endpoint):
    method __init__ (line 640) | def __init__(self, ctx):
    method execute (line 643) | def execute(self, format="JSON", debug=False):
  class ForexPairsListEndpoint (line 656) | class ForexPairsListEndpoint(AsMixin, Endpoint):
    method __init__ (line 659) | def __init__(self,
    method execute (line 670) | def execute(self, format="JSON", debug=False):
  class CryptocurrenciesListEndpoint (line 689) | class CryptocurrenciesListEndpoint(AsMixin, Endpoint):
    method __init__ (line 692) | def __init__(self,
    method execute (line 705) | def execute(self, format="JSON", debug=False):
  class ETFListEndpoint (line 726) | class ETFListEndpoint(AsMixin, Endpoint):
    method __init__ (line 729) | def __init__(self,
    method execute (line 746) | def execute(self, format="JSON", debug=False):
  class IndicesListEndpoint (line 771) | class IndicesListEndpoint(AsMixin, Endpoint):
    method __init__ (line 774) | def __init__(self,
    method execute (line 791) | def execute(self, format="JSON", debug=False):
  class FundsListEndpoint (line 816) | class FundsListEndpoint(AsMixin, Endpoint):
    method __init__ (line 819) | def __init__(self,
    method execute (line 840) | def execute(self, format="JSON", debug=False):
  class BondsListEndpoint (line 869) | class BondsListEndpoint(AsMixin, Endpoint):
    method __init__ (line 872) | def __init__(self,
    method execute (line 893) | def execute(self, format="JSON", debug=False):
  class CommoditiesListEndpoint (line 921) | class CommoditiesListEndpoint(AsMixin, Endpoint):
    method __init__ (line 924) | def __init__(self,
    method execute (line 933) | def execute(self, format="JSON", debug=False):
  class ExchangesListEndpoint (line 950) | class ExchangesListEndpoint(AsMixin, Endpoint):
    method __init__ (line 953) | def __init__(self,
    method execute (line 968) | def execute(self, format="JSON", debug=False):
  class CryptocurrencyExchangesListEndpoint (line 991) | class CryptocurrencyExchangesListEndpoint(AsMixin, Endpoint):
    method __init__ (line 994) | def __init__(self, ctx):
    method execute (line 997) | def execute(self, format="JSON", debug=False):
  class TechnicalIndicatorsListEndpoint (line 1010) | class TechnicalIndicatorsListEndpoint(AsMixin, Endpoint):
    method __init__ (line 1013) | def __init__(self, ctx):
    method execute (line 1016) | def execute(self, format="JSON", debug=False):
  class SymbolSearchEndpoint (line 1028) | class SymbolSearchEndpoint(AsMixin, Endpoint):
    method __init__ (line 1031) | def __init__(self,
    method execute (line 1042) | def execute(self, format="JSON", debug=False):
  class EarliestTimestampEndpoint (line 1061) | class EarliestTimestampEndpoint(AsMixin, Endpoint):
    method __init__ (line 1064) | def __init__(self,
    method execute (line 1079) | def execute(self, format="JSON", debug=False):
  class MarketStateEndpoint (line 1102) | class MarketStateEndpoint(AsMixin, Endpoint):
    method __init__ (line 1105) | def __init__(self,
    method execute (line 1116) | def execute(self, format="JSON", debug=False):
  class LogoEndpoint (line 1135) | class LogoEndpoint(AsMixin, Endpoint):
    method __init__ (line 1138) | def __init__(self,
    method execute (line 1152) | def execute(self, format="JSON", debug=False):
  class ProfileEndpoint (line 1173) | class ProfileEndpoint(AsMixin, Endpoint):
    method __init__ (line 1176) | def __init__(self,
    method execute (line 1190) | def execute(self, format="JSON", debug=False):
  class DividendsEndpoint (line 1211) | class DividendsEndpoint(AsMixin, Endpoint):
    method __init__ (line 1214) | def __init__(self,
    method execute (line 1234) | def execute(self, format="JSON", debug=False):
  class DividendsCalendarEndpoint (line 1261) | class DividendsCalendarEndpoint(AsMixin, Endpoint):
    method __init__ (line 1264) | def __init__(self,
    method execute (line 1282) | def execute(self, format="JSON", debug=False):
  class SplitsEndpoint (line 1307) | class SplitsEndpoint(AsMixin, Endpoint):
    method __init__ (line 1310) | def __init__(self,
    method execute (line 1328) | def execute(self, format="JSON", debug=False):
  class SplitsCalendarEndpoint (line 1353) | class SplitsCalendarEndpoint(AsMixin, Endpoint):
    method __init__ (line 1356) | def __init__(self,
    method execute (line 1374) | def execute(self, format="JSON", debug=False):
  class EarningsEndpoint (line 1399) | class EarningsEndpoint(AsMixin, Endpoint):
    method __init__ (line 1402) | def __init__(self,
    method execute (line 1428) | def execute(self, format="JSON", debug=False):
  class EarningsCalendarEndpoint (line 1461) | class EarningsCalendarEndpoint(AsMixin, Endpoint):
    method __init__ (line 1464) | def __init__(self,
    method execute (line 1484) | def execute(self, format="JSON", debug=False):
  class IPOCalendarEndpoint (line 1511) | class IPOCalendarEndpoint(AsMixin, Endpoint):
    method __init__ (line 1514) | def __init__(self,
    method execute (line 1530) | def execute(self, format="JSON", debug=False):
  class StatisticsEndpoint (line 1553) | class StatisticsEndpoint(AsMixin, Endpoint):
    method __init__ (line 1556) | def __init__(self,
    method execute (line 1570) | def execute(self, format="JSON", debug=False):
  class InsiderTransactionsEndpoint (line 1591) | class InsiderTransactionsEndpoint(AsMixin, Endpoint):
    method __init__ (line 1594) | def __init__(self,
    method execute (line 1608) | def execute(self, format="JSON", debug=False):
  class IncomeStatementEndpoint (line 1629) | class IncomeStatementEndpoint(AsMixin, Endpoint):
    method __init__ (line 1632) | def __init__(self,
    method execute (line 1652) | def execute(self, format="JSON", debug=False):
  class BalanceSheetEndpoint (line 1679) | class BalanceSheetEndpoint(AsMixin, Endpoint):
    method __init__ (line 1682) | def __init__(self,
    method execute (line 1702) | def execute(self, format="JSON", debug=False):
  class CashFlowEndpoint (line 1729) | class CashFlowEndpoint(AsMixin, Endpoint):
    method __init__ (line 1732) | def __init__(self,
    method execute (line 1752) | def execute(self, format="JSON", debug=False):
  class OptionsExpirationEndpoint (line 1779) | class OptionsExpirationEndpoint(AsMixin, Endpoint):
    method __init__ (line 1782) | def __init__(self,
    method execute (line 1796) | def execute(self, format="JSON", debug=False):
  class OptionsChainEndpoint (line 1817) | class OptionsChainEndpoint(AsMixin, Endpoint):
    method __init__ (line 1820) | def __init__(self,
    method execute (line 1840) | def execute(self, format="JSON", debug=False):
  class KeyExecutivesEndpoint (line 1867) | class KeyExecutivesEndpoint(AsMixin, Endpoint):
    method __init__ (line 1870) | def __init__(self,
    method execute (line 1884) | def execute(self, format="JSON", debug=False):
  class InstitutionalHoldersEndpoint (line 1905) | class InstitutionalHoldersEndpoint(AsMixin, Endpoint):
    method __init__ (line 1908) | def __init__(self,
    method execute (line 1922) | def execute(self, format="JSON", debug=False):
  class FundHoldersEndpoint (line 1943) | class FundHoldersEndpoint(AsMixin, Endpoint):
    method __init__ (line 1946) | def __init__(self,
    method execute (line 1960) | def execute(self, format="JSON", debug=False):
  class APIUsageEndpoint (line 1981) | class APIUsageEndpoint(AsMixin, Endpoint):
    method __init__ (line 1984) | def __init__(self, ctx):
    method execute (line 1987) | def execute(self, format="JSON", debug=False):
  class ADEndpoint (line 1998) | class ADEndpoint(AsMixin, Endpoint):
    method __init__ (line 2001) | def __init__(
    method execute (line 2035) | def execute(self, format="JSON", debug=False):
  class ADOSCEndpoint (line 2074) | class ADOSCEndpoint(AsMixin, Endpoint):
    method __init__ (line 2077) | def __init__(
    method execute (line 2115) | def execute(self, format="JSON", debug=False):
  class ADXEndpoint (line 2158) | class ADXEndpoint(AsMixin, Endpoint):
    method __init__ (line 2161) | def __init__(
    method execute (line 2197) | def execute(self, format="JSON", debug=False):
  class ADXREndpoint (line 2238) | class ADXREndpoint(AsMixin, Endpoint):
    method __init__ (line 2241) | def __init__(
    method execute (line 2277) | def execute(self, format="JSON", debug=False):
  class APOEndpoint (line 2318) | class APOEndpoint(AsMixin, Endpoint):
    method __init__ (line 2321) | def __init__(
    method execute (line 2363) | def execute(self, format="JSON", debug=False):
  class AROONEndpoint (line 2410) | class AROONEndpoint(AsMixin, Endpoint):
    method __init__ (line 2413) | def __init__(
    method execute (line 2449) | def execute(self, format="JSON", debug=False):
  class AROONOSCEndpoint (line 2490) | class AROONOSCEndpoint(AsMixin, Endpoint):
    method __init__ (line 2493) | def __init__(
    method execute (line 2529) | def execute(self, format="JSON", debug=False):
  class ATREndpoint (line 2570) | class ATREndpoint(AsMixin, Endpoint):
    method __init__ (line 2573) | def __init__(
    method execute (line 2609) | def execute(self, format="JSON", debug=False):
  class AVGPRICEEndpoint (line 2650) | class AVGPRICEEndpoint(AsMixin, Endpoint):
    method __init__ (line 2653) | def __init__(
    method execute (line 2687) | def execute(self, format="JSON", debug=False):
  class BBANDSEndpoint (line 2726) | class BBANDSEndpoint(AsMixin, Endpoint):
    method __init__ (line 2729) | def __init__(
    method execute (line 2771) | def execute(self, format="JSON", debug=False):
  class BETAEndpoint (line 2818) | class BETAEndpoint(AsMixin, Endpoint):
    method __init__ (line 2821) | def __init__(
    method execute (line 2861) | def execute(self, format="JSON", debug=False):
  class PercentBEndpoint (line 2906) | class PercentBEndpoint(AsMixin, Endpoint):
    method __init__ (line 2909) | def __init__(
    method execute (line 2951) | def execute(self, format="JSON", debug=False):
  class PivotPointsHLEndpoint (line 2998) | class PivotPointsHLEndpoint(AsMixin, Endpoint):
    method __init__ (line 3001) | def __init__(
    method execute (line 3037) | def execute(self, format="JSON", debug=False):
  class BOPEndpoint (line 3078) | class BOPEndpoint(AsMixin, Endpoint):
    method __init__ (line 3081) | def __init__(
    method execute (line 3115) | def execute(self, format="JSON", debug=False):
  class CCIEndpoint (line 3154) | class CCIEndpoint(AsMixin, Endpoint):
    method __init__ (line 3157) | def __init__(
    method execute (line 3193) | def execute(self, format="JSON", debug=False):
  class CEILEndpoint (line 3234) | class CEILEndpoint(AsMixin, Endpoint):
    method __init__ (line 3237) | def __init__(
    method execute (line 3273) | def execute(self, format="JSON", debug=False):
    method __init__ (line 3493) | def __init__(
    method execute (line 3529) | def execute(self, format="JSON", debug=False):
  class CMOEndpoint (line 3314) | class CMOEndpoint(AsMixin, Endpoint):
    method __init__ (line 3317) | def __init__(
    method execute (line 3355) | def execute(self, format="JSON", debug=False):
  class COPPOCKEndpoint (line 3398) | class COPPOCKEndpoint(AsMixin, Endpoint):
    method __init__ (line 3401) | def __init__(
    method execute (line 3443) | def execute(self, format="JSON", debug=False):
  class CEILEndpoint (line 3490) | class CEILEndpoint(AsMixin, Endpoint):
    method __init__ (line 3237) | def __init__(
    method execute (line 3273) | def execute(self, format="JSON", debug=False):
    method __init__ (line 3493) | def __init__(
    method execute (line 3529) | def execute(self, format="JSON", debug=False):
  class DEMAEndpoint (line 3570) | class DEMAEndpoint(AsMixin, Endpoint):
    method __init__ (line 3573) | def __init__(
    method execute (line 3611) | def execute(self, format="JSON", debug=False):
  class DXEndpoint (line 3654) | class DXEndpoint(AsMixin, Endpoint):
    method __init__ (line 3657) | def __init__(
    method execute (line 3693) | def execute(self, format="JSON", debug=False):
  class EMAEndpoint (line 3734) | class EMAEndpoint(AsMixin, Endpoint):
    method __init__ (line 3737) | def __init__(
    method execute (line 3775) | def execute(self, format="JSON", debug=False):
  class EXPEndpoint (line 3818) | class EXPEndpoint(AsMixin, Endpoint):
    method __init__ (line 3821) | def __init__(
    method execute (line 3857) | def execute(self, format="JSON", debug=False):
  class FLOOREndpoint (line 3898) | class FLOOREndpoint(AsMixin, Endpoint):
    method __init__ (line 3901) | def __init__(
    method execute (line 3937) | def execute(self, format="JSON", debug=False):
  class HEIKINASHICANDLESEndpoint (line 3978) | class HEIKINASHICANDLESEndpoint(AsMixin, Endpoint):
    method __init__ (line 3981) | def __init__(
    method execute (line 4015) | def execute(self, format="JSON", debug=False):
  class HLC3Endpoint (line 4054) | class HLC3Endpoint(AsMixin, Endpoint):
    method __init__ (line 4057) | def __init__(
    method execute (line 4091) | def execute(self, format="JSON", debug=False):
  class HT_DCPERIODEndpoint (line 4130) | class HT_DCPERIODEndpoint(AsMixin, Endpoint):
    method __init__ (line 4133) | def __init__(
    method execute (line 4169) | def execute(self, format="JSON", debug=False):
  class HT_DCPHASEEndpoint (line 4210) | class HT_DCPHASEEndpoint(AsMixin, Endpoint):
    method __init__ (line 4213) | def __init__(
    method execute (line 4249) | def execute(self, format="JSON", debug=False):
  class HT_PHASOREndpoint (line 4290) | class HT_PHASOREndpoint(AsMixin, Endpoint):
    method __init__ (line 4293) | def __init__(
    method execute (line 4329) | def execute(self, format="JSON", debug=False):
  class HT_SINEEndpoint (line 4370) | class HT_SINEEndpoint(AsMixin, Endpoint):
    method __init__ (line 4373) | def __init__(
    method execute (line 4409) | def execute(self, format="JSON", debug=False):
  class HT_TRENDLINEEndpoint (line 4450) | class HT_TRENDLINEEndpoint(AsMixin, Endpoint):
    method __init__ (line 4453) | def __init__(
    method execute (line 4489) | def execute(self, format="JSON", debug=False):
  class HT_TRENDMODEEndpoint (line 4530) | class HT_TRENDMODEEndpoint(AsMixin, Endpoint):
    method __init__ (line 4533) | def __init__(
    method execute (line 4569) | def execute(self, format="JSON", debug=False):
  class ICHIMOKUEndpoint (line 4610) | class ICHIMOKUEndpoint(AsMixin, Endpoint):
    method __init__ (line 4613) | def __init__(
    method execute (line 4657) | def execute(self, format="JSON", debug=False):
  class KAMAEndpoint (line 4706) | class KAMAEndpoint(AsMixin, Endpoint):
    method __init__ (line 4709) | def __init__(
    method execute (line 4747) | def execute(self, format="JSON", debug=False):
  class KELTNEREndpoint (line 4790) | class KELTNEREndpoint(AsMixin, Endpoint):
    method __init__ (line 4793) | def __init__(
    method execute (line 4837) | def execute(self, format="JSON", debug=False):
  class KSTEndpoint (line 4886) | class KSTEndpoint(AsMixin, Endpoint):
    method __init__ (line 4889) | def __init__(
    method execute (line 4941) | def execute(self, format="JSON", debug=False):
  class LINEARREGEndpoint (line 4998) | class LINEARREGEndpoint(AsMixin, Endpoint):
    method __init__ (line 5001) | def __init__(
    method execute (line 5039) | def execute(self, format="JSON", debug=False):
  class LINEARREGANGLEEndpoint (line 5082) | class LINEARREGANGLEEndpoint(AsMixin, Endpoint):
    method __init__ (line 5085) | def __init__(
    method execute (line 5123) | def execute(self, format="JSON", debug=False):
  class LINEARREGINTERCEPTEndpoint (line 5166) | class LINEARREGINTERCEPTEndpoint(AsMixin, Endpoint):
    method __init__ (line 5169) | def __init__(
    method execute (line 5207) | def execute(self, format="JSON", debug=False):
  class LINEARREGSLOPEEndpoint (line 5250) | class LINEARREGSLOPEEndpoint(AsMixin, Endpoint):
    method __init__ (line 5253) | def __init__(
    method execute (line 5291) | def execute(self, format="JSON", debug=False):
  class LNEndpoint (line 5334) | class LNEndpoint(AsMixin, Endpoint):
    method __init__ (line 5337) | def __init__(
    method execute (line 5373) | def execute(self, format="JSON", debug=False):
  class LOG10Endpoint (line 5414) | class LOG10Endpoint(AsMixin, Endpoint):
    method __init__ (line 5417) | def __init__(
    method execute (line 5453) | def execute(self, format="JSON", debug=False):
  class MAEndpoint (line 5494) | class MAEndpoint(AsMixin, Endpoint):
    method __init__ (line 5497) | def __init__(
    method execute (line 5537) | def execute(self, format="JSON", debug=False):
  class MACDEndpoint (line 5582) | class MACDEndpoint(AsMixin, Endpoint):
    method __init__ (line 5585) | def __init__(
    method execute (line 5627) | def execute(self, format="JSON", debug=False):
  class MACDSlopeEndpoint (line 5674) | class MACDSlopeEndpoint(AsMixin, Endpoint):
    method __init__ (line 5677) | def __init__(
    method execute (line 5721) | def execute(self, format="JSON", debug=False):
  class MACDEXTEndpoint (line 5770) | class MACDEXTEndpoint(AsMixin, Endpoint):
    method __init__ (line 5773) | def __init__(
    method execute (line 5821) | def execute(self, format="JSON", debug=False):
  class MAMAEndpoint (line 5874) | class MAMAEndpoint(AsMixin, Endpoint):
    method __init__ (line 5877) | def __init__(
    method execute (line 5917) | def execute(self, format="JSON", debug=False):
  class MAXEndpoint (line 5962) | class MAXEndpoint(AsMixin, Endpoint):
    method __init__ (line 5965) | def __init__(
    method execute (line 6003) | def execute(self, format="JSON", debug=False):
  class MAXINDEXEndpoint (line 6046) | class MAXINDEXEndpoint(AsMixin, Endpoint):
    method __init__ (line 6049) | def __init__(
    method execute (line 6087) | def execute(self, format="JSON", debug=False):
  class McGinleyDynamicEndpoint (line 6130) | class McGinleyDynamicEndpoint(AsMixin, Endpoint):
    method __init__ (line 6133) | def __init__(
    method execute (line 6169) | def execute(self, format="JSON", debug=False):
  class MEDPRICEEndpoint (line 6210) | class MEDPRICEEndpoint(AsMixin, Endpoint):
    method __init__ (line 6213) | def __init__(
    method execute (line 6251) | def execute(self, format="JSON", debug=False):
  class MFIEndpoint (line 6294) | class MFIEndpoint(AsMixin, Endpoint):
    method __init__ (line 6297) | def __init__(
    method execute (line 6333) | def execute(self, format="JSON", debug=False):
  class MIDPOINTEndpoint (line 6374) | class MIDPOINTEndpoint(AsMixin, Endpoint):
    method __init__ (line 6377) | def __init__(
    method execute (line 6415) | def execute(self, format="JSON", debug=False):
  class MIDPRICEEndpoint (line 6458) | class MIDPRICEEndpoint(AsMixin, Endpoint):
    method __init__ (line 6461) | def __init__(
    method execute (line 6497) | def execute(self, format="JSON", debug=False):
  class MINEndpoint (line 6538) | class MINEndpoint(AsMixin, Endpoint):
    method __init__ (line 6541) | def __init__(
    method execute (line 6579) | def execute(self, format="JSON", debug=False):
  class MININDEXEndpoint (line 6622) | class MININDEXEndpoint(AsMixin, Endpoint):
    method __init__ (line 6625) | def __init__(
    method execute (line 6663) | def execute(self, format="JSON", debug=False):
  class MINMAXEndpoint (line 6706) | class MINMAXEndpoint(AsMixin, Endpoint):
    method __init__ (line 6709) | def __init__(
    method execute (line 6747) | def execute(self, format="JSON", debug=False):
  class MINMAXINDEXEndpoint (line 6790) | class MINMAXINDEXEndpoint(AsMixin, Endpoint):
    method __init__ (line 6793) | def __init__(
    method execute (line 6831) | def execute(self, format="JSON", debug=False):
  class MINUS_DIEndpoint (line 6874) | class MINUS_DIEndpoint(AsMixin, Endpoint):
    method __init__ (line 6877) | def __init__(
    method execute (line 6913) | def execute(self, format="JSON", debug=False):
  class MINUS_DMEndpoint (line 6954) | class MINUS_DMEndpoint(AsMixin, Endpoint):
    method __init__ (line 6957) | def __init__(
    method execute (line 6993) | def execute(self, format="JSON", debug=False):
  class MOMEndpoint (line 7034) | class MOMEndpoint(AsMixin, Endpoint):
    method __init__ (line 7037) | def __init__(
    method execute (line 7075) | def execute(self, format="JSON", debug=False):
  class NATREndpoint (line 7118) | class NATREndpoint(AsMixin, Endpoint):
    method __init__ (line 7121) | def __init__(
    method execute (line 7157) | def execute(self, format="JSON", debug=False):
  class OBVEndpoint (line 7198) | class OBVEndpoint(AsMixin, Endpoint):
    method __init__ (line 7201) | def __init__(
    method execute (line 7237) | def execute(self, format="JSON", debug=False):
  class PLUS_DIEndpoint (line 7278) | class PLUS_DIEndpoint(AsMixin, Endpoint):
    method __init__ (line 7281) | def __init__(
    method execute (line 7317) | def execute(self, format="JSON", debug=False):
  class PLUS_DMEndpoint (line 7358) | class PLUS_DMEndpoint(AsMixin, Endpoint):
    method __init__ (line 7361) | def __init__(
    method execute (line 7397) | def execute(self, format="JSON", debug=False):
  class PPOEndpoint (line 7438) | class PPOEndpoint(AsMixin, Endpoint):
    method __init__ (line 7441) | def __init__(
    method execute (line 7483) | def execute(self, format="JSON", debug=False):
  class ROCEndpoint (line 7530) | class ROCEndpoint(AsMixin, Endpoint):
    method __init__ (line 7533) | def __init__(
    method execute (line 7571) | def execute(self, format="JSON", debug=False):
  class ROCPEndpoint (line 7614) | class ROCPEndpoint(AsMixin, Endpoint):
    method __init__ (line 7617) | def __init__(
    method execute (line 7655) | def execute(self, format="JSON", debug=False):
  class ROCREndpoint (line 7698) | class ROCREndpoint(AsMixin, Endpoint):
    method __init__ (line 7701) | def __init__(
    method execute (line 7739) | def execute(self, format="JSON", debug=False):
  class ROCR100Endpoint (line 7782) | class ROCR100Endpoint(AsMixin, Endpoint):
    method __init__ (line 7785) | def __init__(
    method execute (line 7823) | def execute(self, format="JSON", debug=False):
  class RSIEndpoint (line 7866) | class RSIEndpoint(AsMixin, Endpoint):
    method __init__ (line 7869) | def __init__(
    method execute (line 7907) | def execute(self, format="JSON", debug=False):
  class RVOLEndpoint (line 7950) | class RVOLEndpoint(AsMixin, Endpoint):
    method __init__ (line 7953) | def __init__(
    method execute (line 7989) | def execute(self, format="JSON", debug=False):
  class SAREndpoint (line 8030) | class SAREndpoint(AsMixin, Endpoint):
    method __init__ (line 8033) | def __init__(
    method execute (line 8071) | def execute(self, format="JSON", debug=False):
  class SMAEndpoint (line 8114) | class SMAEndpoint(AsMixin, Endpoint):
    method __init__ (line 8117) | def __init__(
    method execute (line 8155) | def execute(self, format="JSON", debug=False):
  class SQRTEndpoint (line 8198) | class SQRTEndpoint(AsMixin, Endpoint):
    method __init__ (line 8201) | def __init__(
    method execute (line 8237) | def execute(self, format="JSON", debug=False):
  class STDDEVEndpoint (line 8278) | class STDDEVEndpoint(AsMixin, Endpoint):
    method __init__ (line 8281) | def __init__(
    method execute (line 8321) | def execute(self, format="JSON", debug=False):
  class STOCHEndpoint (line 8366) | class STOCHEndpoint(AsMixin, Endpoint):
    method __init__ (line 8369) | def __init__(
    method execute (line 8413) | def execute(self, format="JSON", debug=False):
  class STOCHFEndpoint (line 8462) | class STOCHFEndpoint(AsMixin, Endpoint):
    method __init__ (line 8465) | def __init__(
    method execute (line 8505) | def execute(self, format="JSON", debug=False):
  class STOCHRSIEndpoint (line 8550) | class STOCHRSIEndpoint(AsMixin, Endpoint):
    method __init__ (line 8553) | def __init__(
    method execute (line 8597) | def execute(self, format="JSON", debug=False):
  class SuperTrendEndpoint (line 8646) | class SuperTrendEndpoint(AsMixin, Endpoint):
    method __init__ (line 8649) | def __init__(
    method execute (line 8687) | def execute(self, format="JSON", debug=False):
  class T3MAEndpoint (line 8730) | class T3MAEndpoint(AsMixin, Endpoint):
    method __init__ (line 8733) | def __init__(
    method execute (line 8773) | def execute(self, format="JSON", debug=False):
  class TEMAEndpoint (line 8818) | class TEMAEndpoint(AsMixin, Endpoint):
    method __init__ (line 8821) | def __init__(
    method execute (line 8859) | def execute(self, format="JSON", debug=False):
  class TRANGEEndpoint (line 8902) | class TRANGEEndpoint(AsMixin, Endpoint):
    method __init__ (line 8905) | def __init__(
    method execute (line 8939) | def execute(self, format="JSON", debug=False):
  class TRIMAEndpoint (line 8978) | class TRIMAEndpoint(AsMixin, Endpoint):
    method __init__ (line 8981) | def __init__(
    method execute (line 9019) | def execute(self, format="JSON", debug=False):
  class TSFEndpoint (line 9062) | class TSFEndpoint(AsMixin, Endpoint):
    method __init__ (line 9065) | def __init__(
    method execute (line 9103) | def execute(self, format="JSON", debug=False):
  class TYPPRICEEndpoint (line 9146) | class TYPPRICEEndpoint(AsMixin, Endpoint):
    method __init__ (line 9149) | def __init__(
    method execute (line 9183) | def execute(self, format="JSON", debug=False):
  class ULTOSCEndpoint (line 9222) | class ULTOSCEndpoint(AsMixin, Endpoint):
    method __init__ (line 9225) | def __init__(
    method execute (line 9265) | def execute(self, format="JSON", debug=False):
  class VAREndpoint (line 9310) | class VAREndpoint(AsMixin, Endpoint):
    method __init__ (line 9313) | def __init__(
    method execute (line 9351) | def execute(self, format="JSON", debug=False):
  class VWAPEndpoint (line 9394) | class VWAPEndpoint(AsMixin, Endpoint):
    method __init__ (line 9397) | def __init__(
    method execute (line 9431) | def execute(self, format="JSON", debug=False):
  class WCLPRICEEndpoint (line 9470) | class WCLPRICEEndpoint(AsMixin, Endpoint):
    method __init__ (line 9473) | def __init__(
    method execute (line 9507) | def execute(self, format="JSON", debug=False):
  class WILLREndpoint (line 9546) | class WILLREndpoint(AsMixin, Endpoint):
    method __init__ (line 9549) | def __init__(
    method execute (line 9585) | def execute(self, format="JSON", debug=False):
  class WMAEndpoint (line 9626) | class WMAEndpoint(AsMixin, Endpoint):
    method __init__ (line 9629) | def __init__(
    method execute (line 9667) | def execute(self, format="JSON", debug=False):

FILE: src/twelvedata/exceptions.py
  class TwelveDataError (line 11) | class TwelveDataError(RuntimeError):
  class BadRequestError (line 15) | class BadRequestError(TwelveDataError):
  class InternalServerError (line 19) | class InternalServerError(TwelveDataError):
  class InvalidApiKeyError (line 23) | class InvalidApiKeyError(TwelveDataError):

FILE: src/twelvedata/http_client.py
  class DefaultHttpClient (line 16) | class DefaultHttpClient(object):
    method __init__ (line 17) | def __init__(self, base_url):
    method get (line 21) | def get(self, relative_url, *args, **kwargs):
    method _raise_error (line 54) | def _raise_error(error_code, message):

FILE: src/twelvedata/mixins.py
  class AsJsonMixin (line 10) | class AsJsonMixin(object):
    method as_json (line 11) | def as_json(self):
    method as_raw_json (line 23) | def as_raw_json(self):
  class AsCsvMixin (line 28) | class AsCsvMixin(object):
    method as_csv (line 29) | def as_csv(self, **kwargs):
    method as_raw_csv (line 36) | def as_raw_csv(self):
  class AsPandasMixin (line 41) | class AsPandasMixin(object):
    method as_pandas (line 42) | def as_pandas(self, **kwargs):
    method create_basic_df (line 66) | def create_basic_df(data, pd, index_column="datetime", **kwargs):
  class AsUrlMixin (line 79) | class AsUrlMixin(object):
    method as_url (line 80) | def as_url(self, **kwargs):
  class AsMixin (line 84) | class AsMixin(AsJsonMixin, AsCsvMixin, AsPandasMixin, AsUrlMixin, object):

FILE: src/twelvedata/renders.py
  class RenderContext (line 12) | class RenderContext(object):
  class ChartRender (line 20) | class ChartRender(object):
    method render (line 21) | def render(self, backend, df, **kwargs):
    method _slice (line 24) | def _slice(self, df):
    method _label (line 29) | def _label(self, ctx, col):
  class CandlestickRender (line 33) | class CandlestickRender(ChartRender):
    method __init__ (line 34) | def __init__(self, opens, highs, lows, closes, volume=None):
    method render_plotly (line 38) | def render_plotly(self, ctx, df, **kwargs):
    method render_matplotlib (line 98) | def render_matplotlib(self, ctx, df, ax, **kwargs):
  class LineRender (line 120) | class LineRender(ChartRender):
    method __init__ (line 121) | def __init__(self, *cols):
    method render_plotly (line 124) | def render_plotly(self, ctx, df, **kwargs):
    method render_matplotlib (line 138) | def render_matplotlib(self, ctx, df, ax, **kwargs):
  class PointsRender (line 150) | class PointsRender(ChartRender):
    method __init__ (line 151) | def __init__(self, *cols):
    method render_plotly (line 154) | def render_plotly(self, ctx, df, **kwargs):
    method render_matplotlib (line 169) | def render_matplotlib(self, ctx, df, ax, **kwargs):
  class HistogramRender (line 184) | class HistogramRender(ChartRender):
    method __init__ (line 185) | def __init__(self, col):
    method render_plotly (line 188) | def render_plotly(self, ctx, df, **kwargs):
    method render_matplotlib (line 202) | def render_matplotlib(self, ctx, df, ax, **kwargs):
  class FillAreaRender (line 215) | class FillAreaRender(ChartRender):
    method _prepare_bound (line 216) | def _prepare_bound(self, df, bound):
    method _extract_variables (line 225) | def _extract_variables(self, df, fill_area):
    method render_plotly (line 237) | def render_plotly(self, ctx, df, **kwargs):
    method render_matplotlib (line 269) | def render_matplotlib(self, ctx, df, ax, **kwargs):

FILE: src/twelvedata/time_series.py
  class TimeSeries (line 15) | class TimeSeries(object):
    method __init__ (line 16) | def __init__(
    method clone (line 26) | def clone(self):
    method as_json (line 34) | def as_json(self):
    method as_csv (line 86) | def as_csv(self, **kwargs):
    method as_pandas (line 108) | def as_pandas(self, **kwargs):
    method as_url (line 132) | def as_url(self, **kwargs):
    method _has_overlays (line 140) | def _has_overlays(self):
    method _count_subplots (line 143) | def _count_subplots(self):
    method _chart_title (line 154) | def _chart_title(self):
    method _generate_postfixes (line 159) | def _generate_postfixes(self):
    method as_pyplot_figure (line 172) | def as_pyplot_figure(self, figsize=(16, 8), candle_width=0.0002, df=No...
    method show_pyplot (line 253) | def show_pyplot(self, figsize=(20, 10), candle_width=0.002):
    method as_plotly_figure (line 261) | def as_plotly_figure(self, df=None):
    method show_plotly (line 329) | def show_plotly(self):
    method _with_endpoint (line 333) | def _with_endpoint(self, ep):
    method _with_price_endpoint (line 338) | def _with_price_endpoint(self, ep):
    method without_ohlc (line 343) | def without_ohlc(self):
    method with_ohlc (line 351) | def with_ohlc(self):
    method with_ad (line 361) | def with_ad(
    method with_adosc (line 426) | def with_adosc(
    method with_adx (line 502) | def with_adx(
    method with_adxr (line 571) | def with_adxr(
    method with_apo (line 640) | def with_apo(
    method with_aroon (line 720) | def with_aroon(
    method with_aroonosc (line 789) | def with_aroonosc(
    method with_atr (line 859) | def with_atr(
    method with_avgprice (line 928) | def with_avgprice(
    method with_bbands (line 992) | def with_bbands(
    method with_beta (line 1072) | def with_beta(
    method with_percent_b (line 1145) | def with_percent_b(
    method with_pivot_points_hl (line 1224) | def with_pivot_points_hl(
    method with_bop (line 1292) | def with_bop(
    method with_cci (line 1357) | def with_cci(
    method with_ceil (line 1426) | def with_ceil(
    method with_cmo (line 1495) | def with_cmo(
    method with_coppock (line 1568) | def with_coppock(
    method with_ceil (line 1645) | def with_ceil(
    method with_dema (line 1714) | def with_dema(
    method with_dx (line 1787) | def with_dx(
    method with_ema (line 1856) | def with_ema(
    method with_exp (line 1929) | def with_exp(
    method with_floor (line 1998) | def with_floor(
    method with_heikinashicandles (line 2067) | def with_heikinashicandles(
    method with_hlc3 (line 2133) | def with_hlc3(
    method with_ht_dcperiod (line 2198) | def with_ht_dcperiod(
    method with_ht_dcphase (line 2268) | def with_ht_dcphase(
    method with_ht_phasor (line 2338) | def with_ht_phasor(
    method with_ht_sine (line 2408) | def with_ht_sine(
    method with_ht_trendline (line 2478) | def with_ht_trendline(
    method with_ht_trendmode (line 2549) | def with_ht_trendmode(
    method with_ichimoku (line 2619) | def with_ichimoku(
    method with_kama (line 2699) | def with_kama(
    method with_keltner (line 2772) | def with_keltner(
    method with_kst (line 2852) | def with_kst(
    method with_linearreg (line 2943) | def with_linearreg(
    method with_linearregangle (line 3016) | def with_linearregangle(
    method with_linearregintercept (line 3089) | def with_linearregintercept(
    method with_linearregslope (line 3162) | def with_linearregslope(
    method with_ln (line 3235) | def with_ln(
    method with_log10 (line 3304) | def with_log10(
    method with_ma (line 3373) | def with_ma(
    method with_macd (line 3449) | def with_macd(
    method with_macd_slope (line 3531) | def with_macd_slope(
    method with_macdext (line 3617) | def with_macdext(
    method with_mama (line 3708) | def with_mama(
    method with_max (line 3784) | def with_max(
    method with_maxindex (line 3856) | def with_maxindex(
    method with_mcginley_dynamic (line 3928) | def with_mcginley_dynamic(
    method with_medprice (line 3995) | def with_medprice(
    method with_mfi (line 4067) | def with_mfi(
    method with_midpoint (line 4135) | def with_midpoint(
    method with_midprice (line 4208) | def with_midprice(
    method with_min (line 4277) | def with_min(
    method with_minindex (line 4349) | def with_minindex(
    method with_minmax (line 4421) | def with_minmax(
    method with_minmaxindex (line 4493) | def with_minmaxindex(
    method with_minus_di (line 4565) | def with_minus_di(
    method with_minus_dm (line 4634) | def with_minus_dm(
    method with_mom (line 4703) | def with_mom(
    method with_natr (line 4776) | def with_natr(
    method with_obv (line 4846) | def with_obv(
    method with_plus_di (line 4916) | def with_plus_di(
    method with_plus_dm (line 4985) | def with_plus_dm(
    method with_ppo (line 5054) | def with_ppo(
    method with_roc (line 5134) | def with_roc(
    method with_rocp (line 5207) | def with_rocp(
    method with_rocr (line 5281) | def with_rocr(
    method with_rocr100 (line 5354) | def with_rocr100(
    method with_rsi (line 5428) | def with_rsi(
    method with_rvol (line 5502) | def with_rvol(
    method with_sar (line 5571) | def with_sar(
    method with_sma (line 5642) | def with_sma(
    method with_sqrt (line 5716) | def with_sqrt(
    method with_stddev (line 5784) | def with_stddev(
    method with_stoch (line 5860) | def with_stoch(
    method with_stochf (line 5940) | def with_stochf(
    method with_stochrsi (line 6014) | def with_stochrsi(
    method with_supertrend (line 6097) | def with_supertrend(
    method with_t3ma (line 6168) | def with_t3ma(
    method with_tema (line 6243) | def with_tema(
    method with_trange (line 6317) | def with_trange(
    method with_trima (line 6382) | def with_trima(
    method with_tsf (line 6455) | def with_tsf(
    method with_typprice (line 6528) | def with_typprice(
    method with_ultosc (line 6592) | def with_ultosc(
    method with_var (line 6669) | def with_var(
    method with_vwap (line 6742) | def with_vwap(
    method with_wclprice (line 6807) | def with_wclprice(
    method with_willr (line 6870) | def with_willr(
    method with_wma (line 6939) | def with_wma(

FILE: src/twelvedata/utils.py
  function patch_endpoints_meta (line 12) | def patch_endpoints_meta(ctx):
  function force_use_kwargs (line 50) | def force_use_kwargs(func):
  function apply_context_defaults (line 60) | def apply_context_defaults(func):
  function convert_pandas_to_plotly (line 73) | def convert_pandas_to_plotly(df, **kwargs):
  function add_null_obj_values (line 103) | def add_null_obj_values(obj, columns) -> dict:
  function convert_collection_to_pandas (line 110) | def convert_collection_to_pandas(val, indexing_type=None):
  function convert_collection_to_pandas_multi_index (line 156) | def convert_collection_to_pandas_multi_index(val):
  function parse_interval_in_minutes (line 198) | def parse_interval_in_minutes(interval):

FILE: src/twelvedata/websocket.py
  class TDWebSocket (line 10) | class TDWebSocket:
    method __init__ (line 11) | def __init__(self, ctx):
    method set_default_logger (line 32) | def set_default_logger(self):
    method set_default_symbols (line 51) | def set_default_symbols(self):
    method set_default_events_queue (line 58) | def set_default_events_queue(self):
    method set_default_event_function (line 63) | def set_default_event_function(self):
    method connect (line 71) | def connect(self):
    method disconnect (line 88) | def disconnect(self):
    method keep_alive (line 96) | def keep_alive(self):
    method heartbeat (line 100) | def heartbeat(self):
    method refresh_websocket (line 109) | def refresh_websocket(self):
    method self_heal (line 113) | def self_heal(self):
    method on_connect (line 117) | def on_connect(self):
    method on_queue_full (line 121) | def on_queue_full(self):
    method subscribe (line 126) | def subscribe(self, symbols):
    method unsubscribe (line 135) | def unsubscribe(self, symbols):
    method reset (line 144) | def reset(self):
    method update_subscription_symbols (line 149) | def update_subscription_symbols(self):
    method normalize_symbols (line 171) | def normalize_symbols(s):
    method subscribe_event (line 175) | def subscribe_event(symbols):
    method unsubscribe_event (line 184) | def unsubscribe_event(symbols):
  class EventReceiver (line 193) | class EventReceiver(threading.Thread):
    method __init__ (line 194) | def __init__(self, client, ping_interval=15, ping_timeout=10):
    method run (line 202) | def run(self):
    method on_open (line 220) | def on_open(self, _):
    method on_close (line 224) | def on_close(self, _, close_status_code, close_msg):
    method on_error (line 229) | def on_error(self, _, error):
    method on_message (line 233) | def on_message(self, _, message):
  class EventHandler (line 243) | class EventHandler(threading.Thread):
    method __init__ (line 244) | def __init__(self, client):
    method run (line 249) | def run(self):

FILE: tests/test_client.py
  class CachedHttpClient (line 26) | class CachedHttpClient(DefaultHttpClient, object):
    method get (line 27) | def get(self, *args, **kwargs):
  function _fake_resp (line 40) | def _fake_resp(status_code):
  function _fake_json_resp (line 46) | def _fake_json_resp(json_content):
  function _init_client (line 55) | def _init_client():
  function _init_ts (line 62) | def _init_ts():
  function _init_batch_ts (line 67) | def _init_batch_ts(symbols):
  function test_get_stocks_list (line 72) | def test_get_stocks_list():
  function test_get_stock_exchanges_list (line 79) | def test_get_stock_exchanges_list():
  function test_get_forex_pairs_list (line 86) | def test_get_forex_pairs_list():
  function test_get_cryptocurrencies_list (line 93) | def test_get_cryptocurrencies_list():
  function test_get_funds_list (line 100) | def test_get_funds_list():
  function test_get_bonds_list (line 109) | def test_get_bonds_list():
  function test_get_etf_list (line 116) | def test_get_etf_list():
  function test_get_indices_list (line 123) | def test_get_indices_list():
  function test_get_technical_indicators_list (line 130) | def test_get_technical_indicators_list():
  function test_get_exchanges_list (line 136) | def test_get_exchanges_list():
  function test_symbol_search (line 143) | def test_symbol_search():
  function test_earliest_timestamp (line 149) | def test_earliest_timestamp():
  function test_market_state (line 155) | def test_market_state():
  function test_exchange_rate (line 161) | def test_exchange_rate():
  function test_currency_conversion (line 167) | def test_currency_conversion():
  function test_quote (line 173) | def test_quote():
  function test_price (line 179) | def test_price():
  function test_eod (line 185) | def test_eod():
  function test_api_usage (line 191) | def test_api_usage():
  function test_logo (line 197) | def test_logo():
  function test_profile (line 203) | def test_profile():
  function test_dividends (line 209) | def test_dividends():
  function test_dividends_calendar (line 215) | def test_dividends_calendar():
  function test_splits (line 221) | def test_splits():
  function test_splits_calendar (line 227) | def test_splits_calendar():
  function test_earnings (line 233) | def test_earnings():
  function test_statistics (line 239) | def test_statistics():
  function test_insider_transactions (line 245) | def test_insider_transactions():
  function test_income_statement (line 251) | def test_income_statement():
  function test_balance_sheet (line 257) | def test_balance_sheet():
  function test_cash_flow (line 263) | def test_cash_flow():
  function test_options_expiration (line 269) | def test_options_expiration():
  function test_options_chain (line 275) | def test_options_chain():
  function test_key_executives (line 282) | def test_key_executives():
  function test_institutional_holders (line 288) | def test_institutional_holders():
  function test_fund_holders (line 294) | def test_fund_holders():
  function test_time_series (line 300) | def test_time_series():
  function test_time_series_get_ad (line 311) | def test_time_series_get_ad():
  function test_time_series_get_adosc (line 322) | def test_time_series_get_adosc():
  function test_time_series_get_adx (line 332) | def test_time_series_get_adx():
  function test_time_series_get_adxr (line 342) | def test_time_series_get_adxr():
  function test_time_series_get_apo (line 352) | def test_time_series_get_apo():
  function test_time_series_get_aroon (line 362) | def test_time_series_get_aroon():
  function test_time_series_get_aroonosc (line 372) | def test_time_series_get_aroonosc():
  function test_time_series_get_atr (line 382) | def test_time_series_get_atr():
  function test_time_series_get_avgprice (line 392) | def test_time_series_get_avgprice():
  function test_time_series_get_bbands (line 402) | def test_time_series_get_bbands():
  function test_time_series_get_beta (line 412) | def test_time_series_get_beta():
  function test_time_series_get_percent_b (line 421) | def test_time_series_get_percent_b():
  function test_time_series_get_bop (line 431) | def test_time_series_get_bop():
  function test_time_series_get_cci (line 441) | def test_time_series_get_cci():
  function test_time_series_get_ceil (line 451) | def test_time_series_get_ceil():
  function test_time_series_get_cmo (line 461) | def test_time_series_get_cmo():
  function test_time_series_get_coppock (line 471) | def test_time_series_get_coppock():
  function test_time_series_get_dema (line 481) | def test_time_series_get_dema():
  function test_time_series_get_dx (line 491) | def test_time_series_get_dx():
  function test_time_series_get_ema (line 501) | def test_time_series_get_ema():
  function test_time_series_get_exp (line 511) | def test_time_series_get_exp():
  function test_time_series_get_floor (line 521) | def test_time_series_get_floor():
  function test_time_series_get_heikinashicandles (line 531) | def test_time_series_get_heikinashicandles():
  function test_time_series_get_hlc3 (line 541) | def test_time_series_get_hlc3():
  function test_time_series_get_ht_dcperiod (line 551) | def test_time_series_get_ht_dcperiod():
  function test_time_series_get_ht_dcphase (line 561) | def test_time_series_get_ht_dcphase():
  function test_time_series_get_ht_phasor (line 571) | def test_time_series_get_ht_phasor():
  function test_time_series_get_ht_sine (line 581) | def test_time_series_get_ht_sine():
  function test_time_series_get_ht_trendline (line 591) | def test_time_series_get_ht_trendline():
  function test_time_series_get_ht_trendmode (line 601) | def test_time_series_get_ht_trendmode():
  function test_time_series_get_ichimoku (line 611) | def test_time_series_get_ichimoku():
  function test_time_series_get_kama (line 621) | def test_time_series_get_kama():
  function test_time_series_get_keltner (line 631) | def test_time_series_get_keltner():
  function test_time_series_get_kst (line 641) | def test_time_series_get_kst():
  function test_time_series_get_linearreg (line 651) | def test_time_series_get_linearreg():
  function test_time_series_get_linearregangle (line 661) | def test_time_series_get_linearregangle():
  function test_time_series_get_linearregintercept (line 671) | def test_time_series_get_linearregintercept():
  function test_time_series_get_linearregslope (line 681) | def test_time_series_get_linearregslope():
  function test_time_series_get_ln (line 691) | def test_time_series_get_ln():
  function test_time_series_get_log10 (line 701) | def test_time_series_get_log10():
  function test_time_series_get_ma (line 711) | def test_time_series_get_ma():
  function test_time_series_get_macd (line 721) | def test_time_series_get_macd():
  function test_time_series_get_macdext (line 731) | def test_time_series_get_macdext():
  function test_time_series_get_mama (line 741) | def test_time_series_get_mama():
  function test_time_series_get_max (line 751) | def test_time_series_get_max():
  function test_time_series_get_maxindex (line 761) | def test_time_series_get_maxindex():
  function test_time_series_get_mcginley_dynamic (line 771) | def test_time_series_get_mcginley_dynamic():
  function test_time_series_get_medprice (line 781) | def test_time_series_get_medprice():
  function test_time_series_get_mfi (line 791) | def test_time_series_get_mfi():
  function test_time_series_get_midpoint (line 801) | def test_time_series_get_midpoint():
  function test_time_series_get_midprice (line 811) | def test_time_series_get_midprice():
  function test_time_series_get_min (line 821) | def test_time_series_get_min():
  function test_time_series_get_minindex (line 831) | def test_time_series_get_minindex():
  function test_time_series_get_minmax (line 841) | def test_time_series_get_minmax():
  function test_time_series_get_minmaxindex (line 851) | def test_time_series_get_minmaxindex():
  function test_time_series_get_minus_di (line 861) | def test_time_series_get_minus_di():
  function test_time_series_get_minus_dm (line 871) | def test_time_series_get_minus_dm():
  function test_time_series_get_mom (line 881) | def test_time_series_get_mom():
  function test_time_series_get_natr (line 891) | def test_time_series_get_natr():
  function test_time_series_get_obv (line 901) | def test_time_series_get_obv():
  function test_time_series_get_plus_di (line 911) | def test_time_series_get_plus_di():
  function test_time_series_get_plus_dm (line 921) | def test_time_series_get_plus_dm():
  function test_time_series_get_ppo (line 931) | def test_time_series_get_ppo():
  function test_time_series_get_roc (line 941) | def test_time_series_get_roc():
  function test_time_series_get_rocp (line 951) | def test_time_series_get_rocp():
  function test_time_series_get_rocr (line 961) | def test_time_series_get_rocr():
  function test_time_series_get_rocr100 (line 971) | def test_time_series_get_rocr100():
  function test_time_series_get_rsi (line 981) | def test_time_series_get_rsi():
  function test_time_series_get_sar (line 991) | def test_time_series_get_sar():
  function test_time_series_get_sma (line 1001) | def test_time_series_get_sma():
  function test_time_series_get_sqrt (line 1011) | def test_time_series_get_sqrt():
  function test_time_series_get_stddev (line 1021) | def test_time_series_get_stddev():
  function test_time_series_get_stoch (line 1031) | def test_time_series_get_stoch():
  function test_time_series_get_stochf (line 1041) | def test_time_series_get_stochf():
  function test_time_series_get_stochrsi (line 1051) | def test_time_series_get_stochrsi():
  function test_time_series_get_supertrend (line 1061) | def test_time_series_get_supertrend():
  function test_time_series_get_t3ma (line 1071) | def test_time_series_get_t3ma():
  function test_time_series_get_tema (line 1081) | def test_time_series_get_tema():
  function test_time_series_get_trange (line 1091) | def test_time_series_get_trange():
  function test_time_series_get_trima (line 1101) | def test_time_series_get_trima():
  function test_time_series_get_tsf (line 1111) | def test_time_series_get_tsf():
  function test_time_series_get_typprice (line 1121) | def test_time_series_get_typprice():
  function test_time_series_get_ultosc (line 1131) | def test_time_series_get_ultosc():
  function test_time_series_get_var (line 1141) | def test_time_series_get_var():
  function test_time_series_get_vwap (line 1151) | def test_time_series_get_vwap():
  function test_time_series_get_wclprice (line 1161) | def test_time_series_get_wclprice():
  function test_time_series_get_willr (line 1171) | def test_time_series_get_willr():
  function test_time_series_get_wma (line 1181) | def test_time_series_get_wma():
  function _init_chart (line 1191) | def _init_chart():
  function test_chart_json (line 1286) | def test_chart_json():
  function test_chart_csv (line 1291) | def test_chart_csv():
  function test_chart_pandas (line 1296) | def test_chart_pandas():
  function test_chart_url (line 1301) | def test_chart_url():
  function test_string_batch (line 1312) | def test_string_batch():
  function test_list_batch (line 1319) | def test_list_batch():
  function test_tuple_batch (line 1326) | def test_tuple_batch():
  function test_tuple_batch_one_symbol (line 1333) | def test_tuple_batch_one_symbol():
  function test_http_internal_server_error_response (line 1341) | def test_http_internal_server_error_response(mock_get):
  function test_http_internal_server_error_response_in_json (line 1351) | def test_http_internal_server_error_response_in_json(mock_get):
  function test_http_bad_request_error_response (line 1360) | def test_http_bad_request_error_response(mock_get):
  function test_http_bad_request_error_response_in_json (line 1370) | def test_http_bad_request_error_response_in_json(mock_get):
  function test_http_invalid_api_key_response (line 1379) | def test_http_invalid_api_key_response(mock_get):
  function test_http_invalid_api_key_response_in_json (line 1389) | def test_http_invalid_api_key_response_in_json(mock_get):
  function test_http_other_invalid_response (line 1398) | def test_http_other_invalid_response(mock_get):
  function test_http_other_invalid_response_in_json (line 1408) | def test_http_other_invalid_response_in_json(mock_get):
Condensed preview — 38 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (761K chars).
[
  {
    "path": ".coveragerc",
    "chars": 591,
    "preview": "# .coveragerc to control coverage.py\n[run]\nbranch = True\nsource = tdclient\n# omit = bad_file.py\n\n[paths]\nsource =\n    sr"
  },
  {
    "path": ".github/CONTRIBUTING.md",
    "chars": 4989,
    "preview": "# Contributing\n\nThis document describes how you can contribute to Twelve Data API. Please read it carefully.\n\n**Table of"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "chars": 842,
    "preview": "---\nname: Bug report\nabout: Report errors or unexpected behavior.\ntitle: \"[Bug]\"\nlabels: ''\nassignees: ''\n\n---\n\n**Descri"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "chars": 596,
    "preview": "---\nname: Feature request\nabout: Suggest an idea.\ntitle: \"[Feature Request]\"\nlabels: ''\nassignees: ''\n\n---\n\n**Is your fe"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/question.md",
    "chars": 94,
    "preview": "---\nname: Question\nabout: Ask a question.\ntitle: \"[Question]\"\nlabels: ''\nassignees: ''\n\n---\n\n\n"
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 189,
    "preview": "version: 2\nupdates:\n- package-ecosystem: pip\n  directory: \"/\"\n  schedule:\n    interval: daily\n  open-pull-requests-limit"
  },
  {
    "path": ".gitignore",
    "chars": 556,
    "preview": "# Temporary and binary files\n*~\n*.py[cod]\n*.so\n*.cfg\n!.isort.cfg\n!setup.cfg\n*.orig\n*.log\n*.pot\n__pycache__/*\n.cache/*\n.*"
  },
  {
    "path": ".travis.yml",
    "chars": 166,
    "preview": "dist: xenial\nlanguage: python\ncache: pip\npython:\n  - \"3.6\"\n  - \"3.7\"\ninstall:\n  - pip install pipenv\n  - pipenv install\n"
  },
  {
    "path": "AUTHORS.rst",
    "chars": 39,
    "preview": "============\nContributors\n============\n"
  },
  {
    "path": "CHANGELOG.rst",
    "chars": 73,
    "preview": "=========\nChangelog\n=========\n\nVersion 0.1\n===========\n\n- Initial commit\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "chars": 3351,
    "preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, w"
  },
  {
    "path": "LICENSE.txt",
    "chars": 1077,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2019 twelvedata\n\nPermission is hereby granted, free of charge, to any person obtain"
  },
  {
    "path": "Pipfile",
    "chars": 209,
    "preview": "[packages]\ntwelvedata = {path = \"./\",extras = [\"pandas\", \"matplotlib\", \"plotly\", \"websocket-client\", \"mplfinance\"],edita"
  },
  {
    "path": "README.md",
    "chars": 17736,
    "preview": "<p align=\"center\"><img src=\"https://res.cloudinary.com/dnz8pwg9r/image/upload/v1579110518/logo-python_pgvee0.png\" width="
  },
  {
    "path": "docs/Makefile",
    "chars": 7604,
    "preview": "# Makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line.\nSPHINXOPTS    =\nSPHINXBUILD "
  },
  {
    "path": "docs/_static/.gitignore",
    "chars": 18,
    "preview": "# Empty directory\n"
  },
  {
    "path": "docs/authors.rst",
    "chars": 41,
    "preview": ".. _authors:\n.. include:: ../AUTHORS.rst\n"
  },
  {
    "path": "docs/changelog.rst",
    "chars": 43,
    "preview": ".. _changes:\n.. include:: ../CHANGELOG.rst\n"
  },
  {
    "path": "docs/conf.py",
    "chars": 9171,
    "preview": "# -*- coding: utf-8 -*-\n#\n# This file is execfile()d with the current directory set to its containing dir.\n#\n# Note that"
  },
  {
    "path": "docs/index.rst",
    "chars": 272,
    "preview": ".. include:: ../README.rst\n\n\nContents\n========\n\n.. toctree::\n   :maxdepth: 2\n\n   License <license>\n   Authors <authors>\n"
  },
  {
    "path": "docs/license.rst",
    "chars": 67,
    "preview": ".. _license:\n\n=======\nLicense\n=======\n\n.. include:: ../LICENSE.txt\n"
  },
  {
    "path": "pyproject.toml",
    "chars": 190,
    "preview": "[build-system]\nrequires = [\"setuptools>=45,<75\", \"wheel\", \"setuptools-scm[toml]>=6.2\"]\nbuild-backend = \"setuptools.build"
  },
  {
    "path": "requirements.txt",
    "chars": 31,
    "preview": "pytimeparse\nrequests\nsetuptools"
  },
  {
    "path": "setup.cfg",
    "chars": 2456,
    "preview": "# This file is used to configure your project.\n# Read more about the various options under:\n# http://setuptools.readthed"
  },
  {
    "path": "setup.py",
    "chars": 199,
    "preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n    Setup file for twelvedata.\n    Use setup.cfg to configure your pro"
  },
  {
    "path": "src/twelvedata/__init__.py",
    "chars": 284,
    "preview": "# -*- coding: utf-8 -*-\nfrom .client import TDClient\n\ntry:\n    from ._version import version as __version__\nexcept Impor"
  },
  {
    "path": "src/twelvedata/client.py",
    "chars": 20610,
    "preview": "from .context import Context\nfrom .endpoints import (\n    CustomEndpoint,\n    StocksListEndpoint,\n    StockExchangesList"
  },
  {
    "path": "src/twelvedata/context.py",
    "chars": 892,
    "preview": "# coding: utf-8\n\n\nclass Context:\n    \"\"\"\n    Context which used by all request builders\n\n    :ivar http_client: Default "
  },
  {
    "path": "src/twelvedata/endpoints.py",
    "chars": 301144,
    "preview": "import itertools\nfrom .mixins import AsMixin\n\n\n__all__ = (\n    \"ADOSCEndpoint\",\n    \"ADEndpoint\",\n    \"ADXREndpoint\",\n  "
  },
  {
    "path": "src/twelvedata/exceptions.py",
    "chars": 338,
    "preview": "# coding: utf-8\n\n__all__ = (\n    \"TwelveDataError\",\n    \"BadRequestError\",\n    \"InternalServerError\",\n    \"InvalidApiKey"
  },
  {
    "path": "src/twelvedata/http_client.py",
    "chars": 1731,
    "preview": "# coding: utf-8\n\nfrom requests import Session\nfrom json import JSONDecodeError\n\nfrom .exceptions import (\n    BadRequest"
  },
  {
    "path": "src/twelvedata/mixins.py",
    "chars": 2837,
    "preview": "# coding: utf-8\n\nimport csv\nfrom .utils import convert_collection_to_pandas, convert_collection_to_pandas_multi_index, c"
  },
  {
    "path": "src/twelvedata/renders.py",
    "chars": 11047,
    "preview": "# coding: utf-8\n\nfrom .endpoints import *\n\nVOL_CHART_HEIGHT = 0.15\nCANDLE_WIDTH = 0.0002\nBAR_WIDTH = 0.0002\nCOLOR_UP = \""
  },
  {
    "path": "src/twelvedata/time_series.py",
    "chars": 289669,
    "preview": "# coding: utf-8\n\nimport time\nimport pytimeparse\nimport re\nimport itertools\nfrom collections import OrderedDict, Counter\n"
  },
  {
    "path": "src/twelvedata/utils.py",
    "chars": 5848,
    "preview": "# coding: utf-8\n\nimport inspect\nimport operator\nimport functools\nimport textwrap\nimport pytimeparse\n\nfrom .exceptions im"
  },
  {
    "path": "src/twelvedata/websocket.py",
    "chars": 8053,
    "preview": "import time\nimport threading\nimport json\nimport logging\nimport queue\n\nMAX_QUEUE_SIZE = 12000\n\n\nclass TDWebSocket:\n    de"
  },
  {
    "path": "tests/conftest.py",
    "chars": 38,
    "preview": "#!/usr/bin/env python\n# coding: utf-8\n"
  },
  {
    "path": "tests/test_client.py",
    "chars": 35289,
    "preview": "#!/usr/bin/env python\n# coding: utf-8\n\nimport json\nimport pytest\nfrom requests import Response\nfrom unittest.mock import"
  }
]

About this extraction

This page contains the full source code of the twelvedata/twelvedata-python GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 38 files (711.3 KB), approximately 163.6k tokens, and a symbol index with 803 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!