Skip to content

Commit 45e7a7c

Browse files
committed
Change readme format to markdown
1 parent fcda5ae commit 45e7a7c

File tree

1 file changed

+59
-50
lines changed

1 file changed

+59
-50
lines changed
Lines changed: 59 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,51 @@
1-
================================
2-
Firebird base modules for Python
3-
================================
1+
# firebird-base
2+
3+
## Firebird base modules for Python
4+
5+
[![PyPI - Version](https://img.shields.io/pypi/v/firebird-base.svg)](https://pypi.org/project/firebird-base)
6+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/firebird-base.svg)](https://pypi.org/project/firebird-base)
7+
[![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)
48

59
The firebird-base package is a set of Python 3 modules commonly used by `Firebird Project`_
610
in various development projects (for example the firebird-driver or Saturnin). However, these
711
modules have general applicability outside the scope of development for Firebird_.
812

9-
Common data types
10-
=================
13+
-----
14+
15+
**Table of Contents**
16+
17+
- [Installation](#installation)
18+
- [License](#license)
19+
- [Introduction](#introduction)
20+
- [Documentation](#documentation)
21+
22+
## Installation
23+
24+
```console
25+
pip install firebird-base
26+
```
27+
28+
## License
29+
30+
`firebird-base` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
31+
32+
## Introduction
33+
34+
### Common data types
1135

1236
The `types` module provides collection of classes and other types that are often used by
1337
other library modules or applications.
1438

15-
* Exception `Error` that is intended to be used as a base class of all application-related
39+
- Exception `Error` that is intended to be used as a base class of all application-related
1640
errors. The important difference from `Exception` class is that `Error` accepts keyword
1741
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`,
42+
- `Singleton` base class for singletons.
43+
- `Sentinel` base class for named sentinel objects that provide meaningful `str` and `repr`,
2044
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`.
45+
- `Distinct` abstract base class for classes (incl. dataclasses) with distinct instances.
46+
- Collection of `Enums` and `custom string types`.
2347

24-
Various collection types
25-
========================
48+
### Various collection types
2649

2750
The `collections` module provides data structures that behave much like builtin `list` and
2851
`dict` types, but with direct support of operations that can use structured data stored in
@@ -31,22 +54,21 @@ means.
3154

3255
All containers provide next operations:
3356

34-
* `filter` and `filterfalse` that return generator that yields items for which expr is
57+
- `filter` and `filterfalse` that return generator that yields items for which expr is
3558
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 collection element(s).
40-
* `report` that returns generator that yields data produced by expression(s) evaluated on collection items.
59+
- `find` that returns first item for which expr is evaluated as True, or default.
60+
- `contains` that returns True if there is any item for which expr is evaluated as True.
61+
- `occurrence` that returns number of items for which expr is evaluated as True.
62+
- `all` and `any` that return True if expr is evaluated as True for all or any collection element(s).
63+
- `report` that returns generator that yields data produced by expression(s) evaluated on collection items.
4164

4265
Individual collection types provide additional operations like splitting and extracting
4366
based on expression etc.
4467

4568
Expressions used by these methods could be strings that contain Python expression referencing
4669
the collection item(s), or lambda functions.
4770

48-
Data conversion from/to string
49-
==============================
71+
### Data conversion from/to string
5072

5173
While Python types typically support conversion to string via builtin `str()` function (and
5274
custom `__str__` methods), there is no symetric operation that converts string created by
@@ -58,57 +80,52 @@ Symetric string conversion is used by `firebird.base.config` module, notably by
5880
extend the range of data types supported by these options by registering convertors for
5981
required data types.
6082

61-
Configuration definitions
62-
=========================
83+
### Configuration definitions
6384

6485
Complex applications (and some library modules like `logging`) could be often parametrized
6586
via configuration. Module `firebird.base.config` provides a framework for unified structured
6687
configuration that supports:
6788

68-
* configuration options of various data type, including lists and other complex types
69-
* validation
70-
* direct manipulation of configuration values
71-
* reading from (and writing into) configuration in `configparser` format
72-
* exchanging configuration (for example between processes) using Google protobuf messages
89+
- configuration options of various data type, including lists and other complex types
90+
- validation
91+
- direct manipulation of configuration values
92+
- reading from (and writing into) configuration in `configparser` format
93+
- exchanging configuration (for example between processes) using Google protobuf messages
7394

7495
Additionally, the `ApplicationDirectoryScheme` abstract base class defines set of mostly
7596
used application directories. The function `get_directory_scheme()` could be then used
7697
to obtain instance that implements platform-specific standards for file-system location
7798
for these directories. Currently, only "Windows", "Linux" and "MacOS" directory schemes
7899
are supported.
79100

80-
Memory buffer manager
81-
=====================
101+
### Memory buffer manager
82102

83103
Module `buffer` provides a raw memory buffer manager with convenient methods to read/write
84104
data of various data types.
85105

86-
Hook manager
87-
============
106+
### Hook manager
88107

89108
Module `hooks` provides a general framework for callbacks and “hookable” events, that
90109
supports multiple usage strategies.
91110

92-
Context-based logging
93-
=====================
111+
### Context-based logging
94112

95113
Module `logging` provides context-based logging system built on top of standard `logging`
96114
module.
97115

98116
The context-based logging:
99117

100-
* Adds context information (defined as combination of topic, agent and context string values)
118+
- Adds context information (defined as combination of topic, agent and context string values)
101119
into `logging.LogRecord`, that could be used in logging message.
102-
* Adds support for f-string message format.
103-
* Allows assignment of loggers to specific contexts. The `LoggingManager` class maintains
120+
- Adds support for f-string message format.
121+
- Allows assignment of loggers to specific contexts. The `LoggingManager` class maintains
104122
a set of bindings between `Logger` objects and combination of `agent`, `context` and `topic`
105123
specifications. It’s possible to bind loggers to exact combination of values, or whole
106124
sets of values using `ANY` sentinel. It means that is possible to assign specific Logger
107125
to log messages for particular agent in any context, or any agent operating in specific
108126
context etc.
109127

110-
Trace/audit for class instances
111-
===============================
128+
### Trace/audit for class instances
112129

113130
Module `trace` provides trace/audit logging for functions or object methods through
114131
context-based logging provided by `logging` module.
@@ -125,16 +142,14 @@ callables at runtime.
125142

126143
Trace supports configuration based on `firebird.base.config`.
127144

128-
Registry for Google Protocol Buffer messages and enums
129-
======================================================
145+
### Registry for Google Protocol Buffer messages and enums
130146

131147
Module `protobuf` provides central registry for Google Protocol Buffer messages and enums.
132148
The generated `*_pb2.py protobuf` files could be registered using `register_decriptor` or
133149
`load_registered` function. The registry could be then used to obtain information about
134150
protobuf messages or enum types, or to create message instances or enum values.
135151

136-
Callback systems
137-
================
152+
### Callback systems
138153

139154
Module `firebird.base.signal` provides two callback mechanisms: one based on signals and
140155
slots similar to Qt signal/slot, and second based on optional method delegation similar to
@@ -144,12 +159,6 @@ In both cases, the callback callables could be functions, instance or class meth
144159
partials and lambda functions. The `inspect` module is used to define the signature for
145160
callbacks, and to validate that only compatible callables are assigned.
146161

147-
|donate|
148-
149-
.. _Firebird: http://www.firebirdsql.org
150-
.. _Firebird Project: https://github.com/FirebirdSQL
162+
## Documentation
151163

152-
.. |donate| image:: https://www.firebirdsql.org/img/donate/donate_to_firebird.gif
153-
:alt: Contribute to the development
154-
:scale: 100%
155-
:target: https://www.firebirdsql.org/en/donate/
164+
The documentation for this package is available at [https://firebird-base.readthedocs.io](https://firebird-base.readthedocs.io)

0 commit comments

Comments
 (0)