Skip to main content

Package to financial data extraction with Python.

Project description

Python Invest

Python Invest Logo

Financial data extraction with Python.

The Python Invest package is based on an unofficial data extraction API from the website Investing.com. It's a package inspired by the amazing Investpy library.

:warning: This package consumes an unofficial open API and will validate the user's email before providing the data. After that, the user can consume all available services.

Python Invest its a Open Source package and Free to use, respecting the MIT License.

:book: Documentation

The oficial Documentation.

:material-list-status: Requirements

:white_check_mark: Python >= 3.10

:hammer_and_wrench: Installation

  • pip
$ pip install python-invest
  • poetry
poetry add python-invest

:chart_with_upwards_trend: Usage Examples

Getting historical BTC data:

from python_invest import Invest

inv = Invest('youremail@email.com')

data = inv.crypto.get_historical_data(
        symbol='BTC',
        from_date='2023-01-01',
        to_date='2023-02-01'
    )

The API can send a verification link to your email, it's a security measure you won't be charged for anything. If this happens, you will receive an error similar to this:

Traceback (most recent call last):
 File "...", line 5, in <module>
    data = inv.crypto.get_historical_data(symbol='BTC', from_date='2023-01-01', to_date='2023-02-01')
    ...
PermissionError: The Scrapper API sent to your email address the verification link. Please verify your email before run the code again.

If you get this error: Just open your email box and click on the verification link.

The email would be a equal this:

Verification Email Link

After that, you can run the code:

data = inv.crypto.get_historical_data(
        symbol='BTC',
        from_date='2023-01-01',
        to_date='2023-02-01'
    )

print(data)
      Price      Open      High       Low     Vol Change        Date
0  16,674.3  16,618.4  16,766.9  16,551.0  136027   0.34  01/02/2023
1  16,618.4  16,537.5  16,621.9  16,499.7  107837   0.49  01/01/2023

The default output is the Pandas DataFrame.

:keyboard: CLI

pinv --help

Example:

pinv crypto historical BTC --date-in '2023-01-01' --date-out '2023-04-01' --time-frame 'Monthly'
                            TABLE OF HISTORICAL DATA
┏━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━┓
┃ Price    ┃ Open     ┃ High     ┃ Low      ┃ Vol     ┃ Change ┃ Date       ┃
┡━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━┩
│ 23,130.5 │ 23,124.7 │ 25,236.8 │ 21,418.7 │ 9094707 │ 0.02   │ 02/01/2023 │
│ 23,125.1 │ 16,537.5 │ 23,952.9 │ 16,499.7 │ 8976036 │ 39.83  │ 01/01/2023 │
└──────────┴──────────┴──────────┴──────────┴─────────┴────────┴────────────┘

:computer: Social Medias

:technologist: Author


@clcostaf

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-invest-0.2.1a0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

python_invest-0.2.1a0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file python-invest-0.2.1a0.tar.gz.

File metadata

  • Download URL: python-invest-0.2.1a0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.5 Windows/10

File hashes

Hashes for python-invest-0.2.1a0.tar.gz
Algorithm Hash digest
SHA256 7d627d9eb8fbdc8c0c6baa59ee6dedf7d18f85e3393d2901ee5b12f2b202fe0d
MD5 d494831a61650f449ccfd1adcc73ebae
BLAKE2b-256 c52f67ea1f3dc89e2f2337b20b093cd4bfc77571b132977eded044dfc3e6b80d

See more details on using hashes here.

File details

Details for the file python_invest-0.2.1a0-py3-none-any.whl.

File metadata

  • Download URL: python_invest-0.2.1a0-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.5 Windows/10

File hashes

Hashes for python_invest-0.2.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6aa83b9d5ef4830a91405124a7b2a291f9beb389832daac9ddc816b42d4d78d
MD5 8442f9765236b945c759ecf53487f4e5
BLAKE2b-256 66f366e603626d89d01cd2cca7d7561c53428e2d1c9a4a3d81d108c2796accf1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page