Skip to content

Commit

Permalink
Merge f21dd02 into 6f48f72
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus89 committed Sep 26, 2019
2 parents 6f48f72 + f21dd02 commit 6f29e79
Show file tree
Hide file tree
Showing 15 changed files with 179 additions and 261 deletions.
348 changes: 135 additions & 213 deletions NEWS.rst → CHANGELOG.md

Large diffs are not rendered by default.

44 changes: 19 additions & 25 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@ Try it Out
==========

* Stable (v0.10.1): |stable|
* Beta (v1.0b3): |beta|
* Latest (develop branch): |develop|
* Beta 2 (v1.0b2): |beta 2|

.. |stable| image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/cartodb/cartoframes/v0.10.1?filepath=examples

.. |develop| image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/cartodb/cartoframes/develop?filepath=examples

.. |beta 2| image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/cartodb/cartoframes/v1.0b2?filepath=examples
.. |beta| image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/cartodb/cartoframes/v1.0b3?filepath=examples

If you do not have an API key, you can still use cartoframes for creating maps locally.

The example context only provides read access, so not all cartoframes features are available. For full access, `Start a free 14 day trial <https://carto.com/signup>`__ or get free access with a `GitHub Student Developer Pack <https://education.github.com/pack>`__.

Features
========
Expand All @@ -36,7 +40,7 @@ Features
- Create customizable, interactive CARTO maps in a Jupyter notebook using DataFrames or hosted data
- Augment your data with CARTO's Data Observatory
- Use CARTO for cloud-based analysis
- Try it out without needing a CARTO account by using the `Examples functionality <https://cartoframes.readthedocs.io/en/latest/example_context.html>`__
- Try it out without needing a CARTO account by using the `Examples functionality <https://cartoframes.readthedocs.io/en/latest/examples.html>`__

Common Uses
===========
Expand All @@ -46,24 +50,13 @@ Common Uses
- Extract, transform, and Load (ETL) data using the Python ecosystem for getting data into and out of CARTO
- Data Services integrations using CARTO's `Location Data Streams <https://carto.com/platform/location-data-streams/>`__

Try it out
==========

The easiest way to try out cartoframes is to use the cartoframes example notebooks running in binder: https://mybinder.org/v2/gh/CartoDB/cartoframes/v0.10.1?filepath=examples If you already have an API key, you can follow along and complete all of the example notebooks.

If you do not have an API key, you can still use cartoframes for creating maps locally.

.. note::
The example context only provides read access, so not all cartoframes features are available. For full access, `Start a free 14 day trial <https://carto.com/signup>`__ or get free access with a `GitHub Student Developer Pack <https://education.github.com/pack>`__.

More info
=========

- Complete documentation: http://cartoframes.readthedocs.io/en/latest/
- Source code: https://github.com/CartoDB/cartoframes
- bug tracker / feature requests: https://github.com/CartoDB/cartoframes/issues

.. note::
`cartoframes` users must have a CARTO API key for most `cartoframes` functionality. For example, writing DataFrames to an account, reading from private tables, and visualizing data on maps all require an API key. CARTO provides API keys for education and nonprofit uses, among others. Request access at support@carto.com. API key access is also given through `GitHub's Student Developer Pack <https://carto.com/blog/carto-is-part-of-the-github-student-pack>`__.

Install Instructions
Expand All @@ -76,11 +69,11 @@ latest version:
$ pip install cartoframes
To install the 1.0b2 beta version:
To install the 1.0b3 beta version:

.. code:: bash
$ pip install cartoframes==1.0b2
$ pip install cartoframes==1.0b3
`cartoframes` is continuously tested on Python versions 2.7, 3.5, and 3.6. It is recommended to use `cartoframes` in Jupyter Notebooks (`pip install jupyter`). See the example usage section below or notebooks in the `examples directory <https://github.com/CartoDB/cartoframes/tree/master/examples>`__ for using `cartoframes` in that environment.

Expand All @@ -102,11 +95,11 @@ To setup `cartoframes` and `Jupyter` in a `virtual environment <http://python-gu
(venv) $ pip install cartoframes jupyter
(venv) $ jupyter notebook
To install the 1.0b2 version, run instead:
To install the 1.0b3 version, run instead:

.. code:: bash
(venv) $ pip install cartoframes==1.0b2 jupyter
(venv) $ pip install cartoframes==1.0b3 jupyter
Then create a new notebook and try the example code snippets below with tables that are in your CARTO account.

Expand All @@ -126,12 +119,12 @@ Alternatively, `pipenv <https://pipenv.readthedocs.io/en/latest/>`__ provides an
$ pipenv install cartoframes jupyter
$ pipenv run jupyter notebook
To install the 1.0b2 version, run instead:
To install the 1.0b3 version, run instead:

.. code:: bash
$ pipenv --three
$ pipenv install cartoframes==1.0b2 jupyter
$ pipenv install cartoframes==1.0b3 jupyter
$ pipenv run jupyter notebook
Native pip
Expand All @@ -143,11 +136,11 @@ If you install packages at a system level, you can install `cartoframes` with:
$ pip install cartoframes
or to install the 1.0b2 version:
or to install the 1.0b3 version:

.. code:: bash
$ pip install cartoframes==1.0b2
$ pip install cartoframes==1.0b3
Example usage
=============
Expand Down Expand Up @@ -184,7 +177,7 @@ Get table from CARTO, make changes in pandas, sync updates with CARTO:
if_exists='replace'
)
.. image:: https://raw.githubusercontent.com/CartoDB/cartoframes/master/docs/img/data-workflow.gif
.. image:: https://raw.githubusercontent.com/CartoDB/cartoframes/develop/docs/img/data-workflow.gif


Map workflow
Expand All @@ -209,6 +202,7 @@ Interactive vector maps can be created programmatically in CARTOframes. In addit
Map(color_continuous_layer('brooklyn_poverty', 'poverty_per_pop'))
Publish map to CARTO
^^^^^^^^^^^^^^^^^^^^

.. code:: python
Expand Down Expand Up @@ -237,7 +231,7 @@ Example: Get census tracts around Idaho Falls, Idaho, USA, and add median income
.. code:: python
from cartoframes.auth import set_default_credentials
from cartoframes.client import DataObsClient
from cartoframes.data.clients import DataObsClient
set_default_credentials(
base_url='https://your_user_name.carto.com',
Expand Down
2 changes: 1 addition & 1 deletion binder/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cartoframes==1.0b2
cartoframes==1.0b3
# Additional dependencies from examples
matplotlib
pandas
Expand Down
2 changes: 1 addition & 1 deletion cartoframes/__version__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""cartoframes version number"""
__title__ = 'cartoframes'
__description__ = 'CARTO Python package for data scientists'
__version__ = '1.0b2'
__version__ = '1.0b3'
__url__ = 'https://github.com/CartoDB/cartoframes'
__author__ = 'Andy Eschbacher'
__email__ = 'andy@carto.com'
Expand Down
4 changes: 2 additions & 2 deletions cartoframes/auth/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,13 @@ def save(self, config_file=None):
.. code::
from cartoframes import Credentials
from cartoframes.auth import Credentials
credentials = Credentials(username='eschbacher', api_key='abcdefg')
credentials.save() # save to default location
.. code::
from cartoframes import Credentials
from cartoframes.auth import Credentials
credentials = Credentials(username='eschbacher', api_key='abcdefg')
credentials.save('path/to/credentials/file')
"""
Expand Down
6 changes: 3 additions & 3 deletions cartoframes/data/clients/data_obs_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def boundaries(self, boundary=None, region=None, decode_geom=False,
.. code:: python
from cartoframes.auth import Credentials
from cartoframes.client import DataObsClient
from cartoframes.data.clients import DataObsClient
creds = Credentials('user name', 'api key')
do = DataObsClient(creds)
au_boundaries = do.boundaries(region='Australia')
Expand All @@ -81,7 +81,7 @@ def boundaries(self, boundary=None, region=None, decode_geom=False,
.. code:: python
from cartoframes.auth import Credentials
from cartoframes.client import DataObsClient
from cartoframes.data.clients import DataObsClient
credentials = Credentials('user name', 'api key')
# Note: default credentials will be supported in a future release
do = DataObsClient(credentials)
Expand Down Expand Up @@ -483,7 +483,7 @@ def augment(self, table_name, metadata, persist_as=None, how='the_geom'):
.. code::
from cartoframes.auth import Credentials
from cartoframes.client import DataObsClient
from cartoframes.data.clients import DataObsClient
creds = Credentials('user name', 'api key')
do = DataObsClient(creds)
median_income = do.discovery(
Expand Down
2 changes: 1 addition & 1 deletion cartoframes/data/clients/sql_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SQLClient(object):
.. code::
from cartoframes.auth import Credentials
from cartoframes.client import SQLClient
from cartoframes.data.clients import SQLClient
credentials = Credentials(username='<USER NAME>', api_key='<API KEY>')
sql = SQLClient(credentials)
Expand Down
2 changes: 1 addition & 1 deletion cartoframes/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def read_taxi(limit=None, **kwargs):
To create geometries with `examples.query`, write a query such
as this::
from cartoframes.client import SQLClient
from cartoframes.data.clients import SQLClient
sql = SQLClient(examples.get_credentials())
Expand Down
7 changes: 4 additions & 3 deletions cartoframes/utils/table.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
from carto.datasets import DatasetManager
from carto.auth import APIKeyAuthClient

from cartoframes.data import Dataset
from ..data import Dataset
from ..auth import get_default_credentials
from ..__version__ import __version__


def tables(credentials):
def tables(credentials=None):
"""List all tables in user's CARTO account
Returns:
:obj:`list` of :py:class:`Dataset <cartoframes.data.Dataset>`
"""
auth_client = _create_auth_client(credentials)
auth_client = _create_auth_client(credentials or get_default_credentials())
table_names = DatasetManager(auth_client).filter(
show_table_size_and_row_count='false',
show_table='false',
Expand Down
2 changes: 2 additions & 0 deletions cartoframes/viz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from .style import Style
from .popup import Popup
from .legend import Legend
from .legend_list import LegendList
from .widget import Widget
from .widget_list import WidgetList

Expand All @@ -25,6 +26,7 @@
'Style',
'Popup',
'Legend',
'LegendList',
'Widget',
'WidgetList'
]
12 changes: 6 additions & 6 deletions docs/developer-center/guides/01-Quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ You can install CARTOframes with `pip`. Simply type the following in the command
$ pip install cartoframes
```

To install the 1.0b2 beta version:
To install the 1.0b3 beta version:

```bash
$ pip install cartoframes==1.0b2
$ pip install cartoframes==1.0b3
```

To install through a Jupyter notebook, you can run
Expand All @@ -26,10 +26,10 @@ To install through a Jupyter notebook, you can run
! pip install cartoframes
```

To install the 1.0b2 beta version:
To install the 1.0b3 beta version:

```bash
!pip install cartoframes==1.0b2
!pip install cartoframes==1.0b3
```

It is recommended to install cartoframes in a [virtual environment](http://docs.python-guide.org/en/latest/dev/virtualenvs/). For example, you can run the following command to create a virtual env, activate it, and install cartoframes:
Expand All @@ -40,12 +40,12 @@ $ source cfenv/bin/activate
(cfenv) $ pip install cartoframes
```

To install the 1.0b2 beta version:
To install the 1.0b3 beta version:

```bash
$ virtualenv cfenv
$ source cfenv/bin/activate
(cfenv) $ pip install cartoframes==1.0b2
(cfenv) $ pip install cartoframes==1.0b3
```

You'll notice the virtual environment name in your command line prompt, like above. Type `deactivate` to exit the virtualenv:
Expand Down
4 changes: 2 additions & 2 deletions docs/maps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ Widget Functions
:noindex:
:members:

Vector Layers
^^^^^^^^^^^^^
Layers
^^^^^^

.. autoclass:: cartoframes.viz.Layer
:noindex:
2 changes: 1 addition & 1 deletion examples/_debug/SQL_client.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"outputs": [],
"source": [
"from cartoframes.auth import Credentials\n",
"from cartoframes.client import SQLClient"
"from cartoframes.data.clients import SQLClient"
]
},
{
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
-e git+https://github.com/CartoDB/carto-python.git#egg=carto
.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def walk_subpkg(name):

REQUIRES = [
'appdirs>=1.4.3,<2.0',
'carto>=1.6.0,<2.0',
'carto>=1.7.0,<2.0',
'jinja2>=2.10.1,<3.0',
'pandas>=0.24.2<1.0',
'shapely>=1.6.4,<2.0',
Expand Down

0 comments on commit 6f29e79

Please sign in to comment.