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.3.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.3-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pynop_cli-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 99f050e4b7eeaf1c525e1ed90c10b3c8d3025658c91d7b7a4806fa005430166a
MD5 a8679de6300bb0c4b5b94d140255beb6
BLAKE2b-256 725e1560ac3f60231e7eefeac27c5d4f7d8921dbe711bae7dfb47975fd1fc547

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pynop_cli-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 27.9 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 176926451b52bd70f8313265cf8e1397959ba1ed1452c8d1b965481f6d721512
MD5 3c893c56689e93c49366cae3c85d9c5b
BLAKE2b-256 d8860456921da21f37ebd6d9fbd0a94189f2746410c68019a23445553e3aa8e7

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