Build your e-commerce ea(a)sily
Project description
Environemnt As A Software
Build an environment with a database and a REST API.
Requirements
- Python 3.12
- PostgreSQL 13.4
- Redis 6.2.6 (optional but recommended)
Initial Setup
Create a database in PostgreSQL:
create database database_name;
Create a virtual environment and install the dependencies:
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
Set the environment variables.
POSTGRES_URI=<SQL_DATABASE_URI>
# macOS only
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
Initialize alembic:
# alembic_init.py
from eaasy.extensions.migration import init
from argparse import ArgumentParser
def get_arguments() -> dict:
parser = ArgumentParser(description='Alembic migration helper')
parser.add_argument('sql_url', metavar='sql_url', type=str, help='SQLAlchemy URL')
parser.add_argument('--path', '-p', metavar='path', type=str, help='Alembic path', default='src/alembic')
args = parser.parse_args()
if not args.sql_url:
raise Exception('SQLAlchemy URL is required')
return args
if __name__ == '__main__':
args = get_arguments()
init(args.sql_url, args.path)
Launch the script to build the alembic folder:
python alembic_init.py <SQL_DATABASE_URI> # --path src/alembic (optional)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
eaasy-0.1.4.tar.gz
(7.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
eaasy-0.1.4-py3-none-any.whl
(6.5 kB
view details)
File details
Details for the file eaasy-0.1.4.tar.gz.
File metadata
- Download URL: eaasy-0.1.4.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e3ba48ee77f37c557552e06b35ecca03206a2b8ed5388997b9d9d20044403a7
|
|
| MD5 |
fd2c686db6eac26a2ac2d006d4bd58b9
|
|
| BLAKE2b-256 |
8256586f0c6aa80b38d637bbf15931bb65a3b8496df1d1b8470bbf04b4560539
|
File details
Details for the file eaasy-0.1.4-py3-none-any.whl.
File metadata
- Download URL: eaasy-0.1.4-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f078e67432f65f214ce4de515d693774e6bd0ce7f6471b440232e20a64a39a6
|
|
| MD5 |
7b6ada4fc5ca1b3bcca1be7d73093a36
|
|
| BLAKE2b-256 |
a6af628f42f6dccd028554c7883c41c1437287b3b01879b27783016ded96be7b
|