Skip to main content

Python library unicum

CodeShip Travis ci Read the Docs CodeFactor Grade Code Climate maintainability Codecov lgtm grade total lgtm alerts GitHub GitHub release PyPI Version PyPI - Python Version PyPI Downloads

unicum consists of multiple object implementations that implement various factory pattern. All types merge into on type VisibleObject and each type contributes bits and piece.

The visible obj focus on robust and simple construction from a dictionary via PersistentObject having values only simple types or containers containers of simple types.

These values are translated via FatoryObject into more complex structures which are take from a factory.

Or, alternatively, using DataRange into something similar to a data_frame type in R, a table with column and row names as well as common types for each column values.

Inheriting from LinkedObject provides functionality to swap or update attributes at runtime

Example Usage

Using FactoryObject:

>>> from unicum import FactoryObject

>>> class Currency(FactoryObject): __factory = dict()
>>> class EUR(Currency): pass
>>> class USD(Currency): pass

>>> EUR().register()  # registers USD() instance with class name 'EUR'
>>> eur = Currency('EUR')  # picks instance with key 'EUR' from currency cache
>>> eur == EUR()  # picks instance with key given by class name 'EUR' from currency cache, too.

True

>>> eur2 = eur.__class__('EUR')  # picks instance with key 'EUR' from currency cache
>>> eur == eur2

True

>>> usd = USD().register()  # registers USD() instance with class name 'USD'
>>> usd.register('usd')  # registers usd with name 'usd'
>>> usd == USD()

True

>>> eur == eur.__class__('USD')

False

>>> usd == eur.__class__('USD')

True

>>> usd == Currency('usd')

True

Using LinkedObject:

>>> from unicum import LinkedObject

Development Version

The latest development version can be installed directly from GitHub:

$ pip install --upgrade git+https://github.com/sonntagsgesicht/unicum.git

Contributions

Issues and Pull Requests are always welcome.

License

Code and documentation are available according to the Apache Software License (see LICENSE).

Metadata

Release files for unicum 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unicum 0.3
File Size Uploaded Provenance Actions
unicum-0.3.tar.gz 23.8 kB Without provenance Details for unicum-0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for unicum 0.3
File Interpreter ABI Platform Actions
unicum-0.3-py3-none-any.whl Python 3 none any Details for unicum-0.3-py3-none-any.whl

Total release size: 51.6 kB

Release files / unicum-0.3.tar.gz

Download URL unicum-0.3.tar.gz
Size 23.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fcde16513a09f77c056a357ffd91db9305c2d2b164153c377dd11376d9e9f418
BLAKE2b-256 checksum
How to use checksums
634653c78b9b007ade044fcfc35a9fdbfda236a398d33e1c548ada19f978e316
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.4

Release files / unicum-0.3-py3-none-any.whl

Download URL unicum-0.3-py3-none-any.whl
Size 27.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
71d883a91a291472787c503f04c1c455185d24bc6bb15e5d6f172ba30a0223e8
BLAKE2b-256 checksum
How to use checksums
9267ec8516b1f2689b2865562058be91d0cb28e352c5dee425b2417623ef671b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.4

Security for unicum 0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page