Skip to main content

Tests Docs License Version

pip install setuz
from setuz import SetUz

setuz = SetUz('token')

# page default = 1
# page_size default = 25
# last_tm default = 0

# get brand
brand = setuz.get_brand(page=1, page_size=25, last_tm=0)
brand_result = "BrandListSchema(count=6, next=None, prev=None, results=[BrandSchema(id=122, name='CocaCola', tm=1)])"
print(brand.results[0].name)  # CocaCola
print(brand.count)  # 6

# get measurement
measurement = setuz.get_measurement()
measurement_result = "MeasurementListSchema(count=4, next=None, prev=None, results=[MeasurementSchema(id=4, name='Штука', short_name='шт', tm=1)])"
print(measurement.results[0].name)  # Штука
print(measurement.count)  # 4

# get order
order = setuz.get_order()
order_result = "OrderListSchema(count=1, next=None, prev=None, results=[OrderSchema(id=1, tm=123456, total_price=700000.0, status='pending', order_products=[OrderProductSchema(id=1, total_price=600000.0, quantity=12, product=Product(provider_product_id=1, name='Test product'))], created_date=datetime.datetime(2021, 4, 26, 4, 28, 55, 656147))])"
print(order.count)  # 1
print(order.results[0].id)  # 1

# get category
setuz.get_category()
category_result = [{
    'id': 3,
    'name': 'Notebook',
    'photo': {
        'id': 173,
        'children': [
            {
                "id": 4,
                "name": "Acer Nitro 5",
                "children": []
            }
        ]
    }}]
print(category_result[0]['name'])  # Notebook

# create product
from setuz.schemes.product import ProductCreateSchema, ProductImagesSchema

file_id = setuz.upload_file('<file_path>')
images = ProductImagesSchema(photo_id=file_id, is_main=True)

product = ProductCreateSchema(
    provider_product_id=1,  # product_id
    category_id=3,  # category set id
    brand_id=122,  # brand set id
    measurement_id=4,  # measurement set id
    name='Iphone XL 10',
    description='Iphone GG  WP',
    price=12.5,
    barcode='123331244',
    cashback=0,
    product_images=[images]
)

result = setuz.create_product(product)
if result is True:
    print('success create')
else:
    print('error', result)

# delete product
result = setuz.delete_product(1)  # delete product  id = provider product id 
if result is True:
    print('success delete')
else:
    print('error', result)

Metadata

Release files for setuz 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for setuz 1.0.3
File Size Uploaded Provenance Actions
setuz-1.0.3.tar.gz 7.1 kB Without provenance Details for setuz-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for setuz 1.0.3
File Interpreter ABI Platform Actions
setuz-1.0.3-py3-none-any.whl Python 3 none any Details for setuz-1.0.3-py3-none-any.whl

Total release size: 15.4 kB

Release files / setuz-1.0.3.tar.gz

Download URL setuz-1.0.3.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0cccb4a7925b7b02f9fe77dc65336ef6179caec643c29d8da1704ccb6f3b0ce6
BLAKE2b-256 checksum
How to use checksums
d04b6e6a2c1bea6862079aab64527d5390c2e946e457f9e1f73106dc2dfe1bfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.7

Release files / setuz-1.0.3-py3-none-any.whl

Download URL setuz-1.0.3-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a27752ebb40cc5f793cea6e4a5587f15c166dce42343276a18350469fae278c
BLAKE2b-256 checksum
How to use checksums
f472424ce9c28f89f40e8d51a04cb161da5b1761e293bdb5743a47a64a13ffda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.7

Security for setuz 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page