{"id":19923308,"url":"https://github.com/firebirdsql/python3-base","last_synced_at":"2025-05-03T07:31:04.313Z","repository":{"id":57429704,"uuid":"267653414","full_name":"FirebirdSQL/python3-base","owner":"FirebirdSQL","description":"Firebird base modules for Python","archived":false,"fork":false,"pushed_at":"2025-04-30T08:45:23.000Z","size":1862,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-30T09:02:24.600Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://firebirdsql.org/en/devel-python-driver/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FirebirdSQL.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":"https://firebirdsql.org/en/donate/"}},"created_at":"2020-05-28T17:29:52.000Z","updated_at":"2025-04-30T08:43:51.000Z","dependencies_parsed_at":"2023-12-21T19:09:42.802Z","dependency_job_id":"40b6292d-72e6-41f1-bdbb-c48575253f99","html_url":"https://github.com/FirebirdSQL/python3-base","commit_stats":{"total_commits":39,"total_committers":1,"mean_commits":39.0,"dds":0.0,"last_synced_commit":"fcda5ae19af8c0bd91d482a5fac4cabfe9c077ee"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FirebirdSQL%2Fpython3-base","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FirebirdSQL%2Fpython3-base/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FirebirdSQL%2Fpython3-base/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FirebirdSQL%2Fpython3-base/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FirebirdSQL","download_url":"https://codeload.github.com/FirebirdSQL/python3-base/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252156833,"owners_count":21703362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T22:13:45.563Z","updated_at":"2025-05-03T07:31:04.306Z","avatar_url":"https://github.com/FirebirdSQL.png","language":"Python","readme":"# firebird-base\n\n## Firebird base modules for Python\n\n[![PyPI - Version](https://img.shields.io/pypi/v/firebird-base.svg)](https://pypi.org/project/firebird-base)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/firebird-base.svg)](https://pypi.org/project/firebird-base)\n[![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/firebird-base)](https://pypi.org/project/firebird-base)\n[![Libraries.io SourceRank](https://img.shields.io/librariesio/sourcerank/pypi/firebird-base)](https://libraries.io/pypi/firebird-base)\n\nThe firebird-base package is a set of Python 3 modules commonly used by [Firebird Project](https://github.com/FirebirdSQL)\nin various development projects (for example the firebird-driver or Saturnin). However, these\nmodules have general applicability outside the scope of development for [Firebird](https://www.firebirdsql.org).\n\n-----\n\n**Table of Contents**\n\n- [Installation](#installation)\n- [License](#license)\n- [Introduction](#introduction)\n- [Documentation](#documentation)\n\n## Installation\n\n```console\npip install firebird-base\n```\n\n## License\n\n`firebird-base` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.\n\n## Introduction\n\n### Common data types\n\nThe `types` module provides collection of classes and other types that are often used by\nother library modules or applications.\n\n- Exception `Error` that is intended to be used as a base class of all application-related\n  errors. The important difference from `Exception` class is that `Error` accepts keyword\n  arguments, that are stored into instance attributes with the same name.\n- `Singleton` base class for singletons.\n- `Sentinel` base class for named sentinel objects that provide meaningful `str` and `repr`,\n  along with collection of predefined sentinels.\n- `Distinct` abstract base class for classes (incl. dataclasses) with distinct instances.\n- Collection of `Enums` and `custom string types`.\n\n### Various collection types\n\nThe `collections` module provides data structures that behave much like builtin `list` and\n`dict` types, but with direct support of operations that can use structured data stored in\ncontainer, and which would normally require utilization of `operator`, `functools` or other\nmeans.\n\nAll containers provide next operations:\n\n- `filter` and `filterfalse` that return generator that yields items for which expr is\n  evaluated as True (or False).\n- `find` that returns first item for which expr is evaluated as True, or default.\n- `contains` that returns True if there is any item for which expr is evaluated as True.\n- `occurrence` that returns number of items for which expr is evaluated as True.\n- `all` and `any` that return True if expr is evaluated as True for all or any collection element(s).\n- `report` that returns generator that yields data produced by expression(s) evaluated on collection items.\n\nIndividual collection types provide additional operations like splitting and extracting\nbased on expression etc.\n\nExpressions used by these methods could be strings that contain Python expression referencing\nthe collection item(s), or lambda functions.\n\n### Data conversion from/to string\n\nWhile Python types typically support conversion to string via builtin `str()` function (and\ncustom `__str__` methods), there is no symetric operation that converts string created by\n`str()` back to typed value. Module `strconv` provides support for such symetric conversion\nfrom/to string for any data type.\n\nSymetric string conversion is used by `firebird.base.config` module, notably by\n`firebird.base.config.ListOption` and `firebird.base.config.DataclassOption`. You can\nextend the range of data types supported by these options by registering convertors for\nrequired data types.\n\n### Configuration definitions\n\nComplex applications (and some library modules like `logging`) could be often parametrized\nvia configuration. Module `firebird.base.config` provides a framework for unified structured\nconfiguration that supports:\n\n- configuration options of various data type, including lists and other complex types\n- validation\n- direct manipulation of configuration values\n- reading from (and writing into) configuration in `configparser` format\n- exchanging configuration (for example between processes) using Google protobuf messages\n\nAdditionally, the `ApplicationDirectoryScheme` abstract base class defines set of mostly\nused application directories. The function `get_directory_scheme()` could be then used\nto obtain instance that implements platform-specific standards for file-system location\nfor these directories. Currently, only \"Windows\", \"Linux\" and \"MacOS\" directory schemes\nare supported.\n\n### Memory buffer manager\n\nModule `buffer` provides a raw memory buffer manager with convenient methods to read/write\ndata of various data types.\n\n### Hook manager\n\nModule `hooks` provides a general framework for callbacks and “hookable” events, that\nsupports multiple usage strategies.\n\n### Context-based logging\n\nModule `logging` provides context-based logging system built on top of standard `logging`\nmodule. It also solves the common logging management problem when various modules use hard-coded\nseparate loggers, and provides several types of message wrappers that allow lazy message\ninterpolation using f-string, brace (`str.format`) or dollar (`string.Template`) formats.\n\nThe context-based logging:\n\n1. Adds context information into `logging.LogRecord`, that could be used in logging entry formats.\n2. Allows assignment of loggers to specific contexts.\n\n### Trace/audit for class instances\n\nModule `trace` provides trace/audit logging for functions or object methods through\ncontext-based logging provided by `logging` module.\n\nThe trace logging is performed by `traced` decorator. You can use this decorator directly,\nor use `TracedMixin` class to automatically decorate methods of class instances on creation.\nEach decorated callable could log messages before execution, after successful execution or\non failed execution (when unhandled exception is raised by callable). The trace decorator\ncan automatically add `agent` and `context` information, and include parameters passed to\ncallable, execution time, return value, information about raised exception etc. to log messages.\n\nThe trace logging is managed by `TraceManager`, that allows dynamic configuration of traced\ncallables at runtime.\n\nTrace supports configuration based on `firebird.base.config`.\n\n### Registry for Google Protocol Buffer messages and enums\n\nModule `protobuf` provides central registry for Google Protocol Buffer messages and enums.\nThe generated `*_pb2.py protobuf` files could be registered using `register_decriptor` or\n`load_registered` function. The registry could be then used to obtain information about\nprotobuf messages or enum types, or to create message instances or enum values.\n\n### Callback systems\n\nModule `firebird.base.signal` provides two callback mechanisms: one based on signals and\nslots similar to Qt signal/slot, and second based on optional method delegation similar to\nevents in Delphi.\n\nIn both cases, the callback callables could be functions, instance or class methods,\npartials and lambda functions. The `inspect` module is used to define the signature for\ncallbacks, and to validate that only compatible callables are assigned.\n\n## Documentation\n\nThe documentation for this package is available at [https://firebird-base.readthedocs.io](https://firebird-base.readthedocs.io)\n","funding_links":["https://firebirdsql.org/en/donate/"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebirdsql%2Fpython3-base","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirebirdsql%2Fpython3-base","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebirdsql%2Fpython3-base/lists"}