{ "info": { "author": "Brendan C. Ward", "author_email": "bcward@astutespruce.com", "bugtrack_url": null, "classifiers": [], "description": "# Mapbox MBtiles Utilities\n\nA Python 2.7 and 3 library for working with [Mabox mbtiles v1.1](https://github.com/mapbox/mbtiles-spec/blob/master/1.1/spec.md)\n\n[![Build Status](https://travis-ci.org/consbio/pymbtiles.svg?branch=master)](https://travis-ci.org/consbio/pymbtiles) [![Coverage Status](https://coveralls.io/repos/github/consbio/pymbtiles/badge.svg?branch=master)](https://coveralls.io/github/consbio/pymbtiles?branch=master)\n\n## Features\n\nProvides a lighweight Python API for reading and writing mbtiles files.\n\n[Mabox mbtiles v1.1](https://github.com/mapbox/mbtiles-spec/blob/master/1.1/spec.md) allow you to store geographic data as rendered image tiles or as vector tiles, along with associated metadata.\n\n## Installation\n\n```\npip install pymbtiles\n```\n\nTo install from master branch on GitHub using pip:\n\n```\npip install git+https://github.com/consbio/pymbtiles.git#egg=pymbtiles --upgrade\n```\n\n## Usage\n\n### Python API\n\nopen for reading and read a tile:\n\n```\nfrom pymbtiles import MBTiles\nwith MBtiles('my.mbtiles') as src:\n tile_data = src.read_tile(z=0, x=0, y=0)\n```\n\nreturns tile data in bytes.\n\nopen for writing (existing file will be overwritten):\n\n```\nwith MBtiles('my.mbtiles', mode='w') as out:\n out.write_tile(z=0, x=0, y=0, tile_data)\n```\n\nor write a bunch of tiles at once:\n\n```\nfrom pymbtiles import MBTiles, Tile\n\ntiles = (\n Tile(z=1, x=0, y=0, tile_data=first_tile),\n ...\n)\n\nwith MBtiles('my.mbtiles', mode='w') as out:\n out.write_tiles(tiles)\n```\n\nUse `r+` mode to read and write.\n\nMetadata is stored in the `meta` attribute of the mbtiles instance:\n\n```\nwith MBtiles('my.mbtiles') as src:\n metadata = src.meta\n```\n\nThis metadata is stored in the `metadata` table in the mbtiles file, and contains\na number of records required or optional under the\n[mbtiles specification](https://github.com/mapbox/mbtiles-spec/blob/master/1.1/spec.md) .\n\nTo update metadata:\n\n```\nwith MBtiles('my.mbtiles', 'r+') as out:\n out.meta['some_key'] = 'some_value'\n```\n\nYou can set several values at once by passing in a new `dict` object:\n\n```\nwith MBtiles('my.mbtiles', 'w') as out:\n out.meta = my_metadata_dict\n```\n\n## Listing available tiles\n\nTo list available tiles in the tileset:\n\n```\nwith MBtiles('my.mbtiles') as src:\n for tile_coords in src.list_tiles(): # [TileCoordinate(z, x, y)...]\n ...\n```\n\n_WARNING:_ for large tilesets, this can exceed available memory.\n\nTo list available tilesets for large tilesets, use:\n\n```\nwith MBtiles('my.mbtiles') as src:\n for batch in src.list_tiles_batched():\n for tile_coords in batch: # [TileCoordinate(z, x, y)...]\n ...\n```\n\n## Set operations\n\nThe `ops` module provides `extend`, `union`, and `difference` functions to perform set operations on tilesets.\n\nExtend a tileset with new tiles from a second:\n\n```\nextend(source_filename, target_filename)\n```\n\nCreate a new tileset with unique tiles combined from both left and right tilesets:\n\n```\nunion(left_filename, right_filename, out_filename)\n```\n\nCreate a new tileset from the tileset in the left tileset not present in the right tileset:\n\n```\ndifference(left_filename, right_filename, out_filename)\n```\n\n## Tile Scheme\n\nTiles are output to mbtiles format in xyz tile scheme.\n\n## Possibly useful:\n\n- [`mbtileserver`](https://github.com/consbio/mbtileserver): a lightweight Go tile server\n- [`tpkutils`](https://github.com/consbio/tpkutils): a library for converting ArcGIS tile cache to mbtiles\n\n## Changes :\n\n### 0.5.0\n\n- added `zoom_range`, `row_range`, `col_range` to provide basic information about tiles available in the tileset\n\n### 0.4.0\n\n- added `list_tiles` to list tiles and `list_tiles_batch` to list tiles in batches\n- added `ops` module with `extend`, `union`, `difference` functions\n\n### 0.3.0\n\n- all write-like operations for metadata and tiles are now overwrite by default\n\n## Credits:\n\nInspired by:\n\n- [mbutil](https://github.com/mapbox/mbutil)\n- [node-mbtiles](https://github.com/mapbox/node-mbtiles)\n\nSQL for creating mbtiles database derived from\n[node-mbtiles](https://github.com/mapbox/node-mbtiles)\n\n## License:\n\nSee LICENSE.md\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/consbio/pymbtiles", "keywords": "", "license": "ISC", "maintainer": "", "maintainer_email": "", "name": "pymbtiles", "package_url": "https://pypi.org/project/pymbtiles/", "platform": "", "project_url": "https://pypi.org/project/pymbtiles/", "project_urls": { "Homepage": "https://github.com/consbio/pymbtiles" }, "release_url": "https://pypi.org/project/pymbtiles/0.5.0/", "requires_dist": [ "pytest ; extra == 'test'", "pytest-cov ; extra == 'test'" ], "requires_python": "", "summary": "MapBox Mbtiles Utilities", "version": "0.5.0" }, "last_serial": 5986282, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "725d7b16b2ff3119ab1a5afdbf12b49a", "sha256": "ebc5985153f93638385104d6fe70250039e617e59e31fd19309b6a479b623400" }, "downloads": -1, "filename": "pymbtiles-0.1.0.tar.gz", "has_sig": false, "md5_digest": "725d7b16b2ff3119ab1a5afdbf12b49a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5219, "upload_time": "2017-05-21T01:05:04", "url": "https://files.pythonhosted.org/packages/63/81/b0996ce2bf7f4ada1473395fed7481527b3d5b0479db6740012790697c6a/pymbtiles-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "394837f9fd1137711cff40013726d02d", "sha256": "51ae46e68bb5ec2144b9894fdf1d67ad904668f09a25220a9c4bb40c7fc8eaaa" }, "downloads": -1, "filename": "pymbtiles-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "394837f9fd1137711cff40013726d02d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4714, "upload_time": "2018-04-25T06:07:20", "url": "https://files.pythonhosted.org/packages/c6/33/b546dfd76282648c67b0e8f0346922e71bb96b86f1a3c2e84917629b8bcc/pymbtiles-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a342707b6fbf0db2c65f48acf8e939d8", "sha256": "c908741b4314c1381a2cffe30e4701ebf2864e0110860d008fda151d849fa0d2" }, "downloads": -1, "filename": "pymbtiles-0.2.0.tar.gz", "has_sig": false, "md5_digest": "a342707b6fbf0db2c65f48acf8e939d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5134, "upload_time": "2018-04-25T06:07:22", "url": "https://files.pythonhosted.org/packages/2c/13/e592fdd8981df0c1d8d63e78928557660f86897dba4c26b7a52b4dfc5f82/pymbtiles-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "26e133baf0525732e25c60fa6a6ce028", "sha256": "833909bdd1299f50b9c7fcb0b09c25c1166178a9aa5bd50b32088762c798c09a" }, "downloads": -1, "filename": "pymbtiles-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "26e133baf0525732e25c60fa6a6ce028", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5482, "upload_time": "2019-02-13T13:05:08", "url": "https://files.pythonhosted.org/packages/53/9e/937ff308ca22a5f192e21f348cab36d4f647518a9733122f26d9278c155b/pymbtiles-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "80b8beeba931363af6f21fb380a616c3", "sha256": "cb29e3ec89e6c33e443e5cc2b43ca77998696b4e6958884047f23837a035fd51" }, "downloads": -1, "filename": "pymbtiles-0.3.0.tar.gz", "has_sig": false, "md5_digest": "80b8beeba931363af6f21fb380a616c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5212, "upload_time": "2019-02-13T13:05:09", "url": "https://files.pythonhosted.org/packages/4a/bf/aa829e8630b39aa31574561cf29921558e7d05428126ace452e3d1da696c/pymbtiles-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "b6e43abdd18b80ee7ecf8c5252f81098", "sha256": "309487de7fcb5d217067cac296c3e3812020aa133f43a34ed1d8d293dfee0b64" }, "downloads": -1, "filename": "pymbtiles-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b6e43abdd18b80ee7ecf8c5252f81098", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6908, "upload_time": "2019-02-13T13:48:16", "url": "https://files.pythonhosted.org/packages/0a/b4/7df5aa849a3c41115cd78e1633c4a91add6e5f3981572019939a53f96f57/pymbtiles-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3c00492628e8e500e791b8d9594ebb5f", "sha256": "cdd517f2f42177197e6ad3e25d69a37d6269e2fca64e64adaf1ba6da1c73a1c4" }, "downloads": -1, "filename": "pymbtiles-0.3.1.tar.gz", "has_sig": false, "md5_digest": "3c00492628e8e500e791b8d9594ebb5f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5226, "upload_time": "2019-02-13T13:48:18", "url": "https://files.pythonhosted.org/packages/38/73/f174cec456d69d79997928cc50bc414833375a5471113d27f65d6dc1a006/pymbtiles-0.3.1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "0239809259210ef67545a4913eeee0e9", "sha256": "9309569b07477799addb8fc071eb57395209a30d0cdbf93989835677eae3d538" }, "downloads": -1, "filename": "pymbtiles-0.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0239809259210ef67545a4913eeee0e9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8737, "upload_time": "2019-10-16T19:13:54", "url": "https://files.pythonhosted.org/packages/7c/27/4af601eeb96094719a3ca90810be4821a5e42031dc680c9e8c35b740a54f/pymbtiles-0.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "423639d303220c9766af9309b7289cfc", "sha256": "cfa590a19e990377934a76ca9c6d0883c25ac1ba3c261dedf25df1ee15fe4f83" }, "downloads": -1, "filename": "pymbtiles-0.4.0.tar.gz", "has_sig": false, "md5_digest": "423639d303220c9766af9309b7289cfc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6820, "upload_time": "2019-10-16T19:13:56", "url": "https://files.pythonhosted.org/packages/ae/96/44f352bb36e28282f8b6278e9604d9a4174d635752580bdcff0a61f9ae6e/pymbtiles-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "1bb90b8e49c2eb52a9fd8f2817375497", "sha256": "91c1c2fa3e25f581d563a60e705105f7277b0dbb9ff727c8c28cb66f0f891c84" }, "downloads": -1, "filename": "pymbtiles-0.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1bb90b8e49c2eb52a9fd8f2817375497", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9002, "upload_time": "2019-10-16T20:42:14", "url": "https://files.pythonhosted.org/packages/82/ba/a05974655e73d7937b8e5438bf7ca5dba0b7d84dc67e98fb40c81dc92fca/pymbtiles-0.5.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "81e6fc4253edfd164004ea442fbaa995", "sha256": "b4eb2c470d2eb3d94627cdc8a8ae448b8899af2dd696f9a5eca706ddf8293b58" }, "downloads": -1, "filename": "pymbtiles-0.5.0.tar.gz", "has_sig": false, "md5_digest": "81e6fc4253edfd164004ea442fbaa995", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7071, "upload_time": "2019-10-16T20:42:17", "url": "https://files.pythonhosted.org/packages/75/ff/9ae83bb0cf6c504d675b917eae3ad9e9f919fda3fea51de9f737ac0ccf27/pymbtiles-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1bb90b8e49c2eb52a9fd8f2817375497", "sha256": "91c1c2fa3e25f581d563a60e705105f7277b0dbb9ff727c8c28cb66f0f891c84" }, "downloads": -1, "filename": "pymbtiles-0.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1bb90b8e49c2eb52a9fd8f2817375497", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9002, "upload_time": "2019-10-16T20:42:14", "url": "https://files.pythonhosted.org/packages/82/ba/a05974655e73d7937b8e5438bf7ca5dba0b7d84dc67e98fb40c81dc92fca/pymbtiles-0.5.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "81e6fc4253edfd164004ea442fbaa995", "sha256": "b4eb2c470d2eb3d94627cdc8a8ae448b8899af2dd696f9a5eca706ddf8293b58" }, "downloads": -1, "filename": "pymbtiles-0.5.0.tar.gz", "has_sig": false, "md5_digest": "81e6fc4253edfd164004ea442fbaa995", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7071, "upload_time": "2019-10-16T20:42:17", "url": "https://files.pythonhosted.org/packages/75/ff/9ae83bb0cf6c504d675b917eae3ad9e9f919fda3fea51de9f737ac0ccf27/pymbtiles-0.5.0.tar.gz" } ] }