Beispiel #1
0
import maproulette
import json

# Create a configuration object using an API key
config = maproulette.Configuration(api_key='YOUR_API_KEY')

# Create an API object using your config object
api = maproulette.Api(config)

# We want to fetch a project with name 'Health Facilities in India'
my_project_name = 'Health Facilities in India'

# Print the API response
print(
    json.dumps(api.get_project_by_name(my_project_name),
               indent=4,
               sort_keys=True))
Beispiel #2
0
import json
import maproulette

# Create a configuration object using an API key
configuration = maproulette.Configuration(api_key='{YOUR_API_KEY}')

# Create an API object using your config object
api = maproulette.Api(configuration)

# Initialize a project model using the project name
my_project = maproulette.ProjectModel(name='my_new_project_name_20200120_abc')

# You can set other parameters like your project description like this:
my_project.description = 'my project description'

# Print the API response
print(json.dumps(api.create_project(my_project), indent=4, sort_keys=True))