Skip to main content

Unofficial Fennel.com Invest API written in Python Requests

Project description

Unofficial Fennel Invest API

This is an unofficial API for Fennel.com. It is a simple Python wrapper around the Fennel.com GraphQL API. It is not affiliated with Fennel.com in any way.

Fennel does everything via GraphQL, so yes, this is very slow.

This is still a work in progress, so it will have bugs and missing features. Please feel free to contribute!

Installation

pip install fennel-invest-api

Usage: Logging In

from fennel_invest_api import Fennel

fennel = Fennel()
fennel.login(
    email="your-email@email.com",
    wait_for_2fa=True # When logging in for the first time, you need to wait for email 2FA
)

If you'd like to handle the 2FA yourself programmatically instead of waiting for input(), you can call it with wait_for_2fa=False, catch the 2FA exception, then call it again with the 2FA code:

fennel.login(
    email="your-email@email.com",
    wait_for_2fa=False
    code="123456" # Should be six-digit integer from email
)

Usage: Get Stock Holdings

positions = fennel.get_stock_holdings()
for position in positions:
    print(position)

Usage: Get Portfolio

portfolio = fennel.get_portfolio_summary()
print(portfolio)

Usage: Placing Orders

order = fennel.place_order(
    symbol="AAPL",
    quantity=1,
    side="buy", # Must be "buy" or "sell"
    price="market" # Only market orders are supported for now
)
print(order)

Contributing

Found or fixed a bug? Have a feature request? Feel free to open an issue or pull request!

Enjoying the project? Feel free to Sponsor me on GitHub or Ko-fi!

Sponsor ko-fi

DISCLAIMER

DISCLAIMER: I am not a financial advisor and not affiliated with Fennel.com. Use this tool at your own risk. I am not responsible for any losses or damages you may incur by using this project. This tool is provided as-is with no warranty.

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

fennel_invest_api-1.0.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

fennel_invest_api-1.0.2-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file fennel_invest_api-1.0.2.tar.gz.

File metadata

  • Download URL: fennel_invest_api-1.0.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for fennel_invest_api-1.0.2.tar.gz
Algorithm Hash digest
SHA256 588e093644a8efd9b6b1df7e8e2d56f2e87e6bde196cbecc8b802678cba3f303
MD5 a0f7303a9b3412a6dd1cb253a91d3ebb
BLAKE2b-256 8d6673963cd11f4dd48a7b63ec9a37047e9e8f50334981ee9bfef8767a064683

See more details on using hashes here.

File details

Details for the file fennel_invest_api-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for fennel_invest_api-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 49da1857cb1f3e07ec1c22ca4140570b099755ed3a0b1e2ba515d9833c83c116
MD5 140894df56639d4635c9b062e47a26ce
BLAKE2b-256 8888364410ead73f6aec9a2d1ddda4d0c2e957aa915efc62d9c9d25bc5a7f78e

See more details on using hashes here.

Supported by

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