Skip to main content

MarketDatabaseManager

MarketDatabaseManager is your complete solution for interacting with financial assets using a Docker-optimized REST API backed by PostgreSQL.

🔥 Features

  • Docker-Optimized REST API: Efficiently interact with a PostgreSQL database stored in the local PostgreSQL app, all via a REST API encapsulated within a Docker container.
  • Comprehensive Asset Categorization: Features detailed tables designed specifically for various asset classes, such as equity, cryptocurrency, and commodity futures.
  • Asset-Specific Bar Data Tables: Each asset class has its own dedicated bar data table, allowing for detailed financial tracking and analysis.
  • User-Friendly: Intuitive methods are at your disposal to add, modify, or delete financial asset data with ease.
  • Integrated Client Library: The provided client library facilitates seamless interactions with the API. It acts as a bridge to the local PostgreSQL database, ensuring consistency and efficiency in handling data across all supported asset classes.

🚀 Installation

1️⃣ Install PostgreSQL

2️⃣ Install Docker

3️⃣ Create Database

psql -U postgres;

CREATE DATABASE <database_name>;

4️⃣ Clone the repository

git clone https://github.com/anthonyb8/MarketDatabaseManager.git

5️⃣ Set up your environment

Create a .env file in the api directory and insert your database credentials:

DATABASE_URL = "postgresql://<user>:<password>@host.docker.internal/<database_name>"

⚠️ Note: If Docker isn't running locally, replace host.docker.internal with the appropriate host.

6️⃣ Dockerize

From the root MarketDatabaseManager directory, run the following commands to build and start the Docker container:

docker-compose build

docker-compose up -d

7️⃣ Install the client library

While in the root directory of your project (not the MarketDatabaseManager directory), execute the following commands to set up the virtual environment and install the client library:

python3.10 -m venv venv

source venv/bin/activate

pip install MarketDataManager

📌 Examples

Create Database Tables

from MarketDataManager import Client

client = Client()
client.create_tables()

Create Asset

new_asset = {
    "ticker" : "AAPL", 
    "type" : "equity"
}
client.create_asset(asset = new_asset)

Add Asset Details

asset_details = {
    'company_name' : 'Apple Inc.',
    'exchange' : 'NASDAQ',
    'currency' :  'USD',
    'industry' : 'Technology',
    'description' : 'Equity for Apple Inc. a technologies producer.',
    'market_cap' : 100000,
    'shares_outstanding' : 100000
}
client.create_asset_details(ticker="AAPL", asset_type="equity",data=asset_details)

Add Asset Bardata

asset_bardata =  [
    {
        'date' : '2023-01-01',
        'open': 100.0,
        'close': 101.0,
        'high': 102.0,
        'low': 103,
        'volume': 109,
        'adjusted_close' : 1100.0
    }, 
    {
        'date' : '2023-01-02',
        'open': 100.0,
        'close': 101.0,
        'high': 102.0,
        'low': 103,
        'volume': 109,
        'adjusted_close' : 1100.0
    }
]
client.create_bardata(ticker="AAPL", asset_type="equity", data=asset_bardata)

📜 License

This project is licensed under the Apache License, Version 2.0. Get a copy of the License here.

Metadata

Release files for MarketDataManager 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for MarketDataManager 0.2
File Size Uploaded Provenance Actions
MarketDataManager-0.2.tar.gz 9.5 kB Without provenance Details for MarketDataManager-0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for MarketDataManager 0.2
File Interpreter ABI Platform Actions
MarketDataManager-0.2-py3-none-any.whl Python 3 none any Details for MarketDataManager-0.2-py3-none-any.whl

Total release size: 23.6 kB

Release files / MarketDataManager-0.2.tar.gz

Download URL MarketDataManager-0.2.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
94d641d26403aa303ea061829d4b096c826d0490d516897fa395c918341275df
BLAKE2b-256 checksum
How to use checksums
b6c02401fa2b94f493a3984e54a681bed36ea6de8d14eea743219d0cd7513dc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.8

Release files / MarketDataManager-0.2-py3-none-any.whl

Download URL MarketDataManager-0.2-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55be58ba5a62fcd0341d63290375bff08f21e486bf9fc878fdf6884f6f667127
BLAKE2b-256 checksum
How to use checksums
ab8b218c76c1a483e3ddfdfbad05189784af838ff4da373d33aa35eebbf45335
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.8

Security for MarketDataManager 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page