Metadata-Version: 2.1
Name: ejtraderDB
Version: 1.0.4
Summary: SQlite and QuestDB
Home-page: https://ejtraderDB.readthedocs.io/
Download-URL: https://ejtrader.com
Author: Emerson Pedroso
Author-email: support@ejtrader.com
License: MIT License
Project-URL: Bug Reports, https://github.com/ejtraderLabs/ejtraderDB/issues
Project-URL: Source, https://github.com/ejtraderLabs/ejtraderDB
Project-URL: Documentation, https://ejtrader.readthedocs.io/
Keywords: metatrader,f-api,historical-data,financial-data,stocks,funds,etfs,indices,currency crosses,bonds,commodities,crypto currencies
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: msgpack (>=0.5.6)
Requires-Dist: pandas (==1.3.4)
Requires-Dist: requests (==2.26.0)
Requires-Dist: sqlvalidator (==0.0.17)

![Pypi Publish](https://github.com/ejtraderLabs/ejtraderDB/actions/workflows/python-publish.yml/badge.svg)
[![Release](https://img.shields.io/github/v/release/ejtraderLabs/ejtraderDB)](https://github.com/ejtraderLabs/ejtraderDB/releases/latest)  [![License](https://img.shields.io/github/license/ejtraderLabs/ejtraderDB)](https://github.com/ejtraderLabs/ejtraderDB/blob/master/LICENSE)

## Install requirements:

```sh
pip install ejtraderDB - U
```

### Description for DictSQlite

## import

```python
from ejtraderDB import DictSQlite

api = DictSQLite('history',multithreading=True)


# save to sqlite
api["keyname"] = dataFrame


# read from sqlite

dataFrame = api['keyname']

print(dataFrame)
```


## Description for QuestDb

API wrapper following the basic API requirements of QuestDB described [here](https://questdb.io/docs/reference/api/rest/).

## Import

```python
from ejtraderDB import QuestDB

api = QuestDB()
```

## Methods

### /imp - Import

*`/imp` streams tabular text data directly into a table. It supports CSV, TAB and pipe (`|`) delimited inputs with optional headers. There are no restrictions on data size. Data types and structures are detected automatically, without additional configuration. In some cases, additional configuration can be provided to improve the automatic detection as described in [user-defined schema](https://questdb.io/docs/reference/api/rest/#user-defined-schema).*

```py
res = api.imp(filename="test.csv", name="ejtraderDB")
```

> See `qdb_api.py` or [API reference](https://questdb.io/docs/reference/api/rest/#imp---import-data) for all possible parameters.

### /exec - Execute queries

*`/exec` compiles and executes the SQL query supplied as a parameter and returns a JSON response.*

```py
res = api.exec(query="SELECT * FROM ejtraderDB")
```

**SQL queries will be verified via `sqlvalidator==0.0.17` there might be issues with QuestDB SQL Syntax.**

> See `qdb_api.py` or [API reference](https://questdb.io/docs/reference/api/rest/#exec---execute-queries) for all possible parameters.

### /exp - Export data

*This endpoint allows you to pass url-encoded queries but the request body is returned in a tabular form to be saved and reused as opposed to JSON.*

```py
res = api.exp(query="SELECT * FROM ejtraderDB")
```

## you can now choose between the following output formats:
- CSV: `qdb.exp(query="...", output="csv")`
- DataFrame: `qdb.exp(query="...", output="pandas"`

> See `qdb_api.py` or [API reference](https://questdb.io/docs/reference/api/rest/#exp---export-data) for all possible parameters.
