L06_UsingTheGis_ArcGisOnline

In [1]:
from arcgis.gis import GIS
In [2]:
# use this
gis = GIS("https://www.arcgis.com", "<enter username here>", "<password>")

# or this if you want to not expose credentials

# import getpass
# password = getpass.getpass("Enter password: ")
# gis = GIS("https://www.arcgis.com","<enter username here>", password)
# print("Successfully logged in as: " + gis.properties.user.username)
In [13]:
user = gis.users.get('<your user name>')
In [14]:
user
Out[14]:
User One

Bio: None
First Name: User
Last Name: One
Username: User1_L1
Joined: February 01, 2017
In [16]:
user['firstName']
Out[16]:
'User'
In [6]:
user.lastName
Out[6]:
'Ramseth'
In [18]:
map1 = gis.map("New York, NY")
map1
In [12]:
from IPython.display import display
items = gis.content.search('*')
for item in items:
    display(item)
HorryCountyDemo2_WAB
Web Mapping Application by BenRamsethEsri5
Last Modified: February 23, 2017
0 comments, 6 views
CityBoundaryCharlotte
Feature Layer Collection by BenRamsethEsri5
Last Modified: February 01, 2017
0 comments, 2 views
DiscGolfCourses
Feature Layer Collection by BenRamsethEsri5
Last Modified: February 01, 2017
0 comments, 2 views
HorryCountyDiscGolf
HorryWeb Map by BenRamsethEsri5
Last Modified: February 23, 2017
0 comments, 2 views
DiscGolfCourses
CSV by BenRamsethEsri5
Last Modified: February 01, 2017
0 comments, 2 views
HorryCountyDemo2
Web Mapping Application by BenRamsethEsri5
Last Modified: February 23, 2017
0 comments, 1 views
Emergency_Response_Incidents
CSV by BenRamsethEsri5
Last Modified: February 01, 2017
0 comments, 1 views
CityBoundaryCharlotte
Shapefile by BenRamsethEsri5
Last Modified: February 01, 2017
0 comments, 1 views
FDNY_buf
Feature Layer Collection by BenRamsethEsri5
Last Modified: March 01, 2017
0 comments, 0 views
RoadWarrior
CSV by BenRamsethEsri5
Last Modified: February 01, 2017
0 comments, 0 views
In [10]:
gis.properties.portalName
Out[10]:
'ArcGIS Online'
In [11]:
gis.properties.customBaseUrl
Out[11]:
'maps.arcgis.com'
In [15]:
gis.properties.availableCredits
Out[15]:
2993.3923
In [ ]: