Skip to main content

Python client library and CLI for Smooth Core (CNC tool-data sync).

Project description

loobric-smooth

Python client for Smooth Core — the library and CLI for synchronizing CNC tool data. It speaks only the public REST API and depends on nothing from the server.

New in v0.2.0 — smooth import. Stop re-typing tool data. One command auto-detects the format and turns a vendor export into catalog records on your server: DIN 4000 (CSV + XML 2013/2016), STEP P21, GTC packages (ISO 13399), SolidCAM, and hyperMILL. Every imported field keeps its source, and the raw payload is preserved verbatim so nothing is lost or guessed. GTC packages also carry the tool's 3D STEP models and images, uploaded as canonical media on servers whose media backend is enabled. See docs/IMPORTERS_PLAN.md.

The importable library (smooth_client.Client) and the smooth CLI are both here, ported from the old single-file loobric.py — see docs/adr/0001-extract-loobric-smooth.md.

Install

pip install loobric-smooth   # library + CLI + every bundled importer — stdlib only, no deps

Everything ships in the base install. The library, the smooth CLI, and all of today's importers (DIN 4000, STEP P21, GTC, SolidCAM, hyperMILL) are standard-library only, so the package stays vendorable and runs in constrained interpreters. The optional [importers] extra is reserved for future formats that need heavier parsers; no bundled importer requires it yet.

Library

from smooth_client import Client, NotFound

c = Client(base_url="http://nas:8000", api_key="...")   # solo mode: omit api_key
for s in c.list_tool_sets():
    print(s)

Every method returns parsed data and raises a SmoothClientError subclass (NotFound, AuthRequired, HTTPError, ConnectionFailed) on failure — it never prints or exits, so callers handle failure themselves.

CLI

smooth <verb> is the universal command-line client (the role the old loobric command served). See the CLI reference and walkthrough.

smooth --help
smooth list-machines
smooth create-record --from-catalog B201 --name "1/4 downcut"

Importing tool data

smooth import reads a vendor export, detects the format, and creates catalog records on the server. Use --dry-run to see exactly what would be created without sending anything:

smooth import tools.csv --dry-run        # DIN 4000 CSV — preview only
smooth import tools.xml                   # DIN 4000 / SolidCAM / hyperMILL (by XML root)
smooth import catalog.p21                  # STEP P21
smooth import package.zip                  # GTC package (ISO 13399) + 3D models & images

Re-importing the same catalog is detected by natural key and reported as skipped, never duplicated.

License

MIT. (The server, Smooth Core, is AGPL-3.0; this client is MIT so it can be freely vendored and reused.)

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

loobric_smooth-0.2.0.tar.gz (53.6 kB view details)

Uploaded Source

Built Distribution

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

loobric_smooth-0.2.0-py3-none-any.whl (50.3 kB view details)

Uploaded Python 3

File details

Details for the file loobric_smooth-0.2.0.tar.gz.

File metadata

  • Download URL: loobric_smooth-0.2.0.tar.gz
  • Upload date:
  • Size: 53.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for loobric_smooth-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d4eb2b53a8c32de559a7de2dcb1139bf056991a9883b731957f9c54c3e3681da
MD5 3ac89a682f8fedec6390d6361aaeda39
BLAKE2b-256 8d982acac4c854864ff9c6990c1ea3e4d921f6211807e7b61cb6ec0c4edd1870

See more details on using hashes here.

Provenance

The following attestation bundles were made for loobric_smooth-0.2.0.tar.gz:

Publisher: publish.yml on loobric/loobric-smooth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file loobric_smooth-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: loobric_smooth-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 50.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for loobric_smooth-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 908455b0f360cacb95e348452081f43e64b9e8c2d350f58e718659cc13c8bd84
MD5 65d159141d5d7cf906e8a3d72184fe67
BLAKE2b-256 f5e0b2d6bd41fbc9d224cd6e2d7d76c7644c02c73d185e44f452bcd06076cf08

See more details on using hashes here.

Provenance

The following attestation bundles were made for loobric_smooth-0.2.0-py3-none-any.whl:

Publisher: publish.yml on loobric/loobric-smooth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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