|
1 | 1 | # Mapillary Python SDK |
2 | 2 |
|
3 | | - |
| 3 | +[![Contributors][contributors-shield]][contributors-url] |
| 4 | +[![Forks][forks-shield]][forks-url] |
| 5 | +[![Stargazers][stars-shield]][stars-url] |
| 6 | +[![Issues][issues-shield]][issues-url] |
| 7 | +[![MIT License][license-shield]][license-url] |
| 8 | + |
| 9 | +<br /> |
| 10 | + |
| 11 | +[![LinkedIn][linkedin-shield]][linkedin-url] |
| 12 | +[![Email][email-shield]][email-url] |
| 13 | +[![Twitter][twitter-shield]][twitter-url] |
| 14 | +[![Facebook][facebook-shield]][facebook-url] |
| 15 | + |
| 16 | +[](https://github.com/mapillary/mapillary-python-sdk/) |
| 17 | + |
| 18 | +<!-- PROJECT LOGO --> |
| 19 | +<div> |
| 20 | +<p align="center"> |
| 21 | + Mapillary's official Python SDK for GeoSpatial Data |
| 22 | + <br /> |
| 23 | + <a href="https://mapillary.github.io/mapillary-python-sdk/"><strong>Explore the docs »</strong></a> |
| 24 | + <br /> |
| 25 | + <br /> |
| 26 | + <a href="https://colab.research.google.com/drive/1BPWMP5k7QhXFB6nlWckHC1r54vIR0v2L?usp=sharing">View Demo</a> |
| 27 | + · |
| 28 | + <a href="https://github.com/mapillary/mapillary-python-sdk/issues/new?assignees=&labels=bug&template=bug_report.md&title=Bug+Report">Report Bug</a> |
| 29 | + · |
| 30 | + <a href="https://github.com/mapillary/mapillary-python-sdk/issues/new?assignees=&labels=feature&template=feature_request.md&title=Feature">Request Feature</a> |
| 31 | + · |
| 32 | + <a href="https://mapillary.github.io/mapillary-python-sdk/">See Documentation</a> |
| 33 | +</p> |
| 34 | +</div> |
| 35 | + |
| 36 | +<!-- TABLE OF CONTENTS --> |
| 37 | +## Table Of Contents |
| 38 | + |
| 39 | +- [Mapillary Python SDK](#mapillary-python-sdk) |
| 40 | + - [Table Of Contents](#table-of-contents) |
| 41 | +- [About](#about) |
| 42 | +- [Getting Started](#getting-started) |
| 43 | + - [Formatting/Linting](#formattinglinting) |
| 44 | + - [Building Package](#building-package) |
| 45 | +- [Contributing](#contributing) |
| 46 | +- [Links](#links) |
| 47 | + - [Mapillary](#mapillary) |
| 48 | + - [Legal](#legal) |
| 49 | +- [Acknowledgements](#acknowledgements) |
| 50 | + |
| 51 | +# About |
| 52 | + |
| 53 | +Mapillary's Python SDK provides an easy mechanism for accessing and retrieving information from Mapillary's web application. |
| 54 | + |
| 55 | +For more information, please visit [Mapillary](https://www.mapillary.com) and [Mapillary's Blog](https://blog.mapillary.com). |
| 56 | + |
| 57 | +# Getting Started |
| 58 | + |
| 59 | +To get started, simply install `mapillary `by running, |
4 | 60 |
|
5 | | -## Internal Resources |
| 61 | +```bash |
| 62 | +pip install mapillary |
| 63 | +``` |
6 | 64 |
|
7 | | -## Relevant Links |
| 65 | +A quick demo, |
8 | 66 |
|
9 | | -- [Python naming conventions](https://pythonguides.com/python-naming-conventions/) |
10 | | -- [Building a Python Open Source Project](https://towardsdatascience.com/build-your-first-open-source-python-project-53471c9942a7) |
11 | | -- [Example geospatial Python library, which we can reference for inspiration](https://github.com/gboeing/osmnx) |
12 | | -- [Mapillary blog on API v4 examples](https://blog.mapillary.com/update/2021/06/23/getting-started-with-the-new-mapillary-api-v4.html) |
13 | | -- [Facebook Open Source Legal Terms](https://opensource.fb.com/legal/terms/) |
14 | | -- [Facebook Open Source Privacy Policy](https://opensource.fb.com/legal/privacy/) |
| 67 | +```python |
| 68 | +""" |
| 69 | +Getting image coordinates from a nearby set of coordinates |
| 70 | +""" |
15 | 71 |
|
16 | | -## mapillary-python-sdk -External Documentation |
| 72 | +# Importing mapillary |
| 73 | +import mapillary.interface as mly |
17 | 74 |
|
18 | | -In this section, we keep a draft of the documentation. |
| 75 | +# JSON import |
| 76 | +import json |
19 | 77 |
|
20 | | -> here we should give a paragraph describing the library and what its capabilities are |
| 78 | +# Get image points close to in the given coordinates |
| 79 | +data = mly.get_image_close_to(longitude=31, latitude=30).to_dict() |
21 | 80 |
|
22 | | -## Getting Started |
23 | | - |
24 | | -How do I install the Mapillary Python SDK? See the installation instructions ***link to readthedocs.io***. |
| 81 | +# Save the data as JSON |
| 82 | +file_name = "get_image_close_to_1.json" |
| 83 | +with open(file_name, mode="w") as f: |
| 84 | + json.dump(data, f, indent=4) |
| 85 | +``` |
25 | 86 |
|
26 | | -How do I use the Mapillary Python SDK? See the usage examples and tutorials in the examples repo ***link to examples possibly***. |
| 87 | +You can check out all the implemented functionality from the [demo](https://colab.research.google.com/drive/1BPWMP5k7QhXFB6nlWckHC1r54vIR0v2L?usp=sharing). |
27 | 88 |
|
28 | | -How does this function work? Check out the documentation. |
| 89 | +Or you can check out the [documentation](https://mapillary.github.io/mapillary-python-sdk/)! |
29 | 90 |
|
30 | | -### Basic Start |
| 91 | +## Development |
31 | 92 |
|
32 | | -For installing `pipenv`, please see [here](https://pypi.org/project/pipenv/). |
| 93 | +### Formatting/Linting |
33 | 94 |
|
34 | | -To install packages from `Pipfile`, |
| 95 | +To run the formatter `black`, and the linter `flake8`, run, |
35 | 96 |
|
36 | 97 | ```bash |
37 | | -pipenv install |
| 98 | +flake8 mapillary & black mapillary |
38 | 99 | ``` |
39 | 100 |
|
40 | | -To install a package under `packages`, |
| 101 | +Or, if you are on Linux, you can simply run, |
41 | 102 |
|
42 | 103 | ```bash |
43 | | -pipenv install [package_name] |
| 104 | +make style |
44 | 105 | ``` |
45 | 106 |
|
46 | | -To install a package under `dev-packages`, |
| 107 | +This runs the `style` policy from the `Makefile`. |
47 | 108 |
|
48 | | -```bash |
49 | | -pipenv install --dev [package_name] |
50 | | -``` |
| 109 | +### Building package |
51 | 110 |
|
52 | | -To run `python` with `pipenv`, |
| 111 | +To build the package, run, |
53 | 112 |
|
54 | 113 | ```bash |
55 | | -pipenv run python |
| 114 | +python3 setup.py sdist bdist_wheel |
56 | 115 | ``` |
57 | 116 |
|
58 | | -To enter the virtual environment, run, |
| 117 | +To test out a local installation, run, |
59 | 118 |
|
60 | 119 | ```bash |
61 | | -pipenv shell |
| 120 | +pip install -e . |
62 | 121 | ``` |
63 | 122 |
|
64 | | -### Formatting/Linting |
| 123 | +# Contributing |
65 | 124 |
|
66 | | -To run the formatter `black`, and the linter `flake8`, run, |
| 125 | +We welcome contributions! See [CONTRIBUTING](CONTRIBUTING.md) for details on how to get started, and |
| 126 | +our [code of conduct](CODE_OF_CONDUCT.md). |
67 | 127 |
|
68 | | -```bash |
69 | | -flake8 mapillary & black mapillary |
70 | | -``` |
| 128 | +# Acknowledgements |
71 | 129 |
|
72 | | -Or, if you are on Linux, you can simply run, |
| 130 | +- [Christopher Beddow](https://github.com/cbeddow) - for leading the project |
| 131 | +- [Saif Ul Islam](https://github.com/rubix982) - for developing the SDK under MLH fellowship |
| 132 | +- [Omar Ali](https://github.com/OmarMuhammedAli) - for developing the SDK under MLH fellowship |
73 | 133 |
|
74 | | -```bash |
75 | | -make style |
76 | | -``` |
| 134 | +# Links |
77 | 135 |
|
78 | | -This runs the `style` policy from the `Makefile`. |
| 136 | +## Mapillary |
79 | 137 |
|
80 | | -### Building package |
| 138 | +- [Website](https://www.mapillary.com) |
| 139 | +- [Blog](https://blog.mapillary.com) |
| 140 | +- [Web App](https://www.mapillary.com/app) |
| 141 | +- [Forum](https://forum.mapillary.com) |
| 142 | +- [API V4 - Mapillary Blog](https://blog.mapillary.com/update/2021/06/23/getting-started-with-the-new-mapillary-api-v4.html) |
| 143 | + |
| 144 | +## Legal |
| 145 | + |
| 146 | +- [Facebook Open Source Legal Terms](https://opensource.fb.com/legal/terms/) |
| 147 | +- [Facebook Open Source Privacy Policy](https://opensource.fb.com/legal/privacy/) |
| 148 | + |
| 149 | +<!-- MARKDOWN LINKS & IMAGES --> |
| 150 | +<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --> |
| 151 | + |
| 152 | +<!-- Shields --> |
| 153 | + |
| 154 | +[contributors-shield]: https://img.shields.io/github/contributors/mapillary/mapillary-python-sdk.svg?style=for-the-badge |
| 155 | + |
| 156 | +[forks-shield]: https://img.shields.io/github/forks/mapillary/mapillary-python-sdk.svg?style=for-the-badge |
| 157 | + |
| 158 | +[stars-shield]: https://img.shields.io/github/stars/mapillary/mapillary-python-sdk.svg?style=for-the-badge |
| 159 | + |
| 160 | +[issues-shield]: https://img.shields.io/github/issues/mapillary/mapillary-python-sdk.svg?style=for-the-badge |
| 161 | + |
| 162 | +[license-shield]: https://img.shields.io/github/license/mapillary/mapillary-python-sdk.svg?style=for-the-badge |
| 163 | + |
| 164 | +[linkedin-shield]: https://img.shields.io/badge/LinkedIn-0A66C2.svg?style=for-the-badge&logo=linkedin&logoColor=white |
| 165 | + |
| 166 | +[email-shield]: https://img.shields.io/badge/gmail-EA4335?style=for-the-badge&logo=gmail&logoColor=white |
| 167 | + |
| 168 | +[twitter-shield]: https://img.shields.io/badge/twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white |
| 169 | + |
| 170 | +[facebook-shield]: https://img.shields.io/badge/facebook-1877F2?style=for-the-badge&logo=facebook&logoColor=white |
| 171 | + |
| 172 | +<!-- URLs --> |
| 173 | + |
| 174 | +[contributors-url]: https://github.com/mapillary/mapillary-python-sdk/graphs/contributors |
| 175 | + |
| 176 | +[forks-url]: https://github.com/mapillary/mapillary-python-sdk/network/members |
| 177 | + |
| 178 | +[stars-url]: https://github.com/mapillary/mapillary-python-sdk/stargazers |
| 179 | + |
| 180 | +[issues-url]: https://github.com/mapillary/mapillary-python-sdk/issues |
| 181 | + |
| 182 | +[license-url]: https://github.com/mapillary/mapillary-python-sdk/blob/master/LICENSE.txt |
| 183 | + |
| 184 | +[linkedin-url]: https://linkedin.com/in/othneildrew |
| 185 | + |
| 186 | +[email-url]: mailto:[email protected] |
| 187 | + |
| 188 | +[twitter-url]: https://twitter.com/mapillary |
81 | 189 |
|
82 | | -To build the package, run `python3 setup.py sdist bdist_wheel`. To test out a local installation, run `pip install -e .`. |
| 190 | +[facebook-url]: https://www.facebook.com/mapillary/ |
83 | 191 |
|
84 | | -## Contributing |
| 192 | +[website-url]: https://www.mapillary.com |
85 | 193 |
|
86 | | -We welcome contributions! See [CONTRIBUTING](CONTRIBUTING.md) for details on how to get started, and our [code of conduct](CODE_OF_CONDUCT.md). |
| 194 | +[blogs-url]: https://blog.mapillary.com |
87 | 195 |
|
88 | | -## License |
| 196 | +[application-url]: https://www.mapillary.com/app |
89 | 197 |
|
90 | | -Mapillary-Python-SDK is MIT licensed, as found in the [LICENSE](LICENSE) file. |
| 198 | +[forum-url]: https://forum.mapillary.com |
0 commit comments