<commit_before>fred
====

Python wrapper of the St. Louis Federal Reserve Bank's [FRED API web
service](http://api.stlouisfed.org/docs/fred/) for retrieving economic data.

FRED API Documentation:
[http://api.stlouisfed.org/docs/fred/](http://api.stlouisfed.org/docs/fred/)

Sign up for a FRED API key:
[http://api.stlouisfed.org/api_key.html](http://api.stlouisfed.org/api_key.html)

### API Key ###

You can save your API key, and have it automatically accessible, on the command line:

    $ export FRED_API_KEY=my_api_key


Usage
-----

This wrapper hopes to make working with the Fred API as easy as
possible.

```python
>>> import fred

# Save your FRED API key.
>>> fred.key('my_fred_api_key')


# Interact with economic data categories.
>>> fred.category()

>>> fred.categories()

>>> fred.children()

>>> fred.related()

>>> fred.category(series=True)

>>> fred.category_series()


# Interact with economic data releases.
>>> fred.releases()

>>> fred.release(123)

>>> fred.dates()


# Interact with economic data series.
>>> fred.series()

>>> fred.series(release=True)

>>> fred.observations()

>>> fred.search('search term')

>>> fred.updates()

>>> fred.vintage()


# Query economic data sources.
>>> fred.sources()

>>> fred.source(123)
```

**NOTE**: Normally, data is returned in dictionary format instead of XML. If you're
looking for XML output, however, just pass in the `xml=True` keyword argument.

```python
>>> import fred

>>> fred.releases(xml=True)
```<commit_msg>Updating some of the examples<commit_after>fred
====

Python wrapper of the St. Louis Federal Reserve Bank's [FRED API web
service](http://api.stlouisfed.org/docs/fred/) for retrieving economic data.

FRED API Documentation:
[http://api.stlouisfed.org/docs/fred/](http://api.stlouisfed.org/docs/fred/)

Sign up for a FRED API key:
[http://api.stlouisfed.org/api_key.html](http://api.stlouisfed.org/api_key.html)

### API Key ###

You can save your API key, and have it automatically accessible, on the command line:

    $ export FRED_API_KEY=my_api_key


Usage
-----

This wrapper hopes to make working with the Fred API as easy as
possible.

```python
>>> import fred

# Save your FRED API key.
>>> fred.key('my_fred_api_key')


# Interact with economic data categories.
>>> fred.category()

>>> fred.categories()

>>> fred.children()

>>> fred.related()

>>> fred.category(series=True)

>>> fred.category_series()


# Interact with economic data releases.
>>> fred.releases()

>>> fred.release(123)

>>> fred.dates()


# Interact with economic data series.
>>> fred.series(series_id="GNPCA")

>>> fred.series(release=True)

>>> fred.observations(series_id="AAA")

>>> fred.search('search term')

>>> fred.updates()

>>> fred.vintage(series_id="AAA")


# Query economic data sources.
>>> fred.sources()

>>> fred.source(123)
```

**NOTE**: Normally, data is returned in dictionary format instead of XML. If you're
looking for XML output, however, just pass in the `xml=True` keyword argument.

```python
>>> import fred

>>> fred.releases(xml=True)
```
{'fraction_non_alphanumeric': 0.1619047619047619, 'fraction_numerical': 0.003940886699507389, 'mean_word_length': 4.449016100178891, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 129, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5842034', 'n_tokens_mistral': 1074, 'n_tokens_neox': 1023, 'n_words': 282}