cpinow 2025.7.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cpinow-2025.7.8/LICENSE +21 -0
- cpinow-2025.7.8/PKG-INFO +20 -0
- cpinow-2025.7.8/cpinow/__init__.py +35 -0
- cpinow-2025.7.8/cpinow/data/colombia.csv +852 -0
- cpinow-2025.7.8/cpinow/data/colombia.xlsx +0 -0
- cpinow-2025.7.8/cpinow/exc.py +62 -0
- cpinow-2025.7.8/cpinow/logger.py +156 -0
- cpinow-2025.7.8/cpinow/names.py +18 -0
- cpinow-2025.7.8/cpinow/retrievers/__init__.py +3 -0
- cpinow-2025.7.8/cpinow/retrievers/base.py +66 -0
- cpinow-2025.7.8/cpinow/retrievers/colombia.py +130 -0
- cpinow-2025.7.8/cpinow/schemas.py +28 -0
- cpinow-2025.7.8/cpinow/settings.py +108 -0
- cpinow-2025.7.8/pyproject.toml +43 -0
cpinow-2025.7.8/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Pablo Felipe Torres
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
cpinow-2025.7.8/PKG-INFO
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: cpinow
|
|
3
|
+
Version: 2025.7.8
|
|
4
|
+
Summary: cpi-now is a Python library designed to simplify the retrieval of Consumer Price Index (CPI) values from the central banks of countries
|
|
5
|
+
Author: Pablo Felipe Torres
|
|
6
|
+
Maintainer: Pablo Felipe Torres
|
|
7
|
+
Requires-Python: >=3.9,<3.11
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Requires-Dist: bs4 (>=0.0.1)
|
|
12
|
+
Requires-Dist: lxml (>=4.9.3)
|
|
13
|
+
Requires-Dist: openpyxl (>=3.1.2,<4.0.0)
|
|
14
|
+
Requires-Dist: pandas
|
|
15
|
+
Requires-Dist: pandera
|
|
16
|
+
Requires-Dist: pydantic (>=1.10.0,<2.0.0)
|
|
17
|
+
Requires-Dist: python-dotenv
|
|
18
|
+
Requires-Dist: requests (>=2.31.0)
|
|
19
|
+
Requires-Dist: selenium (>=4.34.1,<5.0.0)
|
|
20
|
+
Requires-Dist: structlog
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""Top level package for recursiveseriation"""
|
|
3
|
+
|
|
4
|
+
import pandas as pd
|
|
5
|
+
|
|
6
|
+
from cpinow.logger import configure_logging
|
|
7
|
+
from cpinow.names import Countries, CPIColumns
|
|
8
|
+
from cpinow.settings import init_settings
|
|
9
|
+
|
|
10
|
+
__app_name__ = "cpinow"
|
|
11
|
+
__version__ = "2025.7.8"
|
|
12
|
+
|
|
13
|
+
SETTINGS = init_settings()
|
|
14
|
+
logger = configure_logging(__app_name__ + " - v" + __version__, SETTINGS, kidnap_loggers=True)
|
|
15
|
+
|
|
16
|
+
DF_CPI = {
|
|
17
|
+
Countries.COLOMBIA.value: pd.read_csv(SETTINGS.COLOMBIA_LOCAL_PATH.as_posix()),
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
for key, item in DF_CPI.items():
|
|
21
|
+
if item[CPIColumns.DATE.value].max() <= pd.to_datetime("today").strftime("%Y-%m-%d"):
|
|
22
|
+
logger.warn(f"The data is not up to date in the {key} country. Please run the update script.")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def update(countries: list = None):
|
|
26
|
+
from cpinow.retrievers import __retrievers__
|
|
27
|
+
|
|
28
|
+
if countries is None:
|
|
29
|
+
countries = DF_CPI.keys()
|
|
30
|
+
for retriever in __retrievers__:
|
|
31
|
+
if retriever.country in countries:
|
|
32
|
+
logger.info(f"Updating {retriever.country} data...")
|
|
33
|
+
retriever.launch()
|
|
34
|
+
# replace the dataframe in the DF_CPI dictionary
|
|
35
|
+
DF_CPI[retriever.country] = retriever.data
|