advanced-dtypes
Advanced DataTypes is a package for Python that provides access faster, feature-rich data types not provided in the standard library, motivated by my thoughts of "why is that not a thing?" The aim of the project is to fill out the holes in the standard library data types' feature-set while improving upon the performance of the existing feature-set.
Constant Store
Constant Store is a class that provides a namespace within which to store constants on a class attribute basis. Class definition is very simple:
from advanced_dtypes import ConstStore
class Example(ConstStore):
NAME_1 = "some_value"
NAME_2 = 23
The class is built to populate a set and dictionary on import, which drives many of the features of the class, as well as the __slots__ attribute, which helps boost performance. Since the class attributes are maintained, names can be directly dot-referenced.
>> Example.NAME_1 == "some_value"
True
>> type(Example.NAME_1) == str
True
ConstStore also provides an interface for the following functionality:
>> len(Example)
2
>> 23 in Example
True
>> Example(23)
NAME_2
>> Example["NAME_2"]
23
>> [value for value in Example]
["some_value", 23]
You should be aware, however, that non-hashable objects will have slower performance in lookups such as in, Class(value) and Class[name].
Fast Enum
FastEnum is simply a faster implementation of the existing standard library Enum.
Definition is exactly the same as a standard enum:
from advanced_dtypes import FastEnum
class Example(FastEnum):
NAME_1 = "some_value"
NAME_2 = 23
Similarly, standard enum functionality remains:
>> Example.NAME_1
<Example.NAME_1: some_value>
>> Example.NAME_1.name
NAME_1
>> Example.NAME_1.value
some_value
>> Example("some_value")
<Example.NAME_1: some_value>
>> Example["NAME_1"]
<Example.NAME_1: some_value>
>> len(Example)
2
>> [item for item in Example]
[<Example.NAME_1: some_value>, <Example.NAME_2: 23>]
>> Example.NAME_1 == Example.NAME_1
True
The only functional addition in this instance is equality checking of members against values directly:
>> Example.NAME_1 == "some_value"
True
How To Install
pip install advanced-dtypes
Metadata
Release files for advanced-dtypes 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| advanced-dtypes-0.0.2.tar.gz | 4.4 kB | Without provenance | Details for advanced-dtypes-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| advanced_dtypes-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for advanced_dtypes-0.0.2-py3-none-any.whl |
Total release size: 10.6 kB
Release files / advanced-dtypes-0.0.2.tar.gz
| Download URL | advanced-dtypes-0.0.2.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c4a75ba725e082fb3cd4b4360f1a5b80e73e0b4cdf929ce3e8a0ec83724eaf2
|
|
BLAKE2b-256 checksum How to use checksums |
c71a6779d9bf13eab50bd31f8955e2a6e6df8a7b614834bd8df8c9751d338e07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.7
|
Release files / advanced_dtypes-0.0.2-py3-none-any.whl
| Download URL | advanced_dtypes-0.0.2-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
068d9cef1034c79f9a5dbd1022c64cc19a8d2c65147600dbb826a6f8fef5e3a2
|
|
BLAKE2b-256 checksum How to use checksums |
5b0e69d746c3966ce12368262ce0151713d823df139314d0c9198d93ff903d4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.7
|
Security for advanced-dtypes 0.0.2
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.