https://github.com/datachile/datachile-python-client
Python client to manage DataChile API
https://github.com/datachile/datachile-python-client
mondrian mondrian-rest opendata python
Last synced: over 1 year ago
JSON representation
Python client to manage DataChile API
- Host: GitHub
- URL: https://github.com/datachile/datachile-python-client
- Owner: datachile
- License: mit
- Created: 2018-01-25T12:52:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-08-19T13:59:09.000Z (almost 7 years ago)
- Last Synced: 2024-09-30T09:24:14.470Z (over 1 year ago)
- Topics: mondrian, mondrian-rest, opendata, python
- Language: Python
- Homepage:
- Size: 33.2 KB
- Stars: 20
- Watchers: 8
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# DataChile Python Client
`DataChile Python Client` is a Python 3 library to access the DataChile API. This library enables you to use public data from differents sources in your Python applications.
# Install
Install from PyPI, using pip:
`pip install datachile`
# Simple Demo
Interact with the API:
* Get all datasets availables in DataChile
```Python
from datachile import ChileCube
client = ChileCube()
query = client.get_cubes()
print(query)
```
* Get drilldowns availables from "Election Participation" dataset.
```Python
from datachile import ChileCube
client = ChileCube()
cube = "election_participation"
dd = client.get_drilldowns(cube)
ms = client.get_measures(cube)
print(dd)
print(ms)
```
* Get exports from Chile in 2012-2014, divided in Year and Destination Country
```Python
from datachile import ChileCube
client = ChileCube()
query = client.get(
"exports",
{
"drilldowns": [
["Date", "Year"],
["Destination Country", "Country", "Country"]
],
"measures": ["FOB US"],
"cuts": [
{
"drilldown": ["Date", "Year"],
"values": [2012, 2013, 2014]
}
],
"parents": True
}
)
print(query)
```
# Documentation
Please refer to our Wiki documentation for more information or [Datachile API Documentation Website](https://datachile.io/about/api).
# Development
## Contributing
Long-term discussion and bug reports are maintained via GitHub Issues. Code review is done via GitHub Pull Requests.
# License
The MIT License (MIT)
Copyright (c) 2018 Carlos Navarrete & Datawheel LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.