stockinfoain1001


Namestockinfoain1001 JSON
Version 1.0.2 PyPI version JSON
download
home_pageNone
SummaryStock information analysis package
upload_time2024-08-13 17:02:52
maintainerNone
docs_urlNone
authorAbdurrahman Javat
requires_pythonNone
licenseNone
keywords python stock finance sma rsi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# StockInfo

StockInfo is a Python package for loading historical stock data, calculating Simple Moving Averages (SMA) and Relative Strength Index (RSI), and writing the results to CSV files.

## Installation

You can install StockInfo using pip:

```bash
pip install stockinfoain1001
```
## Usage
### Loading historical data:
```python
from stockinfoain1001 import StockInfo

# Create an instance of the StockInfo class
stock_info = StockInfo()

# Load historical data from a CSV file (default: "orcl.csv" in the 'data' directory)
stock_info.load_data()

# Access the loaded data
data = stock_info.Data
```
### Calculating Simple Moving Averages (SMA):
```python
# Calculate SMA with a specified window size (default: 5)
sma_values = stock_info.calculate_sma(window_size=10)

# Access the calculated SMA values
print(sma_values)
```
### Calculating Relative Strength Index (RSI):
```python
# Calculate RSI with a specified window size (default: 14)
rsi_values = stock_info.calculate_rsi(window_size=14)

# Access the calculated RSI values
print(rsi_values)
```
### Writing Results to CSV:
```python
# Write SMA results to a CSV file
sma_header = ['Date', 'Close', 'SMA']
sma_data = [(stock_info.Data[i]["Date"], stock_info.Data[i]['Close'], sma) for i, sma in enumerate(sma_values)]
stock_info.write_file("sma_results.csv", sma_header, sma_data)

# Write RSI results to a CSV file
rsi_header = ['Date', 'Close', 'RSI']
rsi_data = [(stock_info.Data[i]["Date"], stock_info.Data[i]['Close'], rsi) for i, rsi in enumerate(rsi_values)]
stock_info.write_file("rsi_results.csv", rsi_header, rsi_data)
```
## Examples
### Basic Usage:
```python
from stockinfoain1001 import StockInfo

# Load historical data
stock_info = StockInfo()
stock_info.load_data()

# Calculate SMA and write results to CSV
sma_values = stock_info.calculate_sma(window_size=5)
sma_header = ['Date', 'Close', 'SMA']
sma_data = [(stock_info.Data[i]["Date"], stock_info.Data[i]['Close'], sma) for i, sma in enumerate(sma_values)]
stock_info.write_file("sma_results.csv", sma_header, sma_data)

# Calculate RSI and write results to CSV
rsi_values = stock_info.calculate_rsi(window_size=14)
rsi_header = ['Date', 'Close', 'RSI']
rsi_data = [(stock_info.Data[i]["Date"], stock_info.Data[i]['Close'], rsi) for i, rsi in enumerate(rsi_values)]
stock_info.write_file("rsi_results.csv", rsi_header, rsi_data)
```
### Custom Data File and Output Directory:
```python
from stockinfoain1001 import StockInfo

# Load historical data
stock_info = StockInfo()
stock_info.load_data()

# Calculate SMA and write results to CSV
sma_values = stock_info.calculate_sma(window_size=5)
sma_header = ['Date', 'Close', 'SMA']
sma_data = [(stock_info.Data[i]["Date"], stock_info.Data[i]['Close'], sma) for i, sma in enumerate(sma_values)]
stock_info.write_file("sma_results.csv", sma_header, sma_data)

# Calculate RSI and write results to CSV
rsi_values = stock_info.calculate_rsi(window_size=14)
rsi_header = ['Date', 'Close', 'RSI']
rsi_data = [(stock_info.Data[i]["Date"], stock_info.Data[i]['Close'], rsi) for i, rsi in enumerate(rsi_values)]
stock_info.write_file("rsi_results.csv", rsi_header, rsi_data)
```
## Contributing
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please create an issue or submit a pull request.

## Licence
This project is licensed under the MIT License

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "stockinfoain1001",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python, stock, finance, SMA, RSI",
    "author": "Abdurrahman Javat",
    "author_email": "<abdurrahman.javat@bahcesehir.edu.tr>",
    "download_url": "https://files.pythonhosted.org/packages/43/15/c5d4abd2c26959f1ce8761b9f7bf85eaeb0ecf91f0695a5f95abfedb36f9/stockinfoain1001-1.0.2.tar.gz",
    "platform": null,
    "description": "\n# StockInfo\n\nStockInfo is a Python package for loading historical stock data, calculating Simple Moving Averages (SMA) and Relative Strength Index (RSI), and writing the results to CSV files.\n\n## Installation\n\nYou can install StockInfo using pip:\n\n```bash\npip install stockinfoain1001\n```\n## Usage\n### Loading historical data:\n```python\nfrom stockinfoain1001 import StockInfo\n\n# Create an instance of the StockInfo class\nstock_info = StockInfo()\n\n# Load historical data from a CSV file (default: \"orcl.csv\" in the 'data' directory)\nstock_info.load_data()\n\n# Access the loaded data\ndata = stock_info.Data\n```\n### Calculating Simple Moving Averages (SMA):\n```python\n# Calculate SMA with a specified window size (default: 5)\nsma_values = stock_info.calculate_sma(window_size=10)\n\n# Access the calculated SMA values\nprint(sma_values)\n```\n### Calculating Relative Strength Index (RSI):\n```python\n# Calculate RSI with a specified window size (default: 14)\nrsi_values = stock_info.calculate_rsi(window_size=14)\n\n# Access the calculated RSI values\nprint(rsi_values)\n```\n### Writing Results to CSV:\n```python\n# Write SMA results to a CSV file\nsma_header = ['Date', 'Close', 'SMA']\nsma_data = [(stock_info.Data[i][\"Date\"], stock_info.Data[i]['Close'], sma) for i, sma in enumerate(sma_values)]\nstock_info.write_file(\"sma_results.csv\", sma_header, sma_data)\n\n# Write RSI results to a CSV file\nrsi_header = ['Date', 'Close', 'RSI']\nrsi_data = [(stock_info.Data[i][\"Date\"], stock_info.Data[i]['Close'], rsi) for i, rsi in enumerate(rsi_values)]\nstock_info.write_file(\"rsi_results.csv\", rsi_header, rsi_data)\n```\n## Examples\n### Basic Usage:\n```python\nfrom stockinfoain1001 import StockInfo\n\n# Load historical data\nstock_info = StockInfo()\nstock_info.load_data()\n\n# Calculate SMA and write results to CSV\nsma_values = stock_info.calculate_sma(window_size=5)\nsma_header = ['Date', 'Close', 'SMA']\nsma_data = [(stock_info.Data[i][\"Date\"], stock_info.Data[i]['Close'], sma) for i, sma in enumerate(sma_values)]\nstock_info.write_file(\"sma_results.csv\", sma_header, sma_data)\n\n# Calculate RSI and write results to CSV\nrsi_values = stock_info.calculate_rsi(window_size=14)\nrsi_header = ['Date', 'Close', 'RSI']\nrsi_data = [(stock_info.Data[i][\"Date\"], stock_info.Data[i]['Close'], rsi) for i, rsi in enumerate(rsi_values)]\nstock_info.write_file(\"rsi_results.csv\", rsi_header, rsi_data)\n```\n### Custom Data File and Output Directory:\n```python\nfrom stockinfoain1001 import StockInfo\n\n# Load historical data\nstock_info = StockInfo()\nstock_info.load_data()\n\n# Calculate SMA and write results to CSV\nsma_values = stock_info.calculate_sma(window_size=5)\nsma_header = ['Date', 'Close', 'SMA']\nsma_data = [(stock_info.Data[i][\"Date\"], stock_info.Data[i]['Close'], sma) for i, sma in enumerate(sma_values)]\nstock_info.write_file(\"sma_results.csv\", sma_header, sma_data)\n\n# Calculate RSI and write results to CSV\nrsi_values = stock_info.calculate_rsi(window_size=14)\nrsi_header = ['Date', 'Close', 'RSI']\nrsi_data = [(stock_info.Data[i][\"Date\"], stock_info.Data[i]['Close'], rsi) for i, rsi in enumerate(rsi_values)]\nstock_info.write_file(\"rsi_results.csv\", rsi_header, rsi_data)\n```\n## Contributing\nContributions are welcome! If you encounter any issues or have suggestions for improvements, please create an issue or submit a pull request.\n\n## Licence\nThis project is licensed under the MIT License\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Stock information analysis package",
    "version": "1.0.2",
    "project_urls": null,
    "split_keywords": [
        "python",
        " stock",
        " finance",
        " sma",
        " rsi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d52b7b685edaa1b1020d03af1530df4488dd3474b39705a5455efed19f6e185c",
                "md5": "71f6e299782774b9886b3ed74b7219f1",
                "sha256": "a1e1820f7e1153305257c6ae7606a90db8d36864e8ae5211ec08e4e8a87e6e44"
            },
            "downloads": -1,
            "filename": "stockinfoain1001-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "71f6e299782774b9886b3ed74b7219f1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4281,
            "upload_time": "2024-08-13T17:02:51",
            "upload_time_iso_8601": "2024-08-13T17:02:51.013076Z",
            "url": "https://files.pythonhosted.org/packages/d5/2b/7b685edaa1b1020d03af1530df4488dd3474b39705a5455efed19f6e185c/stockinfoain1001-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4315c5d4abd2c26959f1ce8761b9f7bf85eaeb0ecf91f0695a5f95abfedb36f9",
                "md5": "88997b09f8bbc657c26e9fe5d14512e6",
                "sha256": "6608ff19bb8862afa642528aff1319f06ac73dad228dd47bfe9dda000e5f5c22"
            },
            "downloads": -1,
            "filename": "stockinfoain1001-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "88997b09f8bbc657c26e9fe5d14512e6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3724,
            "upload_time": "2024-08-13T17:02:52",
            "upload_time_iso_8601": "2024-08-13T17:02:52.574207Z",
            "url": "https://files.pythonhosted.org/packages/43/15/c5d4abd2c26959f1ce8761b9f7bf85eaeb0ecf91f0695a5f95abfedb36f9/stockinfoain1001-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-13 17:02:52",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "stockinfoain1001"
}
        
Elapsed time: 0.30853s