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.4.tar.gz (25.1 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.4-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pynop_cli-0.1.4.tar.gz
  • Upload date:
  • Size: 25.1 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.4.tar.gz
Algorithm Hash digest
SHA256 a0c80d6a4c52e0935c6645b6fc4b46287e8890d867912bb10f9f2dc60c8f64be
MD5 2e4dce3d912b0d483d015c062047fbc4
BLAKE2b-256 1f0ec76d91dde7e292b557ae1f23bba24fa9022cd30909f4ab22fdffe066da8f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pynop_cli-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 27.7 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2d1882657e20ce1b7fc9ebe03688f544292348905437211f4c46f37e78dd02c0
MD5 d88e6c1320272769836b92fefeff0d84
BLAKE2b-256 ccdc901fae626711f9dc4ff2749f8d6203d98a9f5f91bc6387a40f97f3446ed1

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