Skip to main content

Downloads various stlouisfed.org FRED files to CSV files and creates plots based on category, release, series, source, or tag

Project description

FREDquery

FredQuery uses the stlouisfed.org FRED API(https://fred.stlouisfed.org/docs/api/fred/) for the most part to access FRED data. To access the data you have to use an api_key that can be acquired here(https://fred.stlouisfed.org/docs/api/api_key.html). These scripts assume that the api_key is available through the FRED_API_KEY environmental variable. Each script including fredsources script will collect basic data for its type. For example fredcategories will collect data for all its categories. They can also collect series and observations(timeseries) for its type. To find a series, first invoke the command with it's type. For example: 'fredcategories --categories --showcategories' This will display the categories in a table in your browser. Choose a series based on the typeid you choose from the first fred command. For example: 'fredcategories --series --categoryid 32145 --showseries' From the output of this command you will be able to choose the time series observations that you wish to evaluate.

This is a work in progress fredplotseries creates plots for a comma separated list of series_id. fredplot creates plots and descriptions for series related to categories, releases, sources, or tags. The descriptions are taken from the series data while the plots use the observation data

[Usage]


##
## fredcategories
##
usage: fredcategories [-h] [--categories] [--showcategories] [--children]
[--showchildren] [--series] [--showseries]
[--observations] [--categoryid CATEGORYID]
[--file FILE] [--directory DIRECTORY]

collect and report stlouisfed.org FRED categories and/or series

options:
-h, --help show this help message and exit
--categories report category data
--showcategories show categories in your browser
--children report category child data
--showchildren show children of a category in your browser
--series report series urls for categories collected
--showseries show series for a category in your browser
--observations report timeseries data for categories
--categoryid CATEGORYID
categories are identified by category_id
--file FILE path to an output filename if just a filename and--
directory is not provided the file is created in the
current directory
--directory DIRECTORY
directory to write the output use --directory for
storing observations, filenames autogenerated


##
## fredreleases
##
usage: fredreleases [-h] [--releases] [--showreleases] [--series]
[--showseries] [--observations] [--releaseid RELEASEID]
[--seriesid SERIESID] [--file FILE]
[--directory DIRECTORY]

collect and report stlouisfed.org FRED releases and/or their time series

options:
-h, --help show this help message and exit
--releases return releases
--showreleases show releases in your browser
--series return series by series_id or by release_id
--showseries show series for a release_id in your browser
--observations return timeseries for all series collected
--releaseid RELEASEID
a release_id identifies a FRED release
--seriesid SERIESID a series_id identifies a FRED series
--file FILE path to an output filename if just a filename and--
directory is not provided the file is created in the
current directory
--directory DIRECTORY
directory to write the output, if --observations
filenames are autogenerated


##
## fredseries
##
usage: fredseries [-h] [--series] [--showseries] [--observations]
[--categories] [--releases] [--sources] [--tags]
[--updates] --seriesid SERIESID [--file FILE]
[--directory DIRECTORY]

collect and report stlouisfed.org FRED series

options:
-h, --help show this help message and exit
--series report series urls for series_id
--showseries show the series in your browser
--observations report timeseries data for series
--categories report categories for this series
--releases report categories for this series
--sources report sources for this series
--tags report tags for this series
--updates report updates for this series
--seriesid SERIESID series are identified by series_id
--file FILE path to an output filename if just a filename and--
directory is not provided the file is created in the
current directory
--directory DIRECTORY
directory to write the output use --directory for
storing observations, filenames autogenerated


##
## fredplot
##
usage: fredplot [-h] [--categoryid CATEGORYID] [--releaseid RELEASEID]
[--sourceid SOURCEID] [--tagname TAGNAME]
[--directory DIRECTORY]

plot a set of St. Louis Fed FRED series

options:
-h, --help show this help message and exit
--categoryid CATEGORYID FRED category_id
--releaseid RELEASEID FRED release_id
--sourceid SOURCEID FRED source_id
--tagname TAGNAME FRED tagname
--directory DIRECTORY
where to store html


##
## fredplotseries
##
usage: fredplotseries [-h] --serieslist SERIESLIST [--htmlfile HTMLFILE]

plot a series list

options:
-h, --help show this help message and exit
--serieslist SERIESLIST comma separated list of FRED series_id's
--htmlfile HTMLFILE path to file that will contain the plot


##
## fredsources
##
usage: fredsources [-h] [--sources] [--showsources] [--releases]
[--showreleasesforsid] [--series] [--showseries]
[--observations] [--sourceid SOURCEID] [--file FILE]
[--directory DIRECTORY]

collect and report stlouisfed.org FRED sources and/or their releases

options:
-h, --help show this help message and exit
--sources return sources
--showsources show sources in your browser
--releases return releases for a source_id
--showreleasesforsid show releases for a source_id in your browser
--series return series for a source_id
--showseries show series for a series_id in your browser
--observations return observations for a source_id
--sourceid SOURCEID a source_id identifies a FRED source
--file FILE path to an output filename if just a filename and--
directory is not provided the file is created in the
current directory
--directory DIRECTORY
directory to write the output, if --observations
filenames are autogenerated


##
## fredtags
##
usage: fredtags [-h] [--tags] [--showtags] [--series] [--showseries]
[--observations] [--tagname TAGNAME] [--seriesid SERIESID]
[--file FILE] [--directory DIRECTORY]

collect and report stlouisfed.org FRED tags and/or their series

options:
-h, --help show this help message and exit
--tags return tags
--showtags show tags in your browser
--series return series for a tag_id or for a series_id
--showseries show series for a tagname in your browser
--observations report timeseries data for tags
--tagname TAGNAME comma separated list of tag_names
--seriesid SERIESID series_id - identifies a series
--file FILE path to an output filename if just a filename and--
directory is not provided the file is created in the
current directory
--directory DIRECTORY
save the output to the directory specified

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fredquery-0.0.54.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

fredquery-0.0.54-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file fredquery-0.0.54.tar.gz.

File metadata

  • Download URL: fredquery-0.0.54.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for fredquery-0.0.54.tar.gz
Algorithm Hash digest
SHA256 05cf4b187606fa019f907ad0a8b7fd3b9cbc5fcdba31610d637cad8c068910fa
MD5 fda4027d1fb7c3af79193045894c3f50
BLAKE2b-256 cdbe0d19dd59efd95f4ef0962fe2ab68bdb90917454306192349610ace87ba6c

See more details on using hashes here.

File details

Details for the file fredquery-0.0.54-py3-none-any.whl.

File metadata

  • Download URL: fredquery-0.0.54-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for fredquery-0.0.54-py3-none-any.whl
Algorithm Hash digest
SHA256 e457e227ba2871d4b543cf177bfb6ef5b0b4efa71e540473081918d660eef6af
MD5 93cb601493994430e07d57c41477af45
BLAKE2b-256 f6d1fb49687c34d888183530eafdb4072bb457faff260a3c587fc4b1631874d3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page