Skip to content

Commit e988ec9

Browse files
authored
Remove deprecated population and observation code (#176)
* Remove deprecated population and observation code * remove api key doc; format
1 parent 262547a commit e988ec9

10 files changed

Lines changed: 130 additions & 996 deletions

File tree

README.md

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ This is a Python library for accessing data in the Data Commons Graph.
44

55
> See also: [Data Commons Pandas API](datacommons_pandas/README.md).
66
7-
87
To get started, install this package from pip.
98

109
pip install datacommons
@@ -13,28 +12,19 @@ Once the package is installed, import `datacommons`.
1312

1413
import datacommons as dc
1514

16-
If you would like to provide an API key, follow the steps in
17-
[Setting up access to the Data Commons API](https://docs.datacommons.org/api/setup.html),
18-
add the following line to your code:
19-
20-
dc.set_api_key('YOUR-API-KEY')
21-
22-
Data Commons *does not charge* users, but uses the API key for
23-
understanding API usage.
24-
2515
For more detail on getting started with the API, please visit our
26-
[API Overview](http://docs.datacommons.org/api/).
16+
[API Overview](https://docs.datacommons.org/api/).
2717

2818
When you are ready to use the API, you can refer to `datacommons/examples` for
2919
examples on how to use this package to perform various tasks. More tutorials and
30-
documentation can be found on our [tutorials page](https://datacommons.org/colab)!
20+
documentation can be found on our [tutorials page](https://docs.datacommons.org/tutorials/)!
3121

3222
## About Data Commons
3323

3424
[Data Commons](https://datacommons.org/) is an open knowledge repository that
3525
provides a unified view across multiple public data sets and statistics. You can
3626
view what [datasets](https://datacommons.org/datasets) are currently ingested
37-
and browse the graph using our [browser](https://browser.datacommons.org/).
27+
and browse the graph using our [browser](https://datacommons.org/browser).
3828

3929
## License
4030

@@ -46,22 +36,22 @@ The Python API currently supports `python>=2.7`.
4636

4737
To test, run:
4838

49-
```
50-
$ ./run_tests_local.sh
39+
```bash
40+
./run_tests_local.sh
5141
```
5242

5343
To debug the continuous integration tests, run:
5444

55-
```
56-
$ cloud-build-local --config=cloudbuild.yaml --dryrun=false .
45+
```bash
46+
cloud-build-local --config=cloudbuild.yaml --dryrun=false .
5747
```
5848

5949
Both commands will run the same set of tests.
6050

6151
To run the examples:
6252

63-
```
64-
$ python -m datacommons.examples.XXX
53+
```bash
54+
python -m datacommons.examples.XXX
6555
```
6656

6757
where XXX is the module you want to run.
@@ -76,44 +66,54 @@ starting from the
7666

7767
### Release to Test PyPI
7868

79-
1. In [setup_datacommons.py](setup_datacommons.py) and
80-
[setup_datacommons_pandas.py](setup_datacommons_pandas.py):
81-
- Append "-USERNAME" to the package "NAME". For example,
82-
`NAME = 'foo_package-janedoe123'`.
83-
- Increment the "VERSION" codes to something that has not been used in your
69+
1. In [setup_datacommons.py](setup_datacommons.py) and [setup_datacommons_pandas.py](setup_datacommons_pandas.py):
70+
71+
- Append "-USERNAME" to the package "NAME". For example,
72+
`NAME = 'foo_package-janedoe123'`.
73+
- Increment the "VERSION" codes to something that has not been used in your
8474
test project. This will not affect the production PyPI versioning.
75+
8576
1. Build the dists:
86-
```bash
87-
rm dist/*
88-
python3 -m pip install --user --upgrade setuptools wheel
89-
python3 setup_datacommons.py sdist bdist_wheel
90-
python3 setup_datacommons_pandas.py sdist bdist_wheel
91-
```
77+
78+
```bash
79+
rm dist/*
80+
python3 -m pip install --user --upgrade setuptools wheel
81+
python3 setup_datacommons.py sdist bdist_wheel
82+
python3 setup_datacommons_pandas.py sdist bdist_wheel
83+
```
84+
9285
1. Release the dists to TestPyPI:
93-
```bash
94-
python3 -m pip install --user --upgrade twine
95-
python3 -m twine upload --repository testpypi dist/*
96-
```
86+
87+
```bash
88+
python3 -m pip install --user --upgrade twine
89+
python3 -m twine upload --repository testpypi dist/*
90+
```
9791

9892
### Release to Production PyPI
93+
9994
1. In [setup_datacommons.py](setup_datacommons.py) and
100-
[setup_datacommons_pandas.py](setup_datacommons_pandas.py):
101-
- Revert the package name to `datacommons` and `datacommons_pandas`
102-
- Update and double check "VERSION"
103-
1. Update [CHANGELOG.md](CHANGELOG.md) and
104-
[datacommons_pandas/CHANGELOG.md](datacommons_pandas/CHANGELOG.md)
95+
[setup_datacommons_pandas.py](setup_datacommons_pandas.py):
96+
97+
- Revert the package name to `datacommons` and `datacommons_pandas`
98+
- Update and double check "VERSION"
99+
100+
1. Update [CHANGELOG.md](CHANGELOG.md) and [datacommons_pandas/CHANGELOG.md](datacommons_pandas/CHANGELOG.md)
101+
105102
1. Build the dists:
106-
```bash
107-
rm dist/*
108-
python3 -m pip install --user --upgrade setuptools wheel
109-
python3 setup_datacommons.py sdist bdist_wheel
110-
python3 setup_datacommons_pandas.py sdist bdist_wheel
111-
```
103+
104+
```bash
105+
rm dist/*
106+
python3 -m pip install --user --upgrade setuptools wheel
107+
python3 setup_datacommons.py sdist bdist_wheel
108+
python3 setup_datacommons_pandas.py sdist bdist_wheel
109+
```
110+
112111
1. Release the dists to PyPI:
113-
```bash
114-
python3 -m pip install --user --upgrade twine
115-
twine upload dist/*
116-
```
112+
113+
```bash
114+
python3 -m pip install --user --upgrade twine
115+
twine upload dist/*
116+
```
117117

118118
## Support
119119

cloudbuild.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
steps:
2-
3-
- id: api_python
4-
name: python:3.7-slim
5-
entrypoint: /bin/sh
6-
args:
7-
- -c
8-
- 'pip3 install -r requirements.txt && python3 -m pytest'
2+
- id: api_python
3+
name: python:3.7-slim
4+
entrypoint: /bin/sh
5+
args:
6+
- -c
7+
- "pip3 install -r requirements.txt && python3 -m pytest"

datacommons/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
# Data Commons Python API
2828
from datacommons.core import get_property_labels, get_property_values, get_triples
2929
from datacommons.places import get_places_in, get_related_places, get_stats
30-
from datacommons.populations import get_populations, get_observations, get_pop_obs, get_place_obs
3130
from datacommons.stat_vars import get_stat_value, get_stat_series, get_stat_all
3231

3332
# Other utilities

datacommons/examples/populations.py

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)