Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lehiboumt/financepython

Python API for finance done with fast API and PostgreSQL, SQLAlchemy as the ORM and Pydantic for schema validation
https://github.com/lehiboumt/financepython

Last synced: about 2 months ago
JSON representation

Python API for finance done with fast API and PostgreSQL, SQLAlchemy as the ORM and Pydantic for schema validation

Awesome Lists containing this project

README

        

# installation
install Python, version 3.12.6

install PostgreSQL 16.4 with PgBouncer, PgAdmin and PgAgent

navigate to the project folder

create VM: python -m venv env

activate VM: .\env\Scripts\activate

deactive VM: deactivate

install requirements: pip install -r requirements.txt

# run and test
run the application: uvicorn app.main:app --reload

test a route with the swagger from fastAPI: http://127.0.0.1:8000/docs

example on how to use a curl to test a route:

- for CMD: curl -X GET "http://127.0.0.1:8000/items/0"

- for powershell: curl.exe -X GET "http://127.0.0.1:8000/items/0"

# database
use PgAdmin to manage the database

create a new database: CREATE DATABASE mydatabase;

create a new user: CREATE USER myuser WITH PASSWORD 'mypassword';

grant privileges: GRANT ALL PRIVILEGES ON DATABASE mydatabase TO myuser;