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:
AutoDaoandDBfor MSSQL (pyodbc) with parameterized queries. - NopCommerce helpers:
NopTool,NopData,NopQueryfor product, category, picture, manufacturer, and related Nop entities. - CLI:
nopcommercecommand 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_DSNfor 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
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
File details
Details for the file pynop_cli-0.1.1.tar.gz.
File metadata
- Download URL: pynop_cli-0.1.1.tar.gz
- Upload date:
- Size: 24.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b8d4617efca5eea8ad787b07f5f6a8821cb272f391d218b9aac235cbf9ba2a1
|
|
| MD5 |
8791a153bc4d4d08c932704619dd2320
|
|
| BLAKE2b-256 |
e6e97766a973718a038f5a725e1e7e859c009c456ae1d9fa17a7bfd224b97ad6
|
File details
Details for the file pynop_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pynop_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 27.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69bd0b2940ae991e3deec45f57d6d2602a1ba685ae4dd79faf18ccf28fae61ef
|
|
| MD5 |
3ad9ccf5de6bf9fba544c19890af1f64
|
|
| BLAKE2b-256 |
632c7f4bfbedf40007880cf6f517b63ab5def76d010cc1aff7e336b4357995b2
|