8000 Release 0.6.1 · FirebirdSQL/python3-base@318d6d3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 318d6d3

Browse files
committed
Release 0.6.1
1 parent fcf9815 commit 318d6d3

File tree

5 files changed

+129
-10
lines changed

5 files changed

+129
-10
lines changed

docs/changelog.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Changelog
33
#########
44

5+
Version 0.6.1
6+
=============
7+
8+
* Promoted to stable
9+
* More documentation
10+
511
Version 0.6.0
612
=============
713

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
author = 'Pavel Císař'
2424

2525
# The short X.Y version
26-
version = '0.6.0'
26+
version = '0.6.1'
2727

2828
# The full version, including alpha/beta/rc tags
29-
release = '0.6.0'
29+
release = '0.6.1'
3030

3131

3232
# -- General configuration ---------------------------------------------------

docs/introduction.txt

Lines changed: 117 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,124 @@
22
Introduction
33
############
44

5-Installation
5+
The firebird-base package is a set of Python 3 modules commonly used by Firebird Project in
6+
various development projects (for example the firebird-driver). However, these modules have
7+
general applicability outside the scope of development for Firebird RDBMS.
8+
9+
Common data types
10+
=================
11+
12+
The `.types` module provides collection of classes and other types that are often used by
13+
other library modules or applications.
14+
15+
* Exception `.Error` that is intended to be used as a base class of all application-related
16+
errors. The important difference from `Exception` class is that `.Error` accepts keyword
17+
arguments, that are stored into instance attributes with the same name.
18+
* `.Singleton` base class for singletons.
19+
* `.Sentinel` base class for named sentinel objects that provide meaningful `str` and `repr`,
20+
along with collection of predefined sentinels.
21+
* `.Distinct` abstract base class for classes (incl. dataclasses) with distinct instances.
22+
* Collection of `Enums` and `custom string types`.
23+
24+
Various collection types
25+
========================
26+
27+
The `.collections` mod 8000 ule provides data structures that behave much like builtin `list` and
28+
`dict` types, but with direct support of operations that can use structured data stored in
29+
container, and which would normally require utilization of `operator`, `functools` or other
30+
means.
31+
32+
All containers provide next operations:
33+
34+
* `filter` and `filterfalse` that return generator that yields items for which expr is
35+
evaluated as True (or False).
36+
* `find` that returns first item for which expr is evaluated as True, or default.
37+
* `contains` that returns True if there is any item for which expr is evaluated as True.
38+
* `occurrence` that returns number of items for which expr is evaluated as True.
39+
* `all` and `any` that return True if expr is evaluated as True for all or any list element(s).
40+
* `report` that returns generator that yields data produced by expression(s) evaluated on list items.
41+
42+
Individual collection types provide additional operations like splitting and extracting
43+
based on expression etc.
44+
45+
Expressions used by these methods could be strings that contain Python expression referencing
46+
the collection item(s), or lambda functions.
47+
48+
Data conversion from/to string
49+
==============================
50+
51+
While Python types typically support conversion to string via builtin `str()` function (and
52+
custom `__str__` methods), there is no symetric operation that converts string created by
53+
`str()` back to typed value. Module `.strconv` provides support for such symetric conversion
54+
from/to string for any data type.
55+
56+
Symetric string conversion is used by `.config` module, notably by `.ListOption` and
57+
`.DataclassOption`. You can extend the range of data types supported by these options by
58+
registering convertors for required data types.
59+
60+
Configuration definitions
61+
=========================
62+
63+
Complex applications (and some library modules like `logging`) could be often parametrized
64+
via configuration. Module `.config` provides a framework for unified structured configuration
65+
that supports:
66+
67+
* configuration options of various data type, including lists and other complex types
68+
* validation
69+
* direct manipulation of configuration values
70+
* reading from (and writing into) configuration in `configparser` format
71+
* exchanging configuration (for example between processes) using Google protobuf messages
72+
73+
Memory buffer manager
74+
=====================
75+
76+
Module `.buffer` provides a raw memory buffer manager with convenient methods to read/write
77+
data of various data type.
78+
79+
Hook manager
680
============
781

8-
::
82+
Module `.hooks` provides a general framework for callbacks and “hookable” events, that
83+
supports multiple usage strategies.
84+
85+
Context-based logging
86+
=====================
87+
88+
Module '.logging' provides context-based logging system built on top of standard `logging`
89+
module.
90+
91+
The context-based logging:
92+
93+
* Adds context information (defined as combination of topic, agent and context string values)
94+
into `~logging.LogRecord`, that could be used in logging message.
95+
* Adds support for f-string message format.
96+
* Allows assignment of loggers to specific contexts. The `.LoggingManager` class maintains
97+
a set of bindings between `Logger` objects and combination of `agent`, `context` and `topic`
98+
specifications. It’s possible to bind loggers to exact combination of values, or whole
99+
sets of values using `.ANY` sentinel. It means that is possible to assign specific Logger
100+
to log messages for particular agent in any context, or any agent operating in specific
101+
context etc.
102+
103+
Trace/audit for class instances
104+
===============================
105+
106+
Module `.trace` provides trace/audit logging for functions or object methods through
107+
context-based logging provided by `.logging` module.
108+
109+
The trace logging is performed by `.traced` decorator. You can use this decorator directly,
110+
or use `.TracedMixin` class to automatically decorate methods of class instances on creation.
111+
Each decorated callable could log messages before execution, after successful execution or
112+
on failed execution (when unhandled execption is raised by callable). The trace decorator
113+
can automatically add `agent` and `context` information, and include parameters passed to
114+
callable, execution time, return value, information about raised exception etc. to log messages.
115+
116+
The trace logging is managed by `.TraceManager`, that allows dynamic configuration of traced
117+
callables at runtime.
9118

10-
pip install firebird-base
119+
Registry for Google Protocol Buffer messages and enums
120+
======================================================
11121

12-
.. note:: Requires Python 3.8+
122+
Module `.protobuf` provides central registry for Google Protocol Buffer messages and enums.
123+
The generated *_pb2.py protobuf files could be registered using `.register_decriptor` or
124+
`.load_registered` function. The registry could be then used to obtain information about
125+
protobuf messages or enum types, or to create message instances or enum values.

docs/types.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ types - Common data types
88
Overview
99
========
1010

11-
This module provides collection classes that are often used by other library modules or
11+
This module provides collection of classes that are often used by other library modules or
1212
applications.
1313

1414
Exceptions

setup.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ all-files=True
55

66
[metadata]
77
name = firebird-base
8-
version = 0.6.0
8+
version = 0.6.1
99
description = Firebird base modules for Python
1010
long_description = file: README.rst
1111
long_description_content_type = text/x-rst; charset=UTF-8
@@ -21,7 +21,7 @@ project_urls =
2121
Funding = https://www.firebirdsql.org/en/donate/
2222
Source = https://github.com/FirebirdSQL/python3-base
2323
classifiers =
24-
Development Status :: 4 - Beta
24+
Development Status :: 5 - Production/Stable
2525
Intended Audience :: Developers
2626
License :: OSI Approved :: MIT License
2727
Programming Language :: Python :: 3
@@ -35,7 +35,7 @@ classifiers =
3535
zip_safe = True
3636
python_requires = >=3.8, <4
3737
install_requires =
38-
protobuf>=3.12.0
38+
protobuf>=3.13.0
3939
packages = find_namespace:
4040

4141
[options.packages.find]

0 commit comments

Comments
 (0)
0