Deploy site

This commit is contained in:
Gitea Actions
2025-06-11 03:00:30 +02:00
commit b4a252bc51
2329 changed files with 367195 additions and 0 deletions

View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016-2024 Tsuyoshi Hombashi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,278 @@
Metadata-Version: 2.1
Name: DataProperty
Version: 1.1.0
Summary: Python library for extract property from data.
Home-page: https://github.com/thombashi/DataProperty
Author: Tsuyoshi Hombashi
Author-email: tsuyoshi.hombashi@gmail.com
Maintainer: Tsuyoshi Hombashi
Maintainer-email: tsuyoshi.hombashi@gmail.com
License: MIT License
Project-URL: Changelog, https://github.com/thombashi/DataProperty/releases
Project-URL: Source, https://github.com/thombashi/DataProperty
Project-URL: Tracker, https://github.com/thombashi/DataProperty/issues
Keywords: data,library,property
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: mbstrdecoder<2,>=1.0.0
Requires-Dist: typepy[datetime]<2,>=1.3.2
Provides-Extra: logging
Requires-Dist: loguru<1,>=0.4.1; extra == "logging"
Provides-Extra: test
Requires-Dist: pytest>=6.0.1; extra == "test"
Requires-Dist: pytest-md-report>=0.6.2; extra == "test"
Requires-Dist: tcolorpy>=0.1.2; extra == "test"
.. contents:: **DataProperty**
:backlinks: top
:local:
Summary
=======
A Python library for extract property from data.
.. image:: https://badge.fury.io/py/DataProperty.svg
:target: https://badge.fury.io/py/DataProperty
:alt: PyPI package version
.. image:: https://anaconda.org/conda-forge/DataProperty/badges/version.svg
:target: https://anaconda.org/conda-forge/DataProperty
:alt: conda-forge package version
.. image:: https://img.shields.io/pypi/pyversions/DataProperty.svg
:target: https://pypi.org/project/DataProperty
:alt: Supported Python versions
.. image:: https://img.shields.io/pypi/implementation/DataProperty.svg
:target: https://pypi.org/project/DataProperty
:alt: Supported Python implementations
.. image:: https://github.com/thombashi/DataProperty/actions/workflows/ci.yml/badge.svg
:target: https://github.com/thombashi/DataProperty/actions/workflows/ci.yml
:alt: CI status of Linux/macOS/Windows
.. image:: https://coveralls.io/repos/github/thombashi/DataProperty/badge.svg?branch=master
:target: https://coveralls.io/github/thombashi/DataProperty?branch=master
:alt: Test coverage
.. image:: https://github.com/thombashi/DataProperty/actions/workflows/github-code-scanning/codeql/badge.svg
:target: https://github.com/thombashi/DataProperty/actions/workflows/github-code-scanning/codeql
:alt: CodeQL
Installation
============
Installation: pip
------------------------------
::
pip install DataProperty
Installation: conda
------------------------------
::
conda install -c conda-forge dataproperty
Installation: apt
------------------------------
::
sudo add-apt-repository ppa:thombashi/ppa
sudo apt update
sudo apt install python3-dataproperty
Usage
=====
Extract property of data
------------------------
e.g. Extract a ``float`` value property
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: python
>>> from dataproperty import DataProperty
>>> DataProperty(-1.1)
data=-1.1, type=REAL_NUMBER, align=right, ascii_width=4, int_digits=1, decimal_places=1, extra_len=1
e.g. Extract a ``int`` value property
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: python
>>> from dataproperty import DataProperty
>>> DataProperty(123456789)
data=123456789, type=INTEGER, align=right, ascii_width=9, int_digits=9, decimal_places=0, extra_len=0
e.g. Extract a ``str`` (ascii) value property
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: python
>>> from dataproperty import DataProperty
>>> DataProperty("sample string")
data=sample string, type=STRING, align=left, length=13, ascii_width=13, extra_len=0
e.g. Extract a ``str`` (multi-byte) value property
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: python
>>> from dataproperty import DataProperty
>>> str(DataProperty("吾輩は猫である"))
data=吾輩は猫である, type=STRING, align=left, length=7, ascii_width=14, extra_len=0
e.g. Extract a time (``datetime``) value property
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: python
>>> import datetime
>>> from dataproperty import DataProperty
>>> DataProperty(datetime.datetime(2017, 1, 1, 0, 0, 0))
data=2017-01-01 00:00:00, type=DATETIME, align=left, ascii_width=19, extra_len=0
e.g. Extract a ``bool`` value property
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code:: python
>>> from dataproperty import DataProperty
>>> DataProperty(True)
data=True, type=BOOL, align=left, ascii_width=4, extra_len=0
Extract data property for each element from a matrix
----------------------------------------------------
``DataPropertyExtractor.to_dp_matrix`` method returns a matrix of ``DataProperty`` instances from a data matrix.
An example data set and the result are as follows:
:Sample Code:
.. code:: python
import datetime
from dataproperty import DataPropertyExtractor
dp_extractor = DataPropertyExtractor()
dt = datetime.datetime(2017, 1, 1, 0, 0, 0)
inf = float("inf")
nan = float("nan")
dp_matrix = dp_extractor.to_dp_matrix([
[1, 1.1, "aa", 1, 1, True, inf, nan, dt],
[2, 2.2, "bbb", 2.2, 2.2, False, "inf", "nan", dt],
[3, 3.33, "cccc", -3, "ccc", "true", inf, "NAN", "2017-01-01T01:23:45+0900"],
])
for row, dp_list in enumerate(dp_matrix):
for col, dp in enumerate(dp_list):
print("row={:d}, col={:d}, {}".format(row, col, str(dp)))
:Output:
::
row=0, col=0, data=1, type=INTEGER, align=right, ascii_width=1, int_digits=1, decimal_places=0, extra_len=0
row=0, col=1, data=1.1, type=REAL_NUMBER, align=right, ascii_width=3, int_digits=1, decimal_places=1, extra_len=0
row=0, col=2, data=aa, type=STRING, align=left, ascii_width=2, length=2, extra_len=0
row=0, col=3, data=1, type=INTEGER, align=right, ascii_width=1, int_digits=1, decimal_places=0, extra_len=0
row=0, col=4, data=1, type=INTEGER, align=right, ascii_width=1, int_digits=1, decimal_places=0, extra_len=0
row=0, col=5, data=True, type=BOOL, align=left, ascii_width=4, extra_len=0
row=0, col=6, data=Infinity, type=INFINITY, align=left, ascii_width=8, extra_len=0
row=0, col=7, data=NaN, type=NAN, align=left, ascii_width=3, extra_len=0
row=0, col=8, data=2017-01-01 00:00:00, type=DATETIME, align=left, ascii_width=19, extra_len=0
row=1, col=0, data=2, type=INTEGER, align=right, ascii_width=1, int_digits=1, decimal_places=0, extra_len=0
row=1, col=1, data=2.2, type=REAL_NUMBER, align=right, ascii_width=3, int_digits=1, decimal_places=1, extra_len=0
row=1, col=2, data=bbb, type=STRING, align=left, ascii_width=3, length=3, extra_len=0
row=1, col=3, data=2.2, type=REAL_NUMBER, align=right, ascii_width=3, int_digits=1, decimal_places=1, extra_len=0
row=1, col=4, data=2.2, type=REAL_NUMBER, align=right, ascii_width=3, int_digits=1, decimal_places=1, extra_len=0
row=1, col=5, data=False, type=BOOL, align=left, ascii_width=5, extra_len=0
row=1, col=6, data=Infinity, type=INFINITY, align=left, ascii_width=8, extra_len=0
row=1, col=7, data=NaN, type=NAN, align=left, ascii_width=3, extra_len=0
row=1, col=8, data=2017-01-01 00:00:00, type=DATETIME, align=left, ascii_width=19, extra_len=0
row=2, col=0, data=3, type=INTEGER, align=right, ascii_width=1, int_digits=1, decimal_places=0, extra_len=0
row=2, col=1, data=3.33, type=REAL_NUMBER, align=right, ascii_width=4, int_digits=1, decimal_places=2, extra_len=0
row=2, col=2, data=cccc, type=STRING, align=left, ascii_width=4, length=4, extra_len=0
row=2, col=3, data=-3, type=INTEGER, align=right, ascii_width=2, int_digits=1, decimal_places=0, extra_len=1
row=2, col=4, data=ccc, type=STRING, align=left, ascii_width=3, length=3, extra_len=0
row=2, col=5, data=True, type=BOOL, align=left, ascii_width=4, extra_len=0
row=2, col=6, data=Infinity, type=INFINITY, align=left, ascii_width=8, extra_len=0
row=2, col=7, data=NaN, type=NAN, align=left, ascii_width=3, extra_len=0
row=2, col=8, data=2017-01-01T01:23:45+0900, type=STRING, align=left, ascii_width=24, length=24, extra_len=0
Full example source code can be found at *examples/py/to_dp_matrix.py*
Extract properties for each column from a matrix
------------------------------------------------------
``DataPropertyExtractor.to_column_dp_list`` method returns a list of ``DataProperty`` instances from a data matrix. The list represents the properties for each column.
An example data set and the result are as follows:
Example data set and result are as follows:
:Sample Code:
.. code:: python
import datetime
from dataproperty import DataPropertyExtractor
dp_extractor = DataPropertyExtractor()
dt = datetime.datetime(2017, 1, 1, 0, 0, 0)
inf = float("inf")
nan = float("nan")
data_matrix = [
[1, 1.1, "aa", 1, 1, True, inf, nan, dt],
[2, 2.2, "bbb", 2.2, 2.2, False, "inf", "nan", dt],
[3, 3.33, "cccc", -3, "ccc", "true", inf, "NAN", "2017-01-01T01:23:45+0900"],
]
dp_extractor.headers = ["int", "float", "str", "num", "mix", "bool", "inf", "nan", "time"]
col_dp_list = dp_extractor.to_column_dp_list(dp_extractor.to_dp_matrix(dp_matrix))
for col_idx, col_dp in enumerate(col_dp_list):
print(str(col_dp))
:Output:
::
column=0, type=INTEGER, align=right, ascii_width=3, bit_len=2, int_digits=1, decimal_places=0
column=1, type=REAL_NUMBER, align=right, ascii_width=5, int_digits=1, decimal_places=(min=1, max=2)
column=2, type=STRING, align=left, ascii_width=4
column=3, type=REAL_NUMBER, align=right, ascii_width=4, int_digits=1, decimal_places=(min=0, max=1), extra_len=(min=0, max=1)
column=4, type=STRING, align=left, ascii_width=3, int_digits=1, decimal_places=(min=0, max=1)
column=5, type=BOOL, align=left, ascii_width=5
column=6, type=INFINITY, align=left, ascii_width=8
column=7, type=NAN, align=left, ascii_width=3
column=8, type=STRING, align=left, ascii_width=24
Full example source code can be found at *examples/py/to_column_dp_list.py*
Dependencies
============
- Python 3.9+
- `Python package dependencies (automatically installed) <https://github.com/thombashi/DataProperty/network/dependencies>`__
Optional dependencies
---------------------
- `loguru <https://github.com/Delgan/loguru>`__
- Used for logging if the package installed

View File

@ -0,0 +1,47 @@
DataProperty-1.1.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
DataProperty-1.1.0.dist-info/LICENSE,sha256=NiiRV-Nxqq5bXTukvoc1ntB1SM3HqfGf9h3GfPxTapw,1089
DataProperty-1.1.0.dist-info/METADATA,sha256=IBRAJe_iO6Q9ANZXB3mGQXUY-7rVOkWScLJScbLLKwE,11604
DataProperty-1.1.0.dist-info/RECORD,,
DataProperty-1.1.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
DataProperty-1.1.0.dist-info/top_level.txt,sha256=RiW0aJCSmIPslrGSqg9wyPRas0Rl7Kcdi_fBBEd0-LY,13
dataproperty/__init__.py,sha256=y_LoBUs28gC7b7AXv49X1XCPHckXo3oKECpW-Oj6LbM,1308
dataproperty/__pycache__/__init__.cpython-39.pyc,,
dataproperty/__pycache__/__version__.cpython-39.pyc,,
dataproperty/__pycache__/_align.cpython-39.pyc,,
dataproperty/__pycache__/_align_getter.cpython-39.pyc,,
dataproperty/__pycache__/_base.cpython-39.pyc,,
dataproperty/__pycache__/_column.cpython-39.pyc,,
dataproperty/__pycache__/_common.cpython-39.pyc,,
dataproperty/__pycache__/_container.cpython-39.pyc,,
dataproperty/__pycache__/_converter.cpython-39.pyc,,
dataproperty/__pycache__/_dataproperty.cpython-39.pyc,,
dataproperty/__pycache__/_extractor.cpython-39.pyc,,
dataproperty/__pycache__/_formatter.cpython-39.pyc,,
dataproperty/__pycache__/_function.cpython-39.pyc,,
dataproperty/__pycache__/_interface.cpython-39.pyc,,
dataproperty/__pycache__/_line_break.cpython-39.pyc,,
dataproperty/__pycache__/_preprocessor.cpython-39.pyc,,
dataproperty/__pycache__/typing.cpython-39.pyc,,
dataproperty/__version__.py,sha256=20XeJZJjWYfDK_1uO_Cw_PfXRL196B8J1hTCAMl1zqA,268
dataproperty/_align.py,sha256=VQCp3HUN-rw5lDcG0CHwoQNwabSOwMF8Fpn52nHpQs8,535
dataproperty/_align_getter.py,sha256=GV8rvnGaF8-8C6E7SNa3SsXw-gp80jR93knG_XDwcZQ,833
dataproperty/_base.py,sha256=e1EIrIOoQ2a0ZHUU8dZaB5VB7Hyla9BI6Ui4EQTlQJ4,2522
dataproperty/_column.py,sha256=IrO0BFlL8GZzezCNXNF0iOKmhe-D4Jfa3mc_o6K3f8I,11641
dataproperty/_common.py,sha256=S2FEfleQ3mjdMwaqW3KBpOrc-txr2vY2rpsV-WD-dxQ,2036
dataproperty/_container.py,sha256=nA8j6FK1XZRshdkc0IKrSnWiNUCsWtEaWE97gvwUsWE,5189
dataproperty/_converter.py,sha256=ztL51KpTfo4k-UJVPGruGHQqXM9gpZie7Gp3lbj_20M,3284
dataproperty/_dataproperty.py,sha256=Iby_m1h7HoRx2t2ZhjfRp0tk_dM6rN7ZD2LpsKTlFAY,11329
dataproperty/_extractor.py,sha256=M5it_2JHayk2EyfmfobcjzWFkycvg7WwnSNimn7N1zY,26019
dataproperty/_formatter.py,sha256=9bUxfuEQonKT9rqSaK9mc4fmNg_dnlkmftR48sGOytY,3022
dataproperty/_function.py,sha256=EKa13rpLHMYM84jqsCiTbpR2pd7lofd9uWRhx34HTEk,3267
dataproperty/_interface.py,sha256=eBR3lK1Ub3JOA9VRfTxB2AKnZI4k0-n3s1htvGzZCog,674
dataproperty/_line_break.py,sha256=FGjtuWKftOchoeJZJ9DxHJ9DUY0PPO_tPTiAM1e-Wck,114
dataproperty/_preprocessor.py,sha256=RHqbt41Edy14iQIbHUJ1pd3S-QUVDPDSN-zBlZ5_dbA,5491
dataproperty/logger/__init__.py,sha256=OnQCZS8T1Av5eQxFkuP-GAtmS-WdLXvy-yTvldwNoBI,104
dataproperty/logger/__pycache__/__init__.cpython-39.pyc,,
dataproperty/logger/__pycache__/_logger.cpython-39.pyc,,
dataproperty/logger/__pycache__/_null_logger.cpython-39.pyc,,
dataproperty/logger/_logger.py,sha256=-Kc7JXkSgq2BLy7kfP0SiwauShwsb66dzvCiNrTLDQg,442
dataproperty/logger/_null_logger.py,sha256=xWCR2KAa2aKAcpKi8DosfCOgaRMb_YXr9MKrK7xMD-A,1071
dataproperty/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
dataproperty/typing.py,sha256=l_nHqtIIQrBtHKBsWfCUy6A1UBuwCqJNUSvXvHfeWY4,1440

View File

@ -0,0 +1,5 @@
Wheel-Version: 1.0
Generator: setuptools (75.6.0)
Root-Is-Purelib: true
Tag: py3-none-any