Skip to main content

Python NopCommerce CLI and DB access (MSSQL/pyodbc)

Project description

pynop-cli

Python NopCommerce CLI and database access for MSSQL (pyodbc). Extracted from the sync project for standalone use.

Features

  • DB layer: AutoDao and DB for MSSQL (pyodbc) with parameterized queries.
  • NopCommerce helpers: NopTool, NopData, NopQuery for product, category, picture, manufacturer, and related Nop entities.
  • CLI: nopcommerce command for quick queries and inspections.

Installation

pip install -e .
# or from PyPI (when published): pip install pynop-cli

Requires ODBC Driver 17 for SQL Server (or compatible) and a working MSSQL instance.

Configuration

Connection is via a config dict or environment variables.

Config dict (e.g. when used from another app):

from pynop import AutoDao, NopTool, NopData

config = {
    "db_engine": "MSSQL",
    "db_server": "your-server",
    "db_name": "NOPCommerce",
    "db_username": "sa",
    "db_password": "secret",
}
dao = AutoDao(config)
# Optional: set as default for NopTool
NopTool.set_dao(dao)

Environment variables (for CLI or standalone scripts):

  • NOP_DB_SERVER, NOP_DB_NAME, NOP_DB_USERNAME, NOP_DB_PASSWORD
  • Or NOP_DB_DSN for DSN-based connection.

CLI

nopcommerce product get-by-sku MY-SKU
nopcommerce product list --limit 10
nopcommerce ping

Use from sync project

In the sync repo, install this package and import shared modules directly from pynop.core (for example from pynop.core.db import AutoDao). The former sync/src/core modules are now housed in this package under pynop/core.

License

MIT

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

pynop_cli-0.1.2.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

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

pynop_cli-0.1.2-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file pynop_cli-0.1.2.tar.gz.

File metadata

  • Download URL: pynop_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for pynop_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f2263202be4eb1b8670de9c8076c97780cc958aec33113170ae2d8d299ac79c3
MD5 a5ed06509d8d7c994d1b6bd86409312c
BLAKE2b-256 6943886422f6ec94aa440c0d308065cc0dc895e375d2d70c4775f6bb1b6c7bc6

See more details on using hashes here.

File details

Details for the file pynop_cli-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pynop_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for pynop_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c617cda2411762b6ecab4a5ba3eceebdcf792c7114fc085b7410781dbfc6824c
MD5 785cb683ee43bb771d47066947d6ca0a
BLAKE2b-256 c37dc1008e8c1ace43437e510e5d3fcf1b42a67faa123deadf9ed95c665f8f7a

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