Skip to content

Commit

Permalink
Update changelog and example notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
heikomuller committed Feb 16, 2021
1 parent 06a1548 commit 53b0464
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* Use `appdirs.user_cache_dir` as parent directory for the default target directory for downloaded files (\#5).


### 0.2.0 - 2020-02-04
### 0.2.0 - 2020-02-16

* Repository index loader for different data sources. It is now possible to load the repository index from an Url, a locak file, or directly from a given dictionary.
* Support loading index files in Json or YAML format.
* Add package information and timestamp for downloaded datasets.
* Add optional value transformers to `distinct()` and `mapping()` methods of the `DatasetHandle` (\#4)
21 changes: 10 additions & 11 deletions docs/examples/Usage Example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
"text": [
"Downloaded datasets:\n",
"\n",
"> C1 Street Suffix Abbreviations (id=usps:street_abbrev)\n",
"> Cities in the U.S. (id=encyclopaedia_britannica:us_cities)\n",
"> REST Countries (id=restcountries.eu)\n"
]
Expand Down Expand Up @@ -157,7 +156,7 @@
"# in the restcountries dataset.\n",
"\n",
"print('Columns:\\n')\n",
"for col in refstore.open('restcountries.eu').columns:\n",
"for col in refstore.load('restcountries.eu').columns:\n",
" print(' {} (id={})'.format(col.name, col.identifier))"
]
},
Expand Down Expand Up @@ -230,7 +229,7 @@
"\n",
"import json\n",
"\n",
"print(json.dumps(refstore.open('restcountries.eu').to_dict(), indent=4))"
"print(json.dumps(refstore.load('restcountries.eu').to_dict(), indent=4))"
]
},
{
Expand All @@ -243,7 +242,6 @@
"name": "stdout",
"output_type": "stream",
"text": [
"usps:street_abbrev\n",
"encyclopaedia_britannica:us_cities\n"
]
}
Expand Down Expand Up @@ -357,7 +355,7 @@
"# which will download the datast if it is no in the local\n",
"# store.\n",
"\n",
"dataset = refstore.open('encyclopaedia_britannica:us_cities', auto_download=True)\n",
"dataset = refstore.load('encyclopaedia_britannica:us_cities', auto_download=True)\n",
"# Alternative shortcut:\n",
"# refstore.distinct(key='encyclopaedia_britannica:us_cities', columns='state')\n",
"\n",
Expand All @@ -383,7 +381,7 @@
{
"data": {
"text/plain": [
"'Canberra'"
"'CANBERRA'"
]
},
"execution_count": 9,
Expand All @@ -394,13 +392,14 @@
"source": [
"# Get a lookup table (dictionary) that maps the\n",
"# ISO 3166-1 3-letter country code to the country's\n",
"# captital city\n",
"# captital city. Convert values from both attributes\n",
"# to upper case before adding them to the mapping.\n",
"\n",
"dataset = refstore.open('restcountries.eu', auto_download=True)\n",
"dataset = refstore.load('restcountries.eu', auto_download=True)\n",
"# Alternative shortcut:\n",
"# refstore.mapping(key='restcountries.eu', lhs='alpha3Code', rhs='capital')\n",
"\n",
"mapping = dataset.mapping(lhs='alpha3Code', rhs='capital')\n",
"mapping = dataset.mapping(lhs='alpha3Code', rhs='capital', transformer=str.upper)\n",
"\n",
"mapping['AUS']"
]
Expand Down Expand Up @@ -500,11 +499,11 @@
"# Get data frame with country name, 3-letter country code,\n",
"# and capital city.\n",
"\n",
"dataset = refstore.open('restcountries.eu', auto_download=True)\n",
"dataset = refstore.load('restcountries.eu', auto_download=True)\n",
"# Alternative shortcut:\n",
"# refstore.load('restcountries.eu', ['name', 'alpha3Code', 'capital'])\n",
"\n",
"df = dataset.data_frame(['name', 'alpha3Code', 'capital'])\n",
"df = dataset.df(['name', 'alpha3Code', 'capital'])\n",
"\n",
"df.head()"
]
Expand Down

0 comments on commit 53b0464

Please sign in to comment.