Skip to main content

Machbase Python API 2.2 (Pure Python, legacy compatible)

Project description

Copyright of this product 2013-2023,
Machbase Corporation(or Inc.) or its subsidiaries.
All Rights reserved.

http://www.machbase.com

support@machbase.com

Machbase Python API 2.2 (English introduction)

This package is a pure Python implementation of Machbase client protocol and provides a
drop-in replacement API compatible with the legacy Python API.

Python compatibility

- Supported runtime baseline is Python 3.6 or later.
- The source code avoids Python 3.7+ only syntax and does not depend on `dataclasses`.
- The package can be imported directly via `PYTHONPATH` on Python 3.6.x without extra backport packages.

Key changes in version 2.2

1. Pure Python implementation
- Native binary libraries (`.so`, `.dylib`, `.dll`) are no longer required.
- Wire protocol, packet framing, and marshal/unmarshal logic are implemented in Python modules
(`protocol.py`, `marshal.py`, `packet.py`).
- Distribution is platform independent (`py3-none-any` wheel).

2. Fully compatible with existing interfaces
- Existing entry points are preserved (`machbase`, `machbaseAPI`, `connect`, `MachbaseConnection`, `MachbaseCursor`).
- Legacy call patterns for common operations are maintained for migration (`open`, `close`, `openEx`,
`execute`, `select`, `fetch`, `append`, DB-API cursor execution/fetch).
- Existing sample scripts and test code can be executed using the new package without adapter code.
- Existing behavior for unsupported features is preserved as explicit errors.

3. Improved append API
- `append`, `appendByTime` can be used without explicit `types`.
- `appendData`, `appendDataByTime` also support optional type arguments.
- `types` can still be inferred from active append session and explicit table metadata.
- Async-friendly append path: callers can supply callbacks and receive protocol ack handling
without forcing unnecessary blocking.
- Improved row normalization and validation for mixed input forms.

4. Reliability and API strictness improvements
- Connection pooling is rejected with clear errors because pooling is intentionally not supported.
- Unknown connection options are rejected up front (fast validation).
- Expanded DB-API compatible exception mapping.
- Safer close/shutdown cleanup for sockets and sessions.
- Consistent internal encoding for bytes/binary-like values during legacy-style APIs.

5. Operational and migration notes
- Binary wheel no longer embeds platform native modules.
- Installation is lightweight and easier to mirror in CI/build pipelines.
- Version is updated to `2.2` (Python 3.6 direct-import compatibility and packaging/documentation refresh).

What changed for users migrating from 1.x

- Connection
- Use the same host/port/user/password defaults as before.
- No `lib` copy or platform-specific package setup required.
- Append
- Existing `append` usage is supported; session-based and immediate append flows remain available.
- Compatibility boundaries
- Existing scripts that relied on hidden/undocumented native behaviors may need review.
- Pooling-related keys or unsupported options will now raise immediate errors (instead of being ignored).

Known limitations and troubleshooting

- Auto commit model
- Transactions are auto-commit by protocol design for this API.
- High-volume append
- Performance gains from batching large payloads are still recommended.
- For ultra-high throughput scenarios, tune client-side batching strategy in your application.
- Error handling
- Append/append_data and query errors are surfaced through return status and callbacks according to API layer.

FAQ

- Why only `py3-none-any`?
- The package does not load platform-specific binaries anymore.
- Where can I check differences from old binaries?
- Refer to `CHANGELOG.md` and API regression test suite in `test/regress`.

For full behavioral and compatibility reference, see `CHANGELOG.md` and the regression test set.


# Changelog

## 2.2

### Changed
- Version bump from 2.1 to 2.2 for the pure-Python API package.
- Removed remaining Python 3.7+ only syntax from the runtime modules.
- Replaced `dataclasses`-based helper containers with plain classes so `PYTHONPATH` execution also works on Python 3.6.x.
- Updated package metadata and release documents for the 2.2 release.

### Notes
- Package version is set to `2.2`.
- The source package can be imported on Python 3.6.x without extra backport dependencies.

## 2.1

### Changed
- Version bump from 2.0 to 2.1 for pure-python API package.
- Documentation and metadata were updated to reflect the 2.1 release.

### Notes
- Package version is set to `2.1`.

## 2.0.0

### Changed
- Migrated to a pure Python implementation of Machbase protocol processing.
- Removed dependency on native dynamic libraries (`.so`, `.dll`, `.dylib`) from runtime package.
- Kept legacy API compatibility as the primary migration strategy:
- `machbase` and `machbaseAPI` legacy styles
- `connect`, `MachbaseConnection`, `MachbaseCursor`
- legacy sample script behavior for connection/query/append use cases
- Improved append handling:
- more flexible row normalization in session and one-shot append paths
- async-friendly acknowledgement callback flow
- stronger validation around row/type consistency
- Strengthened connection argument validation:
- pooling-related options are explicitly rejected
- unknown keyword options are rejected with clear error messages

### Fixed
- Unified protocol implementation path to Python-only marshal/packet parsing.
- Removed native bridge-related packaging behavior and binary cleanup assumptions.
- Reduced hidden binary cleanup side effects in build artifacts and packaging files.

### Notes
- Package version is set to `2.0.0`.
- Binary distribution format remains source-compatible with legacy test artifacts when using
`PYTHONPATH`-based execution.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

machbaseapi-2.2-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file machbaseapi-2.2-py3-none-any.whl.

File metadata

  • Download URL: machbaseapi-2.2-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for machbaseapi-2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 65e94b7c7f8d0525f1dbaee2ca196d3f6eb8f60daa62762fccd618d9e46e50e4
MD5 ed4f40ea905612315f9dab55e710d6fd
BLAKE2b-256 678b48af610782aa3748baa30dc669235c0a8234e0999a71d12640fa71b7171d

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