diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-31 05:13:03 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-31 05:13:03 +0000 |
commit | dadfce4f4bd2a2fd99992352f077361d5f9ad944 (patch) | |
tree | 632da6574d072d84ece264a0609c5bf474ace579 | |
parent | 92f569dbab2705378b1c07bb6a2eb45b39548907 (diff) |
automatic import of python-federal
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-federal.spec | 681 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 683 insertions, 0 deletions
@@ -0,0 +1 @@ +/Federal-1.0.1.tar.gz diff --git a/python-federal.spec b/python-federal.spec new file mode 100644 index 0000000..da99557 --- /dev/null +++ b/python-federal.spec @@ -0,0 +1,681 @@ +%global _empty_manifest_terminate_build 0 +Name: python-Federal +Version: 1.0.1 +Release: 1 +Summary: A wrapper on to the pandas-datareader package for easier handling of federal reserve (FRED) data +License: MIT License +URL: https://github.com/Jaseibert/Federal +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/0e/e2/5d1ca569625194e5fd55b880fb38879f3829231786cc9db151e5ccd16ef3/Federal-1.0.1.tar.gz +BuildArch: noarch + + +%description +# Federal Package + +This is a simple module built on top of Pandas-Datareader to make it easer to pull in Federal Reserve Data from the Federal Reserve in St. Louis (FRED). + +## Installation + +`pip install Federal` + +## Basic Usage: + +```python + +# Import the GDP and DateFormatter Modules +from Federal.Econ import GDP +from Federal.Formatter import DateFormatter + +#Insatiate the GDP and DateFormatter Objects +g = GDP() +d = DateFormatter() + +#Set your Start & End Dates +d.start_date(1900,1,1) +d.end_date(2018,1,1) + +# Make the Call +df = g.metro_gdp(name='Houston') +df.head() +``` + +## Setting Start & End Dates + +Once imported, you declare the start date and end date via the `DateFormatter.start_date()` and `DateFormatter.end_date()` functions. These functions define the range of dates for the data that you are for. Once declared these values will be applied to each query unless explicitly changed. + +There are several different DateTime format variants that the `DateFormatter.start_date()` and `DateFormatter.end_date()` functions accept: + +1. DateTime format: (Year, Month, Day): **Integer** +```python +# Import the DateFormatter Modules +from Federal.Formatter import DateFormatter + +#Insatiate the DateFormatter Object +d = DateFormatter() + +d.start_date(1900,1,1) +d.end_date(2018,1,1) +``` + +2. DateTime format: (Day/Month/Year): **String** +```python +# Import the DateFormatter Modules +from Federal.Formatter import DateFormatter + +#Insatiate the DateFormatter Object +d = DateFormatter() + +d.start_date('1/1/1900') +d.end_date('1/1/2018') +``` + +3. DateTime format: (Day-Month-Year): **String** +```python +# Import the DateFormatter Modules +from Federal.Formatter import DateFormatter + +#Insatiate the DateFormatter Object +d = DateFormatter() + +d.start_date('1-1-1900') +d.end_date('1-1-2018') +``` + +4. DateTime format: (Day.Month.Year): **String** +```python +# Import the DateFormatter Modules +from Federal.Formatter import DateFormatter + +#Insatiate the DateFormatter Object +d = DateFormatter() + +d.start_date('1.1.1900') +d.end_date('1.1.2018') +``` + +5. DateTime format: (Month/Day/Year): **String** +```python +# Import the DateFormatter Modules +from Federal.Formatter import DateFormatter + +#Insatiate the DateFormatter Object +d = DateFormatter() + +d.start_date('14/1/1900') +d.end_date('16/1/2018') +``` + +### National Gross Domestic Product (GDP) + +After instantiating a FRED object, and defining the start and end dates using the `GDP.start_date()` and `GDP.end_date()` functions you can use the function `GDP.national_gdp()` depending on its parameters to return either nominal GDP or real GDP. + +```python +# Import the GDP and DateFormatter Modules +from Federal.Econ import GDP +from Federal.Formatter import DateFormatter + +#Insatiate the GDP and DateFormatter Objects +g = GDP() +d = DateFormatter() + +#Set Dates +d.start_date('1/1/1900') +d.end_date('1/1/2018') + +# Real GDP +df = g.national_gdp() +df.head() + +# Nominal GDP +df = g.national_gdp(nominal=True) +df.head() +``` + +### State Gross Domestic Product (GSP) + +Similar to the `GDP.national_gdp()` after making the necessary calls you can pull in information around State-Level GDP using the `GDP.state_gdp()` function. It requires one argument, which is the two-character string representing the state of interest. In the case below we pull the state GDP for Indiana. + +```python +# Import the GDP and DateFormatter Modules +from Federal.Econ import GDP +from Federal.Formatter import DateFormatter + +#Insatiate the GDP and DateFormatter Objects +g = GDP() +d = DateFormatter() + +#Set the Dates +d.start_date('1/1/1900') +d.end_date('1/1/2018') + +# State GDP +df = g.state_gdp('IN') +df.head() +``` + +### Metropolitan Gross Domestic Product (GMP) + +The final variation of GDP that the FRED module pulls in is Metropolitan-Level GDP. The Federal Reserve uses Core-Based Statistical Area (CBSA) Codes to define each metro within their API. Here using the `GDP.metro_gdp()` function you can either pass the CBSA code or a name of a metro area as arguments within the function. Beyond this, similar to national GDP, by passing `GDP.metro_gdp(name='<Any Metro Name>',nominal=True)` with nominal equal to True, the function will return the nominal metro GDP. + + +```python +# Import the GDP and DateFormatter Modules +from Federal.Econ import GDP +from Federal.Formatter import DateFormatter + +#Insatiate the GDP and DateFormatter Objects +g = GDP() +d = DateFormatter() + +#Set the Dates +d.start_date('1/1/1900') +d.end_date('1/1/2018') + +# Metropolitan GDP - Passing the City Name as an argument +df = g.metro_gdp(name='Houston') +df.head() + +# Metropolitan GDP - Passing the CBSA code as an argument +df = g.metro_gdp(cbsa=26420) +df.head() + +# Metropolitan GDP - nominal +df = g.metro_gdp(cbsa=26420, nominal=True) +df.head() + +# Metropolitan GDP - nominal +df = g.metro_gdp(name='Houston', nominal=True) +df.head() +``` +### National Unemployment + +Unemployment is defined by the `Unemployment.national_unemp()` function. This function takes an argument `sa` which returns either seasonally-adjusted non seasonally-adjusted unemployment. + +```python +# Import the GDP and DateFormatter Modules +from Federal.Econ import Unemployment +from Federal.Formatter import DateFormatter + +#Insatiate the GDP and DateFormatter Objects +u = Unemployment() +d = DateFormatter() + +#Set the Dates +d.start_date('1/1/1900') +d.end_date('1/1/2018') + +# Seasonally-Adjusted National Unemployment +df = u.national_unemp(sa=True) +df.head() + +# Non Seasonally-Adjusted National Unemployment +df = u.national_unemp(sa=False) +df.head() + + + + +%package -n python3-Federal +Summary: A wrapper on to the pandas-datareader package for easier handling of federal reserve (FRED) data +Provides: python-Federal +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-Federal +# Federal Package + +This is a simple module built on top of Pandas-Datareader to make it easer to pull in Federal Reserve Data from the Federal Reserve in St. Louis (FRED). + +## Installation + +`pip install Federal` + +## Basic Usage: + +```python + +# Import the GDP and DateFormatter Modules +from Federal.Econ import GDP +from Federal.Formatter import DateFormatter + +#Insatiate the GDP and DateFormatter Objects +g = GDP() +d = DateFormatter() + +#Set your Start & End Dates +d.start_date(1900,1,1) +d.end_date(2018,1,1) + +# Make the Call +df = g.metro_gdp(name='Houston') +df.head() +``` + +## Setting Start & End Dates + +Once imported, you declare the start date and end date via the `DateFormatter.start_date()` and `DateFormatter.end_date()` functions. These functions define the range of dates for the data that you are for. Once declared these values will be applied to each query unless explicitly changed. + +There are several different DateTime format variants that the `DateFormatter.start_date()` and `DateFormatter.end_date()` functions accept: + +1. DateTime format: (Year, Month, Day): **Integer** +```python +# Import the DateFormatter Modules +from Federal.Formatter import DateFormatter + +#Insatiate the DateFormatter Object +d = DateFormatter() + +d.start_date(1900,1,1) +d.end_date(2018,1,1) +``` + +2. DateTime format: (Day/Month/Year): **String** +```python +# Import the DateFormatter Modules +from Federal.Formatter import DateFormatter + +#Insatiate the DateFormatter Object +d = DateFormatter() + +d.start_date('1/1/1900') +d.end_date('1/1/2018') +``` + +3. DateTime format: (Day-Month-Year): **String** +```python +# Import the DateFormatter Modules +from Federal.Formatter import DateFormatter + +#Insatiate the DateFormatter Object +d = DateFormatter() + +d.start_date('1-1-1900') +d.end_date('1-1-2018') +``` + +4. DateTime format: (Day.Month.Year): **String** +```python +# Import the DateFormatter Modules +from Federal.Formatter import DateFormatter + +#Insatiate the DateFormatter Object +d = DateFormatter() + +d.start_date('1.1.1900') +d.end_date('1.1.2018') +``` + +5. DateTime format: (Month/Day/Year): **String** +```python +# Import the DateFormatter Modules +from Federal.Formatter import DateFormatter + +#Insatiate the DateFormatter Object +d = DateFormatter() + +d.start_date('14/1/1900') +d.end_date('16/1/2018') +``` + +### National Gross Domestic Product (GDP) + +After instantiating a FRED object, and defining the start and end dates using the `GDP.start_date()` and `GDP.end_date()` functions you can use the function `GDP.national_gdp()` depending on its parameters to return either nominal GDP or real GDP. + +```python +# Import the GDP and DateFormatter Modules +from Federal.Econ import GDP +from Federal.Formatter import DateFormatter + +#Insatiate the GDP and DateFormatter Objects +g = GDP() +d = DateFormatter() + +#Set Dates +d.start_date('1/1/1900') +d.end_date('1/1/2018') + +# Real GDP +df = g.national_gdp() +df.head() + +# Nominal GDP +df = g.national_gdp(nominal=True) +df.head() +``` + +### State Gross Domestic Product (GSP) + +Similar to the `GDP.national_gdp()` after making the necessary calls you can pull in information around State-Level GDP using the `GDP.state_gdp()` function. It requires one argument, which is the two-character string representing the state of interest. In the case below we pull the state GDP for Indiana. + +```python +# Import the GDP and DateFormatter Modules +from Federal.Econ import GDP +from Federal.Formatter import DateFormatter + +#Insatiate the GDP and DateFormatter Objects +g = GDP() +d = DateFormatter() + +#Set the Dates +d.start_date('1/1/1900') +d.end_date('1/1/2018') + +# State GDP +df = g.state_gdp('IN') +df.head() +``` + +### Metropolitan Gross Domestic Product (GMP) + +The final variation of GDP that the FRED module pulls in is Metropolitan-Level GDP. The Federal Reserve uses Core-Based Statistical Area (CBSA) Codes to define each metro within their API. Here using the `GDP.metro_gdp()` function you can either pass the CBSA code or a name of a metro area as arguments within the function. Beyond this, similar to national GDP, by passing `GDP.metro_gdp(name='<Any Metro Name>',nominal=True)` with nominal equal to True, the function will return the nominal metro GDP. + + +```python +# Import the GDP and DateFormatter Modules +from Federal.Econ import GDP +from Federal.Formatter import DateFormatter + +#Insatiate the GDP and DateFormatter Objects +g = GDP() +d = DateFormatter() + +#Set the Dates +d.start_date('1/1/1900') +d.end_date('1/1/2018') + +# Metropolitan GDP - Passing the City Name as an argument +df = g.metro_gdp(name='Houston') +df.head() + +# Metropolitan GDP - Passing the CBSA code as an argument +df = g.metro_gdp(cbsa=26420) +df.head() + +# Metropolitan GDP - nominal +df = g.metro_gdp(cbsa=26420, nominal=True) +df.head() + +# Metropolitan GDP - nominal +df = g.metro_gdp(name='Houston', nominal=True) +df.head() +``` +### National Unemployment + +Unemployment is defined by the `Unemployment.national_unemp()` function. This function takes an argument `sa` which returns either seasonally-adjusted non seasonally-adjusted unemployment. + +```python +# Import the GDP and DateFormatter Modules +from Federal.Econ import Unemployment +from Federal.Formatter import DateFormatter + +#Insatiate the GDP and DateFormatter Objects +u = Unemployment() +d = DateFormatter() + +#Set the Dates +d.start_date('1/1/1900') +d.end_date('1/1/2018') + +# Seasonally-Adjusted National Unemployment +df = u.national_unemp(sa=True) +df.head() + +# Non Seasonally-Adjusted National Unemployment +df = u.national_unemp(sa=False) +df.head() + + + + +%package help +Summary: Development documents and examples for Federal +Provides: python3-Federal-doc +%description help +# Federal Package + +This is a simple module built on top of Pandas-Datareader to make it easer to pull in Federal Reserve Data from the Federal Reserve in St. Louis (FRED). + +## Installation + +`pip install Federal` + +## Basic Usage: + +```python + +# Import the GDP and DateFormatter Modules +from Federal.Econ import GDP +from Federal.Formatter import DateFormatter + +#Insatiate the GDP and DateFormatter Objects +g = GDP() +d = DateFormatter() + +#Set your Start & End Dates +d.start_date(1900,1,1) +d.end_date(2018,1,1) + +# Make the Call +df = g.metro_gdp(name='Houston') +df.head() +``` + +## Setting Start & End Dates + +Once imported, you declare the start date and end date via the `DateFormatter.start_date()` and `DateFormatter.end_date()` functions. These functions define the range of dates for the data that you are for. Once declared these values will be applied to each query unless explicitly changed. + +There are several different DateTime format variants that the `DateFormatter.start_date()` and `DateFormatter.end_date()` functions accept: + +1. DateTime format: (Year, Month, Day): **Integer** +```python +# Import the DateFormatter Modules +from Federal.Formatter import DateFormatter + +#Insatiate the DateFormatter Object +d = DateFormatter() + +d.start_date(1900,1,1) +d.end_date(2018,1,1) +``` + +2. DateTime format: (Day/Month/Year): **String** +```python +# Import the DateFormatter Modules +from Federal.Formatter import DateFormatter + +#Insatiate the DateFormatter Object +d = DateFormatter() + +d.start_date('1/1/1900') +d.end_date('1/1/2018') +``` + +3. DateTime format: (Day-Month-Year): **String** +```python +# Import the DateFormatter Modules +from Federal.Formatter import DateFormatter + +#Insatiate the DateFormatter Object +d = DateFormatter() + +d.start_date('1-1-1900') +d.end_date('1-1-2018') +``` + +4. DateTime format: (Day.Month.Year): **String** +```python +# Import the DateFormatter Modules +from Federal.Formatter import DateFormatter + +#Insatiate the DateFormatter Object +d = DateFormatter() + +d.start_date('1.1.1900') +d.end_date('1.1.2018') +``` + +5. DateTime format: (Month/Day/Year): **String** +```python +# Import the DateFormatter Modules +from Federal.Formatter import DateFormatter + +#Insatiate the DateFormatter Object +d = DateFormatter() + +d.start_date('14/1/1900') +d.end_date('16/1/2018') +``` + +### National Gross Domestic Product (GDP) + +After instantiating a FRED object, and defining the start and end dates using the `GDP.start_date()` and `GDP.end_date()` functions you can use the function `GDP.national_gdp()` depending on its parameters to return either nominal GDP or real GDP. + +```python +# Import the GDP and DateFormatter Modules +from Federal.Econ import GDP +from Federal.Formatter import DateFormatter + +#Insatiate the GDP and DateFormatter Objects +g = GDP() +d = DateFormatter() + +#Set Dates +d.start_date('1/1/1900') +d.end_date('1/1/2018') + +# Real GDP +df = g.national_gdp() +df.head() + +# Nominal GDP +df = g.national_gdp(nominal=True) +df.head() +``` + +### State Gross Domestic Product (GSP) + +Similar to the `GDP.national_gdp()` after making the necessary calls you can pull in information around State-Level GDP using the `GDP.state_gdp()` function. It requires one argument, which is the two-character string representing the state of interest. In the case below we pull the state GDP for Indiana. + +```python +# Import the GDP and DateFormatter Modules +from Federal.Econ import GDP +from Federal.Formatter import DateFormatter + +#Insatiate the GDP and DateFormatter Objects +g = GDP() +d = DateFormatter() + +#Set the Dates +d.start_date('1/1/1900') +d.end_date('1/1/2018') + +# State GDP +df = g.state_gdp('IN') +df.head() +``` + +### Metropolitan Gross Domestic Product (GMP) + +The final variation of GDP that the FRED module pulls in is Metropolitan-Level GDP. The Federal Reserve uses Core-Based Statistical Area (CBSA) Codes to define each metro within their API. Here using the `GDP.metro_gdp()` function you can either pass the CBSA code or a name of a metro area as arguments within the function. Beyond this, similar to national GDP, by passing `GDP.metro_gdp(name='<Any Metro Name>',nominal=True)` with nominal equal to True, the function will return the nominal metro GDP. + + +```python +# Import the GDP and DateFormatter Modules +from Federal.Econ import GDP +from Federal.Formatter import DateFormatter + +#Insatiate the GDP and DateFormatter Objects +g = GDP() +d = DateFormatter() + +#Set the Dates +d.start_date('1/1/1900') +d.end_date('1/1/2018') + +# Metropolitan GDP - Passing the City Name as an argument +df = g.metro_gdp(name='Houston') +df.head() + +# Metropolitan GDP - Passing the CBSA code as an argument +df = g.metro_gdp(cbsa=26420) +df.head() + +# Metropolitan GDP - nominal +df = g.metro_gdp(cbsa=26420, nominal=True) +df.head() + +# Metropolitan GDP - nominal +df = g.metro_gdp(name='Houston', nominal=True) +df.head() +``` +### National Unemployment + +Unemployment is defined by the `Unemployment.national_unemp()` function. This function takes an argument `sa` which returns either seasonally-adjusted non seasonally-adjusted unemployment. + +```python +# Import the GDP and DateFormatter Modules +from Federal.Econ import Unemployment +from Federal.Formatter import DateFormatter + +#Insatiate the GDP and DateFormatter Objects +u = Unemployment() +d = DateFormatter() + +#Set the Dates +d.start_date('1/1/1900') +d.end_date('1/1/2018') + +# Seasonally-Adjusted National Unemployment +df = u.national_unemp(sa=True) +df.head() + +# Non Seasonally-Adjusted National Unemployment +df = u.national_unemp(sa=False) +df.head() + + + + +%prep +%autosetup -n Federal-1.0.1 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-Federal -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 31 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.1-1 +- Package Spec generated @@ -0,0 +1 @@ +1f1ac68de15ac8cb6aab4a96c1e8b6b3 Federal-1.0.1.tar.gz |